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