Archived
1
0
forked from rarias/bscpkgs
This repository has been archived on 2025-10-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bscpkgs/bsc/garlic/nix-setup.nix
2020-09-02 17:07:09 +02:00

29 lines
438 B
Nix

{
stdenv
}:
{
program
}:
stdenv.mkDerivation {
name = "nixsetup";
preferLocalBuild = true;
phases = [ "installPhase" ];
dontPatchShebangs = true;
installPhase = ''
cat > $out <<EOF
#!/bin/sh
# We need to enter the nix namespace first, in order to have /nix
# available, so we use this hack:
if [ ! -e /nix ]; then
exec nix-setup \$0
fi
exec ${program}
EOF
chmod +x $out
'';
}