Skip to content

Commit

Permalink
nix-serve: 0.2-e4675e3 -> unstable-2024-04-08
Browse files Browse the repository at this point in the history
The current version in nixpkgs is from 2018, and there's been a lot of
fixes and features since then.

Passthru tests failed, as nix-serve seems to be shelling out to a
`nix-command` which needs an explicitly enabled since some Nix versions:

```
machine # [    5.920336] nix-serve-start[840]: error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override
```

Rather than patching this, I fixed it by giving nix-serve a Nix binary
in $PATH that doesn't require that - while keeping the nix.perlBindings.

The passthru tests now succeed.
  • Loading branch information
flokli committed Jul 31, 2024
1 parent 884687b commit 06880ef
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions pkgs/tools/package-management/nix-serve/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,21 @@
, fetchFromGitHub
, bzip2
, nix
, nixVersions
, perl
, makeWrapper
, nixosTests
}:

let
rev = "e4675e38ab54942e351c7686e40fabec822120b9";
sha256 = "1wm24p6pkxl1d7hrvf4ph6mwzawvqi22c60z9xzndn5xfyr4v0yr";
in

stdenv.mkDerivation {
pname = "nix-serve";
version = "0.2-${lib.substring 0 7 rev}";
version = "0.2.0-unstable-2024-04-08";

src = fetchFromGitHub {
owner = "edolstra";
repo = "nix-serve";
inherit rev sha256;
rev = "4a12660e6fa8fce662c0a652280a3309fa822465";
hash = "sha256-N7MK+m7hP34ALPy2tKgfPmz+uj/pkbh1Wq771BMHAfI=";
};

nativeBuildInputs = [ makeWrapper ];
Expand All @@ -31,8 +28,8 @@ stdenv.mkDerivation {
install -Dm0755 nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi
makeWrapper ${perl.withPackages(p: [ p.DBDSQLite p.Plack p.Starman nix.perl-bindings ])}/bin/starman $out/bin/nix-serve \
--prefix PATH : "${lib.makeBinPath [ bzip2 nix ]}" \
--add-flags $out/libexec/nix-serve/nix-serve.psgi
--prefix PATH : "${lib.makeBinPath [ bzip2 nixVersions.nix_2_3 ]}" \
--add-flags $out/libexec/nix-serve/nix-serve.psgi
'';

passthru.tests = {
Expand Down

0 comments on commit 06880ef

Please sign in to comment.