diff --git a/src/lib/Hydra/View/NARInfo.pm b/src/lib/Hydra/View/NARInfo.pm index 801fc06a5..2657cc2fe 100644 --- a/src/lib/Hydra/View/NARInfo.pm +++ b/src/lib/Hydra/View/NARInfo.pm @@ -9,6 +9,7 @@ use Nix::Manifest; use Nix::Store; use Nix::Utils; use Hydra::Helper::Nix; +use File::Slurp qw/readFile/; use base qw/Catalyst::View/; sub process { @@ -38,7 +39,11 @@ sub process { # Optionally, sign the NAR info file we just created. my $secretKeyFile = $c->config->{binary_cache_secret_key_file}; if (defined $secretKeyFile) { - my $secretKey = readFile $secretKeyFile; + my $secretKey = ""; + open my $fh, '<', $secretKeyFile or die "Could not open file '$secretKeyFile' $!"; + while (<$fh>) { + $secretKey .= $_; + } my $fingerprint = fingerprintPath($storePath, $narHash, $narSize, $refs); my $sig = signString($secretKey, $fingerprint); $info .= "Sig: $sig\n";