hosts/ni/setups/desktop: automatically set networking setup

This commit is contained in:
Gabriel Arazas 2023-12-16 19:58:17 +08:00
parent 9cd586231e
commit 3d4b8fa578
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 33 additions and 28 deletions

View File

@ -29,7 +29,6 @@
hardware.qol.enable = true;
networking = {
enable = true;
setup = "networkmanager";
wireguard.enable = true;
};
services.backup.enable = true;

View File

@ -3,12 +3,16 @@
let
hostCfg = config.hosts.ni;
cfg = hostCfg.setups.desktop;
hasAnyWorkflowEnabled = workflows:
lib.lists.any (workflow: config.workflows.workflows.${workflow}.enable) workflows;
in
{
options.hosts.ni.setups.desktop.enable =
lib.mkEnableOption "desktop environment setup";
config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable (lib.mkMerge [
{
# Bring all of the desktop goodies.
profiles.desktop = {
enable = true;
@ -29,14 +33,16 @@ in
];
};
# Make it in multiple languages. Take note this is meant to be set up by
# the workflow module of choice...
# Make it in multiple languages. Take note the input method engine is set
# up by the workflow module of choice...
profiles.i18n.enable = true;
# ...which is by the way is this one.
workflows.workflows.a-happy-gnome.enable = true;
}
# Backup for the almighty archive, pls.
tasks.backup-archive.enable = true;
};
(lib.mkIf (hasAnyWorkflowEnabled [ "a-happy-gnome" "knome" "mosey-branch" ]) {
hosts.ni.networking.setup = "networkmanager";
})
]);
}