Skip to content

Commit

Permalink
lib/options: add mkEnum' argument assertions
Browse files Browse the repository at this point in the history
  • Loading branch information
MattSturgeon committed Jun 2, 2024
1 parent a2443ac commit f7e009d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/options.nix
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ rec {
default ? head values,
...
}@args:
# `values` is a list and `default` is one of the values (or null)
assert isList values;
assert default == null || elem default values;
mkNullableWithRaw' (
(filterAttrs (n: v: n != "values") args)
// {
Expand Down

0 comments on commit f7e009d

Please sign in to comment.