mirror of
https://github.com/mdlayher/homelab.git
synced 2024-12-14 11:47:32 +00:00
nixos/servnerr-3: remove container shutdown workaround
Signed-off-by: Matt Layher <mdlayher@gmail.com>
This commit is contained in:
parent
88f43573dc
commit
1a38bc0afa
1 changed files with 0 additions and 26 deletions
|
@ -51,30 +51,4 @@
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Workaround for NixOS containers not stopping at reboot, see:
|
||||
# https://github.com/NixOS/nixpkgs/issues/109695#issuecomment-774662261
|
||||
systemd.services."shutdown-containers" = {
|
||||
description = "Workaround for nixos-containers shutdown";
|
||||
enable = true;
|
||||
|
||||
unitConfig = {
|
||||
DefaultDependencies = false;
|
||||
RequiresMountFor = "/";
|
||||
};
|
||||
|
||||
before = [ "shutdown.target" "reboot.target" "halt.target" "final.target" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
RemainAfterExit = true;
|
||||
ExecStart = pkgs.writeScript "containers-shutdown" ''
|
||||
#! ${pkgs.runtimeShell} -e
|
||||
${pkgs.nixos-container}/bin/nixos-container list | while read container; do
|
||||
${pkgs.nixos-container}/bin/nixos-container stop $container
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue