flake: add extraSpecialArgs (#1790)
This allows flake user to pass extra arguments to all modules.
(cherry picked from commit cf5dad76c1
)
Co-authored-by: mlatus <wqseleven@gmail.com>
This commit is contained in:
parent
91bd34620d
commit
209566c752
|
@ -9,11 +9,11 @@
|
|||
lib = {
|
||||
hm = import ./modules/lib { lib = nixpkgs.lib; };
|
||||
homeManagerConfiguration = { configuration, system, homeDirectory
|
||||
, username
|
||||
, username, extraSpecialArgs ? { }
|
||||
, pkgs ? builtins.getAttr system nixpkgs.outputs.legacyPackages
|
||||
, check ? true }@args:
|
||||
import ./modules {
|
||||
inherit pkgs check;
|
||||
inherit pkgs check extraSpecialArgs;
|
||||
configuration = { ... }: {
|
||||
imports = [ configuration ];
|
||||
home = { inherit homeDirectory username; };
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
# Whether to check that each option has a matching declaration.
|
||||
, check ? true
|
||||
# Extra arguments passed to specialArgs.
|
||||
, extraSpecialArgs ? { }
|
||||
}:
|
||||
|
||||
with lib;
|
||||
|
@ -31,7 +33,7 @@ let
|
|||
modules = [ configuration ] ++ hmModules;
|
||||
specialArgs = {
|
||||
modulesPath = builtins.toString ./.;
|
||||
};
|
||||
} // extraSpecialArgs;
|
||||
};
|
||||
|
||||
module = showWarnings (
|
||||
|
|
Loading…
Reference in a new issue