diff --git a/lib/modules/software.nix b/lib/modules/software.nix index 6f65ae04..d51361e0 100644 --- a/lib/modules/software.nix +++ b/lib/modules/software.nix @@ -1,10 +1,33 @@ { lib, config, ... }: let - inherit (lib) mkOption types; + inherit (lib) mkDefault mkOption types; cfg = config.valhalla; + + mkUsersOption = osConfig: mkOption { + type = types.attrsOf (types.submodule ( + { ... }: { + config = { + programs = builtins.mapAttrs ( + name: config: { + enable = mkDefault config.enable; + }) osConfig.programs; + }; + })); + }; in { + imports = [ + ./programs/git.nix + ./programs/nextcloud.nix + ./programs/oh-my-posh.nix + ./programs/rclone.nix + ]; + options = { valhalla = { + users = mkUsersOption cfg; + linux.users = mkUsersOption cfg.linux; + windows.users = mkUsersOption cfg.windows; + software = let inherit (cfg.software) coding common desktopExperience school server; in { diff --git a/lib/modules/valhalla.nix b/lib/modules/valhalla.nix index 130f5462..25fa9008 100644 --- a/lib/modules/valhalla.nix +++ b/lib/modules/valhalla.nix @@ -5,10 +5,6 @@ in { ./hardware.nix ./i18n.nix ./os.nix - ./programs/git.nix - ./programs/nextcloud.nix - ./programs/oh-my-posh.nix - ./programs/rclone.nix ./partition.nix ./software.nix ./users.nix