nix-serve: set PATH

joachifm: also set `dontBuild = true`; `false` doesn't make any sense if
the intent is to skip the build phase.

Closes #16221
This commit is contained in:
Allen Nelson 2016-06-13 20:26:36 +00:00 committed by Joachim Fasting
parent c7016de72c
commit d20a8ddea8
No known key found for this signature in database
GPG Key ID: 4330820E1E04DCF4

View File

@ -1,23 +1,28 @@
{ lib, stdenv, fetchFromGitHub, perl, nix, perlPackages }:
{ stdenv, fetchFromGitHub,
bzip2, nix, perl, perlPackages,
}:
let rev = "7e09caa2a7a435aeb2cd5446aa590d6f9ae1699d"; in
with stdenv.lib;
let
rev = "7e09caa2a7a435aeb2cd5446aa590d6f9ae1699d";
sha256 = "0mjzsiknln3isdri9004wwjjjpak5fj8ncizyncf5jv7g4m4q1pj";
in
stdenv.mkDerivation rec {
name = "nix-serve-0.2-${lib.substring 0 7 rev}";
name = "nix-serve-0.2-${substring 0 7 rev}";
src = fetchFromGitHub {
owner = "edolstra";
repo = "nix-serve";
inherit rev;
sha256 = "0mjzsiknln3isdri9004wwjjjpak5fj8ncizyncf5jv7g4m4q1pj";
inherit rev sha256;
};
buildInputs = [ perl nix ]
buildInputs = [ bzip2 perl nix ]
++ (with perlPackages; [ DBI DBDSQLite Plack Starman ]);
dontBuild = false;
dontBuild = true;
# FIXME: unfortunate cut&paste.
installPhase = ''
mkdir -p $out/libexec/nix-serve
cp nix-serve.psgi $out/libexec/nix-serve/nix-serve.psgi
@ -25,7 +30,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/bin
cat > $out/bin/nix-serve <<EOF
#! ${stdenv.shell}
PERL5LIB=$PERL5LIB exec ${perlPackages.Starman}/bin/starman $out/libexec/nix-serve/nix-serve.psgi "\$@"
PATH=${makeBinPath [ bzip2 nix ]}:\$PATH PERL5LIB=$PERL5LIB exec ${perlPackages.Starman}/bin/starman $out/libexec/nix-serve/nix-serve.psgi "\$@"
EOF
chmod +x $out/bin/nix-serve
'';