Add enum option type

nixos-19.03
Shea Levy 9 years ago
parent e4630c1d41
commit ab2cd34076
  1. 6
      lib/types.nix

@ -194,6 +194,12 @@ rec {
args = { name = ""; }; }).options;
};
enum = values: mkOptionType {
name = "one of ${concatStringsSep ", " values}.";
check = flip elem values;
merge = mergeOneOption;
};
# Obsolete alternative to configOf. It takes its option
# declarations from the ‘options’ attribute of containing option
# declaration.

Loading…
Cancel
Save