2017-10-17 14:42:46 +01:00
|
|
|
{ stdenv, lib, coreutils, findutils, gnugrep, darwin, shellcheck
|
|
|
|
, doCheck ? false # Avoid having GHC in the build-time closure of all NixOS configuratinos
|
|
|
|
}:
|
|
|
|
|
2017-10-13 21:35:58 +01:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "nix-info";
|
|
|
|
src = ./info.sh;
|
|
|
|
|
2017-10-17 14:42:46 +01:00
|
|
|
nativeBuildInputs = lib.optionals doCheck [
|
2017-10-13 21:35:58 +01:00
|
|
|
shellcheck
|
|
|
|
];
|
|
|
|
|
|
|
|
path = lib.makeBinPath ([
|
|
|
|
coreutils findutils gnugrep
|
|
|
|
] ++ (if stdenv.isDarwin then [ darwin.DarwinTools ] else []));
|
|
|
|
is_darwin = if stdenv.isDarwin then "yes" else "no";
|
|
|
|
|
|
|
|
sandboxtest = ./sandbox.nix;
|
|
|
|
relaxedsandboxtest = ./relaxedsandbox.nix;
|
|
|
|
multiusertest = ./multiuser.nix;
|
|
|
|
|
|
|
|
unpackCmd = ''
|
|
|
|
mkdir nix-info
|
|
|
|
cp $src ./nix-info/nix-info
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
substituteAllInPlace ./nix-info
|
|
|
|
'';
|
|
|
|
|
2017-10-17 14:42:46 +01:00
|
|
|
inherit doCheck;
|
2017-10-13 21:35:58 +01:00
|
|
|
checkPhase = ''
|
|
|
|
shellcheck ./nix-info
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ./nix-info $out/bin/nix-info
|
|
|
|
'';
|
2017-10-17 08:57:19 +01:00
|
|
|
|
2018-01-21 13:09:35 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
|
2017-10-17 08:57:19 +01:00
|
|
|
meta = {
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
2017-10-13 21:35:58 +01:00
|
|
|
}
|