nixos/containers: Ensure containers have cgroupsv2
This commit is contained in:
parent
c546331129
commit
b65f1f6df7
@ -182,8 +182,12 @@ in
|
|||||||
c.containerSystem;
|
c.containerSystem;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
|
environment = {
|
||||||
# systemd.nspawn units can't set the root directory directly, but /run/machines/${n} is one of the search paths
|
# systemd.nspawn units can't set the root directory directly, but /run/machines/${n} is one of the search paths
|
||||||
environment.root = "/run/machines/${n}";
|
root = "/run/machines/${n}";
|
||||||
|
# Without this, systemd-nspawn will do cgroupsv1
|
||||||
|
SYSTEMD_NSPAWN_UNIFIED_HIERARCHY = "1";
|
||||||
|
};
|
||||||
restartTriggers = [
|
restartTriggers = [
|
||||||
(''${n}.nspawn:${hashString "sha256" (toJSON config.systemd.nspawn."${n}")}'')
|
(''${n}.nspawn:${hashString "sha256" (toJSON config.systemd.nspawn."${n}")}'')
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user