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:
parent
796d662401
commit
e1e056e82e
1 changed files with 9 additions and 1 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue