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

46 lines
923 B
Nix
Raw Normal View History

2018-08-08 23:40:01 +02:00
{ stdenv, lib, coreutils, findutils, gnugrep, darwin
# Avoid having GHC in the build-time closure of all NixOS configurations
, doCheck ? false, shellcheck
}:
2017-10-13 22:35:58 +02:00
stdenv.mkDerivation {
name = "nix-info";
src = ./info.sh;
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
'';
inherit doCheck;
2018-08-08 23:40:01 +02:00
checkInputs = [ shellcheck ];
2017-10-13 22:35:58 +02:00
checkPhase = ''
shellcheck ./nix-info
'';
installPhase = ''
mkdir -p $out/bin
cp ./nix-info $out/bin/nix-info
'';
2018-01-21 14:09:35 +01:00
preferLocalBuild = true;
meta = {
platforms = lib.platforms.all;
};
2017-10-13 22:35:58 +02:00
}