nixos/containers: warn if containers are used but disabled
This is a follow-up to 8dfe8e447e.
This commit is contained in:
@@ -771,8 +771,13 @@ in
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
config = mkIf (config.boot.enableContainers) (let
|
config = mkMerge [
|
||||||
|
{
|
||||||
|
warnings = optional (!config.boot.enableContainers && config.containers != {})
|
||||||
|
"containers.<name> is used, but boot.enableContainers is false. To use containers.<name>, set boot.enableContainers to true.";
|
||||||
|
}
|
||||||
|
|
||||||
|
(mkIf (config.boot.enableContainers) (let
|
||||||
unit = {
|
unit = {
|
||||||
description = "Container '%i'";
|
description = "Container '%i'";
|
||||||
|
|
||||||
@@ -905,7 +910,8 @@ in
|
|||||||
"tap"
|
"tap"
|
||||||
"tun"
|
"tun"
|
||||||
];
|
];
|
||||||
});
|
}))
|
||||||
|
];
|
||||||
|
|
||||||
meta.buildDocsInSandbox = false;
|
meta.buildDocsInSandbox = false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user