2020-05-08 15:40:00 +02:00
|
|
|
{ substituteAll
|
|
|
|
, perl
|
|
|
|
, shadow
|
|
|
|
, util-linux
|
|
|
|
, configurationDirectory ? "/etc/nixos-containers"
|
|
|
|
, stateDirectory ? "/var/lib/nixos-containers"
|
2022-04-27 08:16:49 +02:00
|
|
|
, nixosTests
|
2020-05-08 15:40:00 +02:00
|
|
|
}:
|
2016-07-19 08:13:06 +02:00
|
|
|
|
|
|
|
substituteAll {
|
|
|
|
name = "nixos-container";
|
|
|
|
dir = "bin";
|
|
|
|
isExecutable = true;
|
|
|
|
src = ./nixos-container.pl;
|
2021-02-24 20:53:45 +01:00
|
|
|
perl = perl.withPackages (p: [ p.FileSlurp ]);
|
2017-03-21 16:45:47 +01:00
|
|
|
su = "${shadow.su}/bin/su";
|
2020-11-24 16:29:28 +01:00
|
|
|
utillinux = util-linux;
|
2016-07-19 08:13:06 +02:00
|
|
|
|
2020-05-08 15:40:00 +02:00
|
|
|
inherit configurationDirectory stateDirectory;
|
|
|
|
|
2022-04-27 08:16:49 +02:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
inherit (nixosTests)
|
|
|
|
containers-imperative
|
|
|
|
containers-ip
|
|
|
|
containers-tmpfs
|
|
|
|
containers-ephemeral
|
2022-10-29 22:22:57 +02:00
|
|
|
containers-unified-hierarchy
|
2022-04-27 08:16:49 +02:00
|
|
|
;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-07-19 08:13:06 +02:00
|
|
|
postInstall = ''
|
2020-11-12 22:22:18 +01:00
|
|
|
t=$out/share/bash-completion/completions
|
2016-07-19 08:13:06 +02:00
|
|
|
mkdir -p $t
|
|
|
|
cp ${./nixos-container-completion.sh} $t/nixos-container
|
|
|
|
'';
|
|
|
|
}
|