diff options
| author | seth <[email protected]> | 2024-02-03 19:53:32 -0500 |
|---|---|---|
| committer | seth <[email protected]> | 2024-02-03 20:47:55 -0500 |
| commit | 1ac587856745cddb0f9be4441da57568bb8825b8 (patch) | |
| tree | 30642cbe409c7bc451b099a0cd9a3049b9d1ce29 /modules/flake | |
| parent | af233733f2c7b0b4422cd5c480caeeb1743c017b (diff) | |
flakeModules/configurations: add global modules
Diffstat (limited to 'modules/flake')
| -rw-r--r-- | modules/flake/configurations.nix | 43 |
1 files changed, 33 insertions, 10 deletions
diff --git a/modules/flake/configurations.nix b/modules/flake/configurations.nix index 314e85f..04bcf5a 100644 --- a/modules/flake/configurations.nix +++ b/modules/flake/configurations.nix @@ -39,16 +39,20 @@ mkSystem = type: name: let args = cfg.${type}.systems.${name}; in - args.builder ( - (removeAttrs args ["builder"]) - // { - modules = args.modules ++ [../../systems/${name} {networking.hostName = name;}]; - specialArgs = { - inherit inputs; - secretsDir = ../../secrets/${name}; - }; - } - ); + args.builder (lib.recursiveUpdate (removeAttrs args ["builder"]) { + modules = + [ + ../../systems/${name} + {networking.hostName = name;} + ] + ++ cfg.${type}.modules + ++ args.modules; + + specialArgs = { + inherit inputs; + secretsDir = ../../secrets/${name}; + }; + }); mkUser = name: let args = cfg.home.users.${name}; @@ -65,6 +69,7 @@ programs.home-manager.enable = true; } ] + ++ cfg.home.modules ++ args.modules; extraSpecialArgs = {inherit inputs;}; @@ -144,6 +149,15 @@ ''; }; + modules = mkOption { + type = modulesType; + default = []; + example = literalExpression "[ self.${type}Modules.default ]"; + description = mdDoc '' + List of modules to add to all ${type}Configurations + ''; + }; + systems = mkOption { type = types.attrsOf (types.submodule (systemsSubmodule type)); default = {}; @@ -172,6 +186,15 @@ in { ''; }; + modules = mkOption { + type = modulesType; + default = []; + example = literalExpression "[ self.homeModules.default ]"; + description = mdDoc '' + List of modules to add to all homeConfigurations + ''; + }; + pkgs = mkOption { type = pkgsType; example = literalExpression "inputs.nixpkgs.legacyPackages.aarch64-linux"; |
