diff --git a/lib/modules/software.nix b/lib/modules/software.nix new file mode 100644 index 00000000..05bd7aa1 --- /dev/null +++ b/lib/modules/software.nix @@ -0,0 +1,69 @@ +{ lib, config, ... }: + let + inherit (lib) + mkOption + types + ; + + cfg = config.valhalla; + in { + options = { + valhalla = { + software = + let + inherit (cfg.software) + common + school + ; + in { + essential = mkOption { + type = types.bool; + description = "A value indicating whether essentials should be installed."; + default = true; + }; + + common = mkOption { + type = types.bool; + description = "A value indicating whether common software should be installed."; + default = true; + }; + + school = mkOption { + type = types.bool; + description = "A value indicating whether software for studies should be installed."; + default = false; + }; + + productivity = mkOption { + type = types.bool; + description = "A value indicating whether productivity apps should be installed."; + default = common || school; + }; + + socialMedia = mkOption { + type = types.bool; + description = "A value indicating whether social media apps should be installed."; + default = common; + }; + + media = mkOption { + type = types.bool; + description = "A value indicating whether media apps should be installed."; + default = common; + }; + + gaming = mkOption { + type = types.bool; + description = "A value indicating whether gaming apps should be installed."; + default = common; + }; + + coding = mkOption { + type = types.bool; + description = "A value indicating whether development apps should be installed."; + default = common; + }; + }; + }; + }; + } diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index f0f25979..7701bab5 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -1,16 +1,15 @@ -{ lib, config, ... }: +{ lib, ... }: let inherit (lib) mkOption types ; - - cfg = config.valhalla; in { imports = [ ./git.nix ./i18n.nix ./partition.nix + ./software.nix ]; options = { @@ -46,62 +45,6 @@ description = "The X11 keyboard layout of the system."; default = null; }; - - software = - let - inherit (cfg.software) - common - school - ; - in { - essential = mkOption { - type = types.bool; - description = "A value indicating whether essentials should be installed."; - default = true; - }; - - common = mkOption { - type = types.bool; - description = "A value indicating whether common software should be installed."; - default = true; - }; - - school = mkOption { - type = types.bool; - description = "A value indicating whether software for studies should be installed."; - default = false; - }; - - productivity = mkOption { - type = types.bool; - description = "A value indicating whether productivity apps should be installed."; - default = common || school; - }; - - socialMedia = mkOption { - type = types.bool; - description = "A value indicating whether social media apps should be installed."; - default = common; - }; - - media = mkOption { - type = types.bool; - description = "A value indicating whether media apps should be installed."; - default = common; - }; - - gaming = mkOption { - type = types.bool; - description = "A value indicating whether gaming apps should be installed."; - default = common; - }; - - coding = mkOption { - type = types.bool; - description = "A value indicating whether development apps should be installed."; - default = common; - }; - }; }; }; }