Unverified Commit 33e2ec81 authored by Robert Hensing's avatar Robert Hensing Committed by GitHub
Browse files

Merge pull request #284829 from deemp/master

types.nix: fix nonEmptyListOf
parents 4cb1fbf5 7dea495d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ checkConfigError 'It seems as if you.re trying to declare an option by placing i
checkConfigError 'It seems as if you.re trying to declare an option by placing it into .config. rather than .options.' config.nest.wrong2 ./error-mkOption-in-config.nix
checkConfigError 'The option .sub.wrong2. does not exist. Definition values:' config.sub ./error-mkOption-in-submodule-config.nix
checkConfigError '.*This can happen if you e.g. declared your options in .types.submodule.' config.sub ./error-mkOption-in-submodule-config.nix
checkConfigError '.*A definition for option .bad. is not of type .non-empty .list of .submodule...\.' config.bad ./error-nonEmptyListOf-submodule.nix

# types.pathInStore
checkConfigOutput '".*/store/0lz9p8xhf89kb1c1kk6jxrzskaiygnlh-bash-5.2-p15.drv"' config.pathInStore.ok1 ./types.nix
+7 −0
Original line number Diff line number Diff line
{ lib, ... }:
{
  options.bad = lib.mkOption {
    type = lib.types.nonEmptyListOf (lib.types.submodule { });
    default = [ ];
  };
}
+1 −0
Original line number Diff line number Diff line
@@ -557,6 +557,7 @@ rec {
      in list // {
        description = "non-empty ${optionDescriptionPhrase (class: class == "noun") list}";
        emptyValue = { }; # no .value attr, meaning unset
        substSubModules = m: nonEmptyListOf (elemType.substSubModules m);
      };

    attrsOf = elemType: mkOptionType rec {