New stage design

This commit is contained in:
2020-09-02 17:07:09 +02:00
parent d469ccd59d
commit 8110bc2976
12 changed files with 221 additions and 150 deletions

View File

@@ -2,17 +2,17 @@
stdenv
}:
program:
{
program
}:
stdenv.mkDerivation {
inherit program;
name = "${program.name}-nixsetup";
name = "nixsetup";
preferLocalBuild = true;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
mkdir -p $out/bin
cat > $out/bin/run <<EOF
cat > $out <<EOF
#!/bin/sh
# We need to enter the nix namespace first, in order to have /nix
@@ -21,8 +21,8 @@ stdenv.mkDerivation {
exec nix-setup \$0
fi
exec $program/bin/run
exec ${program}
EOF
chmod +x $out/bin/run
chmod +x $out
'';
}