1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-08 19:46:06 +01:00

dependencies: ensure __depPackages.foo.* options are set only once

This commit is contained in:
Gaetan Lepage 2025-09-16 16:42:39 +02:00 committed by Gaétan Lepage
parent 796d662401
commit e1e056e82e

View file

@ -28,7 +28,15 @@ let
};
};
attrPathType = with types; coercedTo str lib.toList (listOf str);
# Motivation:
# If one were to define `__depPackages.foo.default = "gzip";` in two places (by accident),
# the module system would merge the two definitions as `["gzip" "gzip"]`.
#
# Solution:
# -> Make attrPathType unique so the option can only be set once.
attrPathType =
with types;
unique { message = "attrPathType must be unique"; } (coercedTo str lib.toList (listOf str));
literalExpressionType = lib.types.mkOptionType {
name = "literal-expression";