flake-parts/setups: add firstSetupArgs option for generic config environment

This commit is contained in:
Gabriel Arazas 2025-02-01 22:14:35 +08:00
parent fd5f894934
commit e167545d09
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 29 additions and 9 deletions

View File

@ -31,19 +31,14 @@
};
homeManagerBranch = "home-manager-unstable";
systems = [ "aarch64-linux" "x86_64-linux" ];
firstSetupArgs = {
baseNixvimModules = config.setups.nixvim.configs.fiesta.modules
++ config.setups.nixvim.sharedModules;
};
modules = [
inputs.nur.modules.homeManager.default
inputs.sops-nix.homeManagerModules.sops
inputs.wrapper-manager-fds.homeModules.wrapper-manager
{
_module.args = {
firstSetupArgs = {
baseNixvimModules = config.setups.nixvim.configs.fiesta.modules
++ config.setups.nixvim.sharedModules;
};
};
}
];
nixvim = {
instance = "fiesta";

View File

@ -30,5 +30,30 @@
of the same declarative environment.
'';
};
firstSetupArgs = lib.mkOption {
type = with lib.types; attrsOf anything;
default = {};
example = lib.literalExpression ''
{
baseSpecificConfigModules = [
./whatwhatwut/base.nix
];
}
'';
description = ''
A set of module arguments intended to be set as part of the module
argument namespace `firstSetupArgs` in the configuration.
:::{.note}
Functionally similar to {option}`specialArgs` but only different in
intent and also for organization purposes.
:::
'';
};
};
config.modules = lib.singleton {
_module.args = { inherit (config) firstSetupArgs; }
};
}