2023-03-08 16:32:21 +00:00
|
|
|
{ stdenv, lib, coreutils, findutils, gnugrep, darwin, bash
|
2020-04-24 23:36:52 +00:00
|
|
|
# Avoid having GHC in the build-time closure of all NixOS configurations
|
|
|
|
, doCheck ? false, shellcheck
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "nix-info";
|
|
|
|
src = ./info.sh;
|
|
|
|
|
|
|
|
path = lib.makeBinPath ([
|
|
|
|
coreutils findutils gnugrep
|
2023-02-16 17:41:37 +00:00
|
|
|
] ++ (lib.optionals stdenv.isDarwin [ darwin.DarwinTools ]));
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
|
|
|
inherit doCheck;
|
2023-03-08 16:32:21 +00:00
|
|
|
strictDeps = true;
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ shellcheck ];
|
2023-03-08 16:32:21 +00:00
|
|
|
buildInputs = [ bash ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
shellcheck ./nix-info
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ./nix-info $out/bin/nix-info
|
|
|
|
'';
|
|
|
|
|
|
|
|
preferLocalBuild = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
platforms = lib.platforms.all;
|
|
|
|
};
|
|
|
|
}
|