allows for specifying the public key directly

This makes it possible to use in pure mode
This commit is contained in:
Gabriel Fontes 2021-10-23 11:57:55 -03:00
parent d308dd9b24
commit 8821e4aeaa
No known key found for this signature in database
GPG key ID: 2E54EA7BFE630916

View file

@ -21,7 +21,7 @@ in
type = types.nullOr types.path;
default = null;
description = ''
The private key to sign the derivations with.
File containing the private key to sign the derivations with.
'';
};
@ -29,7 +29,15 @@ in
type = types.nullOr types.path;
default = null;
description = ''
The private key to sign the derivations with.
File containing the public key to sign the derivations with.
'';
};
publicKey = lib.mkOption {
type = types.nullOr types.path;
default = null;
description = ''
The public key to sign the derivations with.
'';
};
@ -132,9 +140,10 @@ in
binaryCaches = [
"http://127.0.0.1:12304/"
];
binaryCachePublicKeys = lib.mkIf (cfg.publicKeyFile != null) [
(builtins.readFile cfg.publicKeyFile)
];
binaryCachePublicKeys = [
lib.mkIf (cfg.publicKeyFile != null) (builtins.readFile cfg.publicKeyFile)
lib.mkIf (cfg.publicKey != null) cfg.publicKey
];
extraOptions = lib.mkIf (cfg.globalCacheTTL != null) ''
narinfo-cache-negative-ttl = ${toString cfg.globalCacheTTL}