Skip to content

Commit bf1bebe

Browse files
committed
fix(nixConfig): deduplicate list values at type level instead of mkForce
Replace listOf with a custom deduplicatedListOf type that calls lib.unique on the merged result, preventing duplicate entries from nixConfig.settings propagation without resorting to mkForce (which would prevent end-user overrides at the component level). The deduplication runs during type merge, cleaning up duplicates introduced when top-level nixConfig.settings are propagated to subcomponents (node, pynixd controller, builder) via direct assignment, where they merge with the submodule defaults at the same priority.
1 parent f8e466c commit bf1bebe

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

kubenix/nixOptions.nix

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@ let
1313
# "kvm"
1414
];
1515

16+
deduplicatedListOf = type:
17+
let
18+
listType = lib.types.listOf type;
19+
baseMerge = listType.merge;
20+
in
21+
listType // {
22+
merge = loc: defs: lib.unique (baseMerge loc defs);
23+
};
24+
1625
semanticConfType =
1726
with lib.types;
1827
let
@@ -29,7 +38,7 @@ let
2938
description = "Nix config atom (null, bool, int, float, str, path or package)";
3039
};
3140
in
32-
attrsOf (either confAtom (listOf confAtom));
41+
attrsOf (either confAtom (deduplicatedListOf confAtom));
3342
in
3443
with lib;
3544
types.submodule (

0 commit comments

Comments
 (0)