Skip to content

Commit eb678b4

Browse files
authored
nix-serve: unstable-2018-03-20 → unstable-2024-09-17 (#342714)
2 parents d12ed10 + 13f5638 commit eb678b4

File tree

3 files changed

+52
-5
lines changed

3 files changed

+52
-5
lines changed

pkgs/tools/package-management/nix-serve/default.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
, perl
77
, makeWrapper
88
, nixosTests
9+
, fetchpatch
910
}:
1011

1112
let
12-
rev = "e4675e38ab54942e351c7686e40fabec822120b9";
13-
sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr";
13+
rev = "77ffa33d83d2c7c6551c5e420e938e92d72fec24";
14+
sha256 = "sha256-MJRdVO2pt7wjOu5Hk0eVeNbk5bK5+Uo/Gh9XfO4OlMY=";
1415
in
1516

1617
stdenv.mkDerivation {
@@ -23,6 +24,14 @@ stdenv.mkDerivation {
2324
inherit rev sha256;
2425
};
2526

27+
patches = [
28+
# Part of https://github.com/edolstra/nix-serve/pull/61
29+
(fetchpatch {
30+
url = "https://github.com/edolstra/nix-serve/commit/9e434fff4486afeb3cc3f631f6dc56492b204704.patch";
31+
sha256 = "sha256-TxQ6q6UApTKsYIMdr/RyrkKSA3k47stV63bTbxchNTU=";
32+
})
33+
];
34+
2635
nativeBuildInputs = [ makeWrapper ];
2736

2837
dontBuild = true;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

pkgs/top-level/all-packages.nix

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38002,9 +38002,7 @@ with pkgs;
3800238002

3800338003
nixpkgs-review = callPackage ../tools/package-management/nixpkgs-review { };
3800438004

38005-
nix-serve = callPackage ../tools/package-management/nix-serve {
38006-
nix = nixVersions.nix_2_18;
38007-
};
38005+
nix-serve = callPackage ../tools/package-management/nix-serve { };
3800838006

3800938007
nix-serve-ng = haskell.lib.compose.justStaticExecutables haskellPackages.nix-serve-ng;
3801038008

0 commit comments

Comments
 (0)