flake-parts/setups: add specialArgs option for home-manager and NixVim configs

This commit is contained in:
Gabriel Arazas 2025-01-22 13:35:51 +08:00
parent 6cd3e355fa
commit 788880c1e6
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 20 additions and 0 deletions

View File

@ -120,6 +120,7 @@ let
];
nixpkgs.config = cfg.sharedNixpkgsConfig;
specialArgs = cfg.sharedSpecialArgs;
};
};
in
@ -132,6 +133,13 @@ in
'';
};
sharedSpecialArgs = options.setups.sharedSpecialArgs // {
description = ''
Shared set of module arguments as part of `_module.specialArgs` of the
configuration.
'';
};
sharedModules = lib.mkOption {
type = with lib.types; listOf deferredModule;
default = [ ];
@ -165,6 +173,7 @@ in
(import ./shared/nix-conf.nix { inherit inputs; })
(import ./shared/config-options.nix { inherit (config) systems; })
./shared/nixpkgs-options.nix
./shared/special-args-options.nix
configType
]);
default = { };

View File

@ -108,6 +108,8 @@ let
modules = [
"${partsConfig.setups.configDir}/nixvim/${config.configName}"
];
specialArgs = cfg.sharedSpecialArgs;
};
};
@ -169,6 +171,7 @@ in
configs = lib.mkOption {
type = with lib.types; attrsOf (submodule [
(import ./shared/config-options.nix { inherit (config) systems; })
./shared/special-args-options.nix
configType
]);
default = { };
@ -186,6 +189,14 @@ in
environments when NixVim-specific integrations has been enabled.
'';
};
sharedSpecialArgs = options.setups.sharedSpecialArgs // {
description = ''
Shared set of module arguments as part of `_module.specialArgs` of the
configuration.
'';
};
standaloneConfigModules = modulesOption' "standalone configuration";
sharedNixpkgsConfig = options.setups.sharedNixpkgsConfig // {