diff --git a/modules/options/default.nix b/modules/options/default.nix index 816a12e..c532f81 100644 --- a/modules/options/default.nix +++ b/modules/options/default.nix @@ -1,5 +1,7 @@ { imports = [ + ./profiles + ./homeVars.nix ./style.nix ./systemVars.nix diff --git a/modules/options/profiles/default.nix b/modules/options/profiles/default.nix new file mode 100644 index 0000000..40469cf --- /dev/null +++ b/modules/options/profiles/default.nix @@ -0,0 +1,7 @@ +{ + imports = [ + ./desktop.nix + ./gaming.nix + ./server.nix + ]; +} diff --git a/modules/options/profiles/desktop.nix b/modules/options/profiles/desktop.nix new file mode 100644 index 0000000..62e8742 --- /dev/null +++ b/modules/options/profiles/desktop.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.desktop.enable = mkEnableOption "the desktop profile"; + }; + + config.assertions = [ + { + assertion = !config.local.profiles.server.enable; + message = "The desktop profile cannot be enabled if `local.profiles.server.enable` is set to true."; + } + ]; +} diff --git a/modules/options/profiles/gaming.nix b/modules/options/profiles/gaming.nix new file mode 100644 index 0000000..9e4d1c9 --- /dev/null +++ b/modules/options/profiles/gaming.nix @@ -0,0 +1,18 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.gaming.enable = mkEnableOption "the gaming profile"; + }; + + config.assertions = [ + { + assertion = !config.local.profiles.server.enable; + message = "The gaming profile cannot be enabled if `local.profiles.server.enable` is set to true."; + } + ]; +} diff --git a/modules/options/profiles/server.nix b/modules/options/profiles/server.nix new file mode 100644 index 0000000..46c4ea2 --- /dev/null +++ b/modules/options/profiles/server.nix @@ -0,0 +1,23 @@ +{ + lib, + config, + ... +}: let + inherit (lib) mkEnableOption; +in { + options = { + local.profiles.server.enable = mkEnableOption "the server profile"; + }; + + config.assertions = [ + { + assertion = !config.local.profiles.desktop.enable; + message = "The server profile cannot be enabled if `local.profiles.desktop.enable` is set to true."; + } + + { + assertion = !config.local.profiles.gaming.enable; + message = "The server profile cannot be enabled if `local.profiles.gaming.enable` is set to true."; + } + ]; +}