mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
flake: list deprecated args in throw
The use of `throwIf` was retained on the off chance that someone intentionally overrides it.
This commit is contained in:
parent
1f5ef2bb41
commit
6dc8a43f39
1 changed files with 28 additions and 18 deletions
26
flake.nix
26
flake.nix
|
@ -45,8 +45,7 @@
|
||||||
, configuration ? null, extraModules ? null, stateVersion ? null
|
, configuration ? null, extraModules ? null, stateVersion ? null
|
||||||
, username ? null, homeDirectory ? null, system ? null }@args:
|
, username ? null, homeDirectory ? null, system ? null }@args:
|
||||||
let
|
let
|
||||||
throwForRemovedArg = v:
|
msgForRemovedArg = ''
|
||||||
lib.throwIf (v != null) ''
|
|
||||||
The 'homeManagerConfiguration' arguments
|
The 'homeManagerConfiguration' arguments
|
||||||
|
|
||||||
- 'configuration',
|
- 'configuration',
|
||||||
|
@ -60,12 +59,23 @@
|
||||||
'modules'. See the 22.11 release notes for more.
|
'modules'. See the 22.11 release notes for more.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
throwForRemovedArgs = throwForRemovedArg configuration # \
|
throwForRemovedArgs = v:
|
||||||
throwForRemovedArg username # \
|
let
|
||||||
throwForRemovedArg homeDirectory # \
|
used = builtins.filter (n: (args.${n} or null) != null) [
|
||||||
throwForRemovedArg stateVersion # \
|
"configuration"
|
||||||
throwForRemovedArg extraModules # \
|
"username"
|
||||||
throwForRemovedArg system;
|
"homeDirectory"
|
||||||
|
"stateVersion"
|
||||||
|
"extraModules"
|
||||||
|
"system"
|
||||||
|
];
|
||||||
|
msg = msgForRemovedArg + ''
|
||||||
|
|
||||||
|
|
||||||
|
Deprecated args passed: ''
|
||||||
|
+ builtins.concatStringsSep " " used;
|
||||||
|
in lib.throwIf (used != [ ]) msg v;
|
||||||
|
|
||||||
in throwForRemovedArgs (import ./modules {
|
in throwForRemovedArgs (import ./modules {
|
||||||
inherit pkgs lib check extraSpecialArgs;
|
inherit pkgs lib check extraSpecialArgs;
|
||||||
configuration = { ... }: {
|
configuration = { ... }: {
|
||||||
|
|
Loading…
Reference in a new issue