mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-30 09:31:01 +00:00
e866bb421a
ShellCheck depends on GHC which is quite a large package to have in the build-time closure of all NixOS systems.
45 lines
929 B
Nix
45 lines
929 B
Nix
{ stdenv, lib, coreutils, findutils, gnugrep, darwin, shellcheck
|
|
, doCheck ? false # Avoid having GHC in the build-time closure of all NixOS configuratinos
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
name = "nix-info";
|
|
src = ./info.sh;
|
|
|
|
nativeBuildInputs = lib.optionals doCheck [
|
|
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
|
|
'';
|
|
|
|
inherit doCheck;
|
|
checkPhase = ''
|
|
shellcheck ./nix-info
|
|
'';
|
|
|
|
installPhase = ''
|
|
mkdir -p $out/bin
|
|
cp ./nix-info $out/bin/nix-info
|
|
'';
|
|
|
|
meta = {
|
|
platforms = lib.platforms.all;
|
|
};
|
|
}
|