nixpkgs/pkgs/tools/nix/info/default.nix
Graham Christensen d9d2c4a4a9
nix-info: init
2017-10-14 22:01:23 -04:00

38 lines
756 B
Nix

{ 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
'';
}