containers: Fix warning when containers are disabled

Now it's possible to disable the containers without getting a warning
that containers.<name> is being defined.
This commit is contained in:
Donovan Glover 2024-04-06 08:08:06 -04:00
parent 8ba4792d03
commit 3080c56023
No known key found for this signature in database
GPG Key ID: EA7408A77AE1BE65

View File

@ -1,7 +1,9 @@
{ config, nix-config, sakaya, ... }: { config, nix-config, sakaya, lib, ... }:
let let
inherit (lib) mkIf;
inherit (config.modules.system) username; inherit (config.modules.system) username;
inherit (config.boot) enableContainers;
template = { template = {
privateNetwork = true; privateNetwork = true;
@ -48,7 +50,8 @@ in
"d /run/user/1000 0700 ${username} users -" "d /run/user/1000 0700 ${username} users -"
]; ];
containers.wine = template // { containers = mkIf enableContainers {
wine = template // {
hostAddress = "192.168.100.34"; hostAddress = "192.168.100.34";
localAddress = "192.168.100.49"; localAddress = "192.168.100.49";
@ -113,4 +116,5 @@ in
}; };
}; };
}; };
};
} }