From dcb1f57c5907e145b73fa779ee733452135e39df Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 14 Jul 2024 23:07:02 +0200 Subject: [PATCH] Add settings for conditionally installing programs --- lib/modules/valhalla.nix | 60 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index fd318baf..6d930897 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -1,9 +1,11 @@ -{ lib, ... }: +{ lib, config, ... }: let inherit (lib) mkOption types ; + + cfg = config.valhalla; in { imports = [ ./i18n.nix @@ -43,6 +45,62 @@ 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; + }; + }; }; }; }