depot/third_party/nixpkgs/pkgs/tools/nix/info/default.nix
Default email dae973cb59 Project import generated by Copybara.
GitOrigin-RevId: c90c4025bb6e0c4eaf438128a3b2640314b1c58d
2023-03-08 18:32:21 +02:00

47 lines
980 B
Nix

{ stdenv, lib, coreutils, findutils, gnugrep, darwin, bash
# Avoid having GHC in the build-time closure of all NixOS configurations
, doCheck ? false, shellcheck
}:
stdenv.mkDerivation {
name = "nix-info";
src = ./info.sh;
path = lib.makeBinPath ([
coreutils findutils gnugrep
] ++ (lib.optionals stdenv.isDarwin [ darwin.DarwinTools ]));
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 ];
checkPhase = ''
shellcheck ./nix-info
'';
installPhase = ''
mkdir -p $out/bin
cp ./nix-info $out/bin/nix-info
'';
preferLocalBuild = true;
meta = {
platforms = lib.platforms.all;
};
}