depot/third_party/nixpkgs/pkgs/tools/virtualization/nixos-container/default.nix
Default email 01ed8ef136 Project import generated by Copybara.
GitOrigin-RevId: 20fc948445a6c22d4e8d5178e9a6bc6e1f5417c8
2022-11-21 19:40:18 +02:00

38 lines
847 B
Nix

{ substituteAll
, perl
, shadow
, util-linux
, configurationDirectory ? "/etc/nixos-containers"
, stateDirectory ? "/var/lib/nixos-containers"
, nixosTests
}:
substituteAll {
name = "nixos-container";
dir = "bin";
isExecutable = true;
src = ./nixos-container.pl;
perl = perl.withPackages (p: [ p.FileSlurp ]);
su = "${shadow.su}/bin/su";
utillinux = util-linux;
inherit configurationDirectory stateDirectory;
passthru = {
tests = {
inherit (nixosTests)
containers-imperative
containers-ip
containers-tmpfs
containers-ephemeral
containers-unified-hierarchy
;
};
};
postInstall = ''
t=$out/share/bash-completion/completions
mkdir -p $t
cp ${./nixos-container-completion.sh} $t/nixos-container
'';
}