mirror of
https://github.com/nix-community/home-manager
synced 2024-12-21 01:09:47 +01:00
specialization: fix name
conflict inside NixOS module (#3718)
If used inside the NixOS/nix-darwin module, we get conflicting definitions of `name` inside the specialization: one is the user name coming from the NixOS module definition and the other is `configuration`, the name of this option. Thus we need to explicitly wire the former into the module arguments. See discussion at https://github.com/nix-community/home-manager/issues/3716
This commit is contained in:
parent
9438e56a7b
commit
ddcbf676ba
1 changed files with 14 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
||||||
{ config, extendModules, lib, ... }:
|
{ config, name, extendModules, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
|
@ -8,8 +8,19 @@ with lib;
|
||||||
options = {
|
options = {
|
||||||
configuration = mkOption {
|
configuration = mkOption {
|
||||||
type = let
|
type = let
|
||||||
stopRecursion = { specialization = mkOverride 0 { }; };
|
extended = extendModules {
|
||||||
extended = extendModules { modules = [ stopRecursion ]; };
|
modules = [{
|
||||||
|
# Prevent infinite recursion
|
||||||
|
specialization = mkOverride 0 { };
|
||||||
|
|
||||||
|
# If used inside the NixOS/nix-darwin module, we get conflicting definitions
|
||||||
|
# of `name` inside the specialization: one is the user name coming from the
|
||||||
|
# NixOS module definition and the other is `configuration`, the name of this
|
||||||
|
# option. Thus we need to explicitly wire the former into the module arguments.
|
||||||
|
# See discussion at https://github.com/nix-community/home-manager/issues/3716
|
||||||
|
_module.args.name = mkForce name;
|
||||||
|
}];
|
||||||
|
};
|
||||||
in extended.type;
|
in extended.type;
|
||||||
default = { };
|
default = { };
|
||||||
visible = "shallow";
|
visible = "shallow";
|
||||||
|
|
Loading…
Reference in a new issue