3
0
Fork 0
forked from mirrors/nixpkgs

nixos-containers: init package (#16959)

This moves nixos-containers into its own package so that it can be
relied upon by other packages/systems. This should make development
using dynamic containers much easier.
This commit is contained in:
Eric Merritt 2016-07-18 23:13:06 -07:00 committed by Franz Pletz
parent e2199205c7
commit eb92804f91
5 changed files with 21 additions and 18 deletions

View file

@ -4,22 +4,6 @@ with lib;
let
nixos-container = pkgs.substituteAll {
name = "nixos-container";
dir = "bin";
isExecutable = true;
src = ./nixos-container.pl;
perl = "${pkgs.perl}/bin/perl -I${pkgs.perlPackages.FileSlurp}/lib/perl5/site_perl";
su = "${pkgs.shadow.su}/bin/su";
inherit (pkgs) utillinux;
postInstall = ''
t=$out/etc/bash_completion.d
mkdir -p $t
cp ${./nixos-container-completion.sh} $t/nixos-container
'';
};
# The container's init script, a small wrapper around the regular
# NixOS stage-2 init script.
containerInit = pkgs.writeScript "container-init"
@ -410,7 +394,7 @@ in
ExecReload = pkgs.writeScript "reload-container"
''
#! ${pkgs.stdenv.shell} -e
${nixos-container}/bin/nixos-container run "$INSTANCE" -- \
${pkgs.nixos-container}/bin/nixos-container run "$INSTANCE" -- \
bash --login -c "''${SYSTEM_PATH:-/nix/var/nix/profiles/system}/bin/switch-to-configuration test"
'';
@ -498,6 +482,6 @@ in
networking.dhcpcd.denyInterfaces = [ "ve-*" ];
environment.systemPackages = [ nixos-container ];
environment.systemPackages = [ pkgs.nixos-container ];
});
}

View file

@ -0,0 +1,17 @@
{ substituteAll, perl, perlPackages, shadow, utillinux }:
substituteAll {
name = "nixos-container";
dir = "bin";
isExecutable = true;
src = ./nixos-container.pl;
perl = "${perl}/bin/perl -I${perlPackages.FileSlurp}/lib/perl5/site_perl";
su = "${shadow.su}/bin/su";
inherit utillinux;
postInstall = ''
t=$out/etc/bash_completion.d
mkdir -p $t
cp ${./nixos-container-completion.sh} $t/nixos-container
'';
}

View file

@ -16979,6 +16979,8 @@ in
nixos-artwork = callPackage ../data/misc/nixos-artwork { };
nixos-container = callPackage ../tools/virtualization/nixos-container { };
norwester-font = callPackage ../data/fonts/norwester {};
nut = callPackage ../applications/misc/nut { };