1
0
Fork 0
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:
Matt Layher 2021-02-16 14:24:20 -05:00
parent 88f43573dc
commit 1a38bc0afa
No known key found for this signature in database
GPG key ID: 77BFE531397EDE94

View file

@ -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
'';
};
};
}