treewide: completely remove types.loaOf

This commit is contained in:
rnhmjoj
2020-09-02 00:42:50 +02:00
parent bfd706923e
commit 20d491a317
26 changed files with 52 additions and 147 deletions
@@ -385,17 +385,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.loaOf</varname> <replaceable>t</replaceable>
</term>
<listitem>
<para>
An attribute set or a list of <replaceable>t</replaceable> type. Multiple
definitions are merged according to the value.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<varname>types.nullOr</varname> <replaceable>t</replaceable>
@@ -743,6 +743,18 @@ CREATE ROLE postgres LOGIN SUPERUSER;
See <link xlink:href="https://github.com/NixOS/nixpkgs/pull/82743#issuecomment-674520472">the PR that changed this</link> for more info.
</para>
</listitem>
<listitem>
<para>
For NixOS configuration options, the type <literal>loaOf</literal>, after
its initial deprecation in release 20.03, has been removed. In NixOS and
Nixpkgs options using this type have been converted to <literal>attrsOf</literal>.
</para>
<para>
For more information on this change have look at these links:
<link xlink:href="https://github.com/NixOS/nixpkgs/issues/1800">issue #1800</link>,
<link xlink:href="https://github.com/NixOS/nixpkgs/pull/63103">PR #63103</link>.
</para>
</listitem>
</itemizedlist>
</section>
+2 -2
View File
@@ -463,7 +463,7 @@ in {
users.users = mkOption {
default = {};
type = with types; loaOf (submodule userOpts);
type = with types; attrsOf (submodule userOpts);
example = {
alice = {
uid = 1234;
@@ -487,7 +487,7 @@ in {
{ students.gid = 1001;
hackers = { };
};
type = with types; loaOf (submodule groupOpts);
type = with types; attrsOf (submodule groupOpts);
description = ''
Additional groups to be created automatically by the system.
'';
@@ -27,7 +27,7 @@
};
fileSystems."/boot/firmware" = {
# This effectively "renames" the loaOf entry set in sd-image.nix
# This effectively "renames" the attrsOf entry set in sd-image.nix
mountPoint = "/boot";
neededForBoot = true;
};
@@ -224,7 +224,7 @@ bool optionTypeIs(Context & ctx, Value & v, const std::string & soughtType)
bool isAggregateOptionType(Context & ctx, Value & v)
{
return optionTypeIs(ctx, v, "attrsOf") || optionTypeIs(ctx, v, "listOf") || optionTypeIs(ctx, v, "loaOf");
return optionTypeIs(ctx, v, "attrsOf") || optionTypeIs(ctx, v, "listOf");
}
MakeError(OptionPathError, EvalError);
+1 -1
View File
@@ -131,7 +131,7 @@ in
knownHosts = mkOption {
default = {};
type = types.loaOf (types.submodule ({ name, ... }: {
type = types.attrsOf (types.submodule ({ name, ... }: {
options = {
certAuthority = mkOption {
type = types.bool;
+2 -2
View File
@@ -7,7 +7,7 @@ let
inherit (lib.modules) mkDefault mkIf;
inherit (lib.options) literalExample mkEnableOption mkOption;
inherit (lib.strings) concatStringsSep optionalString toLower;
inherit (lib.types) addCheck attrsOf lines loaOf nullOr package path port str strMatching submodule;
inherit (lib.types) addCheck attrsOf lines nullOr package path port str strMatching submodule;
# Checks if given list of strings contains unique
# elements when compared without considering case.
@@ -178,7 +178,7 @@ let
client system-options file "dsm.sys"
'';
servers = mkOption {
type = loaOf (submodule [ serverOptions ]);
type = attrsOf (submodule [ serverOptions ]);
default = {};
example.mainTsmServer = {
server = "tsmserver.company.com";
+1 -1
View File
@@ -544,7 +544,7 @@ in
security.pam.services = mkOption {
default = [];
type = with types; loaOf (submodule pamOpts);
type = with types; attrsOf (submodule pamOpts);
description =
''
This option defines the PAM services. A service typically
+2 -2
View File
@@ -220,7 +220,7 @@ let
};
destinations = mkOption {
type = loaOf (destType config);
type = attrsOf (destType config);
description = "Additional destinations.";
default = {};
example = literalExample ''
@@ -328,7 +328,7 @@ in
};
zetup = mkOption {
type = loaOf srcType;
type = attrsOf srcType;
description = "Znapzend configuration.";
default = {};
example = literalExample ''
+1 -1
View File
@@ -160,7 +160,7 @@ in
};
appConfig = mkOption {
type = types.loaOf appConfigModule;
type = types.attrsOf appConfigModule;
default = {};
example = literalExample ''
"com.github.app" = {
@@ -81,7 +81,7 @@ in
{ office1 = { model = "MFC-7860DW"; ip = "192.168.1.2"; };
office2 = { model = "MFC-7860DW"; nodename = "BRW0080927AFBCE"; };
};
type = with types; loaOf (submodule netDeviceOpts);
type = with types; attrsOf (submodule netDeviceOpts);
description = ''
The list of network devices that will be registered against the brscan4
sane backend.
@@ -3,7 +3,7 @@
let
inherit (lib.options) literalExample mkEnableOption mkOption;
inherit (lib.types) bool enum int lines loaOf nullOr path str submodule;
inherit (lib.types) bool enum int lines attrsOf nullOr path str submodule;
inherit (lib.modules) mkDefault mkIf mkMerge;
commonDescr = ''
@@ -248,7 +248,7 @@ in
};
modems = mkOption {
type = loaOf (submodule [ modemConfigOptions ]);
type = attrsOf (submodule [ modemConfigOptions ]);
default = {};
example.ttyS1 = {
type = "cirrus";
+1 -1
View File
@@ -140,7 +140,7 @@ in
services.nylon = mkOption {
default = {};
description = "Collection of named nylon instances";
type = with types; loaOf (submodule nylonOpts);
type = with types; attrsOf (submodule nylonOpts);
internal = true;
};
@@ -655,7 +655,7 @@ in
description = "Define the virtual hosts";
type = with types; loaOf (submodule vHostOpts);
type = with types; attrsOf (submodule vHostOpts);
example = {
myhost = {
@@ -361,7 +361,7 @@ in
};
users.users = mkOption {
type = with types; loaOf (submodule userOptions);
type = with types; attrsOf (submodule userOptions);
};
};
+1 -1
View File
@@ -597,7 +597,7 @@ in
];
}
'';
type = types.loaOf (types.submodule ({name, ...}: {
type = types.attrsOf (types.submodule ({name, ...}: {
options = {
name = mkOption {
+1 -1
View File
@@ -516,7 +516,7 @@ in
<filename>/dev/mapper/<replaceable>name</replaceable></filename>.
'';
type = with types; loaOf (submodule (
type = with types; attrsOf (submodule (
{ name, ... }: { options = {
name = mkOption {
+1 -1
View File
@@ -555,7 +555,7 @@ in
};
fileSystems = mkOption {
type = with lib.types; loaOf (submodule {
type = with lib.types; attrsOf (submodule {
options.neededForBoot = mkOption {
default = false;
type = types.bool;
+1 -1
View File
@@ -46,7 +46,7 @@ in
Set of files that have to be linked in <filename>/etc</filename>.
'';
type = with types; loaOf (submodule (
type = with types; attrsOf (submodule (
{ name, config, ... }:
{ options = {
+1 -1
View File
@@ -54,7 +54,7 @@ in
options = {
fileSystems = mkOption {
type = with lib.types; loaOf (submodule encryptedFSOptions);
type = with lib.types; attrsOf (submodule encryptedFSOptions);
};
swapDevices = mkOption {
type = with lib.types; listOf (submodule encryptedFSOptions);
+2 -2
View File
@@ -159,7 +159,7 @@ in
"/bigdisk".label = "bigdisk";
}
'';
type = types.loaOf (types.submodule [coreFileSystemOpts fileSystemOpts]);
type = types.attrsOf (types.submodule [coreFileSystemOpts fileSystemOpts]);
description = ''
The file systems to be mounted. It must include an entry for
the root directory (<literal>mountPoint = "/"</literal>). Each
@@ -193,7 +193,7 @@ in
boot.specialFileSystems = mkOption {
default = {};
type = types.loaOf (types.submodule coreFileSystemOpts);
type = types.attrsOf (types.submodule coreFileSystemOpts);
internal = true;
description = ''
Special filesystems that are mounted very early during boot.
+2 -2
View File
@@ -519,7 +519,7 @@ in
<option>networking.useDHCP</option> is true, then every
interface not listed here will be configured using DHCP.
'';
type = with types; loaOf (submodule interfaceOpts);
type = with types; attrsOf (submodule interfaceOpts);
};
networking.vswitches = mkOption {
@@ -544,7 +544,7 @@ in
interfaces = mkOption {
example = [ "eth0" "eth1" ];
description = "The physical network interfaces connected by the vSwitch.";
type = with types; loaOf (submodule vswitchInterfaceOpts);
type = with types; attrsOf (submodule vswitchInterfaceOpts);
};
controllers = mkOption {
@@ -627,7 +627,7 @@ in
};
bindMounts = mkOption {
type = with types; loaOf (submodule bindMountOpts);
type = with types; attrsOf (submodule bindMountOpts);
default = {};
example = literalExample ''
{ "/home" = { hostPath = "/home/alice";
+2 -2
View File
@@ -41,7 +41,7 @@ let
description = "Source for the in-container mount";
};
options = mkOption {
type = loaOf (str);
type = attrsOf (str);
default = [ "bind" ];
description = ''
Mount options of the filesystem to be used.
@@ -61,7 +61,7 @@ in
containers = mkOption {
default = {};
description = "Declarative container configuration";
type = with types; loaOf (submodule ({ name, config, ... }: {
type = with types; attrsOf (submodule ({ name, config, ... }: {
options = {
cmd = mkOption {
type = types.lines;