forked from zentralwerk/network
nixos-module/server/lxc-containers: undo making container startup conditional
This commit is contained in:
parent
5ed1091b74
commit
9d99508ae7
|
@ -138,15 +138,6 @@ let
|
||||||
set -e
|
set -e
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enable-script = pkgs.writeScriptBin "enable-containers" ''
|
|
||||||
touch /etc/start-containers
|
|
||||||
systemctl start lxc-containers.target
|
|
||||||
'';
|
|
||||||
|
|
||||||
disable-script = pkgs.writeScriptBin "disable-containers" ''
|
|
||||||
rm /etc/start-containers
|
|
||||||
systemctl stop lxc-containers.target lxc@\*.service
|
|
||||||
'';
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
boot.kernel.sysctl = lib.mkIf enabled {
|
boot.kernel.sysctl = lib.mkIf enabled {
|
||||||
|
@ -173,7 +164,6 @@ in
|
||||||
# `lxc-attach` et al
|
# `lxc-attach` et al
|
||||||
pkgs.lxc build-script
|
pkgs.lxc build-script
|
||||||
# User scripts
|
# User scripts
|
||||||
enable-script disable-script
|
|
||||||
];
|
];
|
||||||
|
|
||||||
# Create lxc.container.conf files
|
# Create lxc.container.conf files
|
||||||
|
@ -227,7 +217,6 @@ in
|
||||||
after = [ "network.target" ];
|
after = [ "network.target" ];
|
||||||
unitConfig.ConditionPathExists = [
|
unitConfig.ConditionPathExists = [
|
||||||
"/var/lib/lxc/%i/rootfs/init"
|
"/var/lib/lxc/%i/rootfs/init"
|
||||||
"/etc/start-containers"
|
|
||||||
];
|
];
|
||||||
serviceConfig = with pkgs; {
|
serviceConfig = with pkgs; {
|
||||||
Type = "simple";
|
Type = "simple";
|
||||||
|
|
Loading…
Reference in New Issue