nixpkgs/pkgs/tools/nix/info/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

48 lines
980 B
Nix
Raw Normal View History

{ stdenv, lib, coreutils, findutils, gnugrep, darwin, bash
2018-08-08 21:40:01 +00:00
# Avoid having GHC in the build-time closure of all NixOS configurations
, doCheck ? false, shellcheck
}:
2017-10-13 20:35:58 +00:00
stdenv.mkDerivation {
name = "nix-info";
src = ./info.sh;
path = lib.makeBinPath ([
coreutils findutils gnugrep
2023-02-14 18:11:59 +00:00
] ++ (lib.optionals stdenv.isDarwin [ darwin.DarwinTools ]));
2017-10-13 20:35:58 +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;
strictDeps = true;
nativeCheckInputs = [ shellcheck ];
buildInputs = [ bash ];
2018-08-08 21:40:01 +00:00
2017-10-13 20:35:58 +00:00
checkPhase = ''
shellcheck ./nix-info
'';
installPhase = ''
mkdir -p $out/bin
cp ./nix-info $out/bin/nix-info
'';
2018-01-21 13:09:35 +00:00
preferLocalBuild = true;
meta = {
platforms = lib.platforms.all;
};
2017-10-13 20:35:58 +00:00
}