nixos/modules: Replace all nested types.either's with types.oneOf's

Changed files
+13 -13
nixos
+1 -1
nixos/modules/services/backup/automysqlbackup.nix
···
};
config = mkOption {
-
type = with types; attrsOf (either (either str (either int bool)) (listOf str));
+
type = with types; attrsOf (oneOf [ str int bool (listOf str) ]);
default = {};
description = ''
automysqlbackup configuration. Refer to
+1 -1
nixos/modules/services/games/minecraft-server.nix
···
};
serverProperties = mkOption {
-
type = with types; attrsOf (either bool (either int str));
+
type = with types; attrsOf (oneOf [ bool int str ]);
default = {};
example = literalExample ''
{
+1 -1
nixos/modules/services/mail/davmail.nix
···
cfg = config.services.davmail;
configType = with types;
-
either (either (attrsOf configType) str) (either int bool) // {
+
oneOf [ (attrsOf configType) str int bool ] // {
description = "davmail config type (str, int, bool or attribute set thereof)";
};
+1 -1
nixos/modules/services/mail/postfix.nix
···
};
config = mkOption {
-
type = with types; attrsOf (either bool (either str (listOf str)));
+
type = with types; attrsOf (oneOf [ bool str (listOf str) ]);
description = ''
The main.cf configuration file as key value set.
'';
+1 -1
nixos/modules/services/mail/rspamd.nix
···
};
config = mkOption {
-
type = with types; attrsOf (either bool (either str (listOf str)));
+
type = with types; attrsOf (oneOf [ bool str (listOf str) ]);
description = ''
Addon to postfix configuration
'';
+1 -1
nixos/modules/services/mail/rss2email.nix
···
};
config = mkOption {
-
type = with types; attrsOf (either str (either int bool));
+
type = with types; attrsOf (oneOf [ str int bool ]);
default = {};
description = ''
The configuration to give rss2email.
+2 -2
nixos/modules/services/networking/znc/default.nix
···
concatStringsSep "\n" (toLines cfg.config);
semanticTypes = with types; rec {
-
zncAtom = nullOr (either (either int bool) str);
+
zncAtom = nullOr (oneOf [ int bool str ]);
zncAttr = attrsOf (nullOr zncConf);
-
zncAll = either (either zncAtom (listOf zncAtom)) zncAttr;
+
zncAll = oneOf [ zncAtom (listOf zncAtom) zncAttr ];
zncConf = attrsOf (zncAll // {
# Since this is a recursive type and the description by default contains
# the description of its subtypes, infinite recursion would occur without
+1 -1
nixos/modules/services/security/bitwarden_rs/default.nix
···
};
config = mkOption {
-
type = attrsOf (nullOr (either (either bool int) str));
+
type = attrsOf (nullOr (oneOf [ bool int str ]));
default = {};
example = literalExample ''
{
+1 -1
nixos/modules/services/web-apps/limesurvey.nix
···
pkg = pkgs.limesurvey;
-
configType = with types; either (either (attrsOf configType) str) (either int bool) // {
+
configType = with types; oneOf [ (attrsOf configType) str int bool ] // {
description = "limesurvey config type (str, int, bool or attribute set thereof)";
};
+1 -1
nixos/modules/services/x11/compton.nix
···
};
settings = let
-
configTypes = with types; either bool (either int (either float str));
+
configTypes = with types; oneOf [ bool int float str ];
# types.loaOf converts lists to sets
loaOf = t: with types; either (listOf t) (attrsOf t);
in mkOption {
+1 -1
nixos/modules/system/boot/systemd-unit-options.nix
···
environment = mkOption {
default = {};
-
type = with types; attrsOf (nullOr (either str (either path package)));
+
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
example = { PATH = "/foo/bar/bin"; LANG = "nl_NL.UTF-8"; };
description = "Environment variables passed to the service's processes.";
};
+1 -1
nixos/modules/system/boot/systemd.nix
···
};
systemd.globalEnvironment = mkOption {
-
type = with types; attrsOf (nullOr (either str (either path package)));
+
type = with types; attrsOf (nullOr (oneOf [ str path package ]));
default = {};
example = { TZ = "CET"; };
description = ''