aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2018-07-11 15:15:48 +0300
committerIgor Pashev <pashev.igor@gmail.com>2018-07-11 15:15:48 +0300
commit46716ae53b90f8c6c4c523bf2f65b783adb69003 (patch)
tree473062a09e68b6fe04b49e6a0d77aa0b157a6fdb /modules/pkgs
parent8d908c378c1eaae71dd6fdef2f5af64f9cce9ed4 (diff)
downloadnixsap-46716ae53b90f8c6c4c523bf2f65b783adb69003.tar.gz
Update nix-serve for Nix 2.0
Diffstat (limited to 'modules/pkgs')
-rw-r--r--modules/pkgs/nix-serve/nix-serve.psgi10
1 files changed, 4 insertions, 6 deletions
diff --git a/modules/pkgs/nix-serve/nix-serve.psgi b/modules/pkgs/nix-serve/nix-serve.psgi
index 696f752..e368531 100644
--- a/modules/pkgs/nix-serve/nix-serve.psgi
+++ b/modules/pkgs/nix-serve/nix-serve.psgi
@@ -44,13 +44,11 @@ my $app = sub {
$res .= "Deriver: " . stripPath($deriver) . "\n" if defined $deriver;
my $secretKeyFile = $ENV{'NIX_SECRET_KEY_FILE'};
if (defined $secretKeyFile) {
- my $s = readFile $secretKeyFile;
- chomp $s;
- my ($keyName, $secretKey) = split ":", $s;
- die "invalid secret key file ‘$secretKeyFile’\n" unless defined $keyName && defined $secretKey;
+ my $secretKey = readFile $secretKeyFile;
+ chomp $secretKey;
my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs);
- my $sig = encode_base64(signString(decode_base64($secretKey), $fingerprint), "");
- $res .= "Sig: $keyName:$sig\n";
+ my $sig = signString($secretKey, $fingerprint);
+ $res .= "Sig: $sig\n";
}
return [200, ['Content-Type' => 'text/x-nix-narinfo'], [$res]];
}