|
| 1 | +From 9e434fff4486afeb3cc3f631f6dc56492b204704 Mon Sep 17 00:00:00 2001 |
| 2 | +From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= < [email protected]> |
| 3 | +Date: Wed, 31 Jul 2024 23:53:31 +0200 |
| 4 | +Subject: [PATCH] add extra-experimental-features for nix-command |
| 5 | + |
| 6 | +fixes https://github.com/NixOS/nixpkgs/pull/331230 |
| 7 | +--- |
| 8 | + nix-serve.psgi | 6 +++--- |
| 9 | + 1 file changed, 3 insertions(+), 3 deletions(-) |
| 10 | + |
| 11 | +diff --git a/nix-serve.psgi b/nix-serve.psgi |
| 12 | +index 928fa3b..65a8680 100644 |
| 13 | +--- a/nix-serve.psgi |
| 14 | ++++ b/nix-serve.psgi |
| 15 | +@@ -64,7 +64,7 @@ my $app = sub { |
| 16 | + return [404, ['Content-Type' => 'text/plain'], ["Incorrect NAR hash. Maybe the path has been recreated.\n"]] |
| 17 | + unless $narHash eq "sha256:$expectedNarHash"; |
| 18 | + my $fh = new IO::Handle; |
| 19 | +- open $fh, "-|", "nix", "dump-path", "--", $storePath; |
| 20 | ++ open $fh, "-|", "nix", "--extra-experimental-features", "nix-command", "dump-path", "--", $storePath; |
| 21 | + return [200, ['Content-Type' => 'text/plain', 'Content-Length' => $narSize], $fh]; |
| 22 | + } |
| 23 | + |
| 24 | +@@ -75,14 +75,14 @@ my $app = sub { |
| 25 | + return [404, ['Content-Type' => 'text/plain'], ["No such path.\n"]] unless $storePath; |
| 26 | + my ($deriver, $narHash, $time, $narSize, $refs) = $store->queryPathInfo($storePath, 1) or die; |
| 27 | + my $fh = new IO::Handle; |
| 28 | +- open $fh, "-|", "nix", "dump-path", "--", $storePath; |
| 29 | ++ open $fh, "-|", "nix", "--extra-experimental-features", "nix-command", "dump-path", "--", $storePath; |
| 30 | + return [200, ['Content-Type' => 'text/plain', 'Content-Length' => $narSize], $fh]; |
| 31 | + } |
| 32 | + |
| 33 | + elsif ($path =~ /^\/log\/([0-9a-z]+-[0-9a-zA-Z\+\-\.\_\?\=]+)/) { |
| 34 | + my $storePath = "$Nix::Config::storeDir/$1"; |
| 35 | + my $fh = new IO::Handle; |
| 36 | +- open $fh, "-|", "nix", "log", $storePath; |
| 37 | ++ open $fh, "-|", "nix", "--extra-experimental-features", "nix-command", "log", $storePath; |
| 38 | + return [200, ['Content-Type' => 'text/plain' ], $fh]; |
| 39 | + } |
| 40 | + |
0 commit comments