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

38 lines
756 B
Nix
Raw Normal View History

2017-10-13 21:35:58 +01:00
{ stdenv, lib, coreutils, findutils, gnugrep, darwin, shellcheck }:
stdenv.mkDerivation {
name = "nix-info";
src = ./info.sh;
buildInputs = [
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
'';
doCheck = true;
checkPhase = ''
shellcheck ./nix-info
'';
installPhase = ''
mkdir -p $out/bin
cp ./nix-info $out/bin/nix-info
'';
}