From 20d491a317d9956ddca80913f07d04bd234ea432 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 23 Aug 2020 01:28:45 +0200 Subject: [PATCH 1/3] treewide: completely remove types.loaOf --- lib/modules.nix | 1 - lib/types.nix | 117 ++---------------- nixos/doc/manual/development/option-types.xml | 11 -- nixos/doc/manual/release-notes/rl-2009.xml | 12 ++ nixos/modules/config/users-groups.nix | 4 +- .../cd-dvd/sd-image-raspberrypi4.nix | 2 +- .../tools/nixos-option/nixos-option.cc | 2 +- nixos/modules/programs/ssh.nix | 2 +- nixos/modules/programs/tsm-client.nix | 4 +- nixos/modules/security/pam.nix | 2 +- nixos/modules/services/backup/znapzend.nix | 4 +- nixos/modules/services/desktops/geoclue2.nix | 2 +- .../hardware/sane_extra_backends/brscan4.nix | 2 +- .../services/networking/hylafax/options.nix | 4 +- nixos/modules/services/networking/nylon.nix | 2 +- nixos/modules/services/networking/prosody.nix | 2 +- .../modules/services/networking/ssh/sshd.nix | 2 +- nixos/modules/services/security/tor.nix | 2 +- nixos/modules/system/boot/luksroot.nix | 2 +- nixos/modules/system/boot/stage-1.nix | 2 +- nixos/modules/system/etc/etc.nix | 2 +- nixos/modules/tasks/encrypted-devices.nix | 2 +- nixos/modules/tasks/filesystems.nix | 4 +- nixos/modules/tasks/network-interfaces.nix | 4 +- .../virtualisation/nixos-containers.nix | 2 +- nixos/modules/virtualisation/railcar.nix | 4 +- 26 files changed, 52 insertions(+), 147 deletions(-) diff --git a/lib/modules.nix b/lib/modules.nix index 2ec3469980958..decb96ffe1117 100644 --- a/lib/modules.nix +++ b/lib/modules.nix @@ -613,7 +613,6 @@ rec { if tp.name == "option set" || tp.name == "submodule" then throw "The option ${showOption loc} uses submodules without a wrapping type, in ${showFiles opt.declarations}." else if optionSetIn "attrsOf" then types.attrsOf (types.submodule options) - else if optionSetIn "loaOf" then types.loaOf (types.submodule options) else if optionSetIn "listOf" then types.listOf (types.submodule options) else if optionSetIn "nullOr" then types.nullOr (types.submodule options) else tp; diff --git a/lib/types.nix b/lib/types.nix index 1845b6ae339e8..17e7a939fe3d3 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -252,8 +252,8 @@ rec { merge = mergeEqualOption; }; - # drop this in the future: - list = builtins.trace "`types.list` is deprecated; use `types.listOf` instead" types.listOf; + # TODO: drop this in the future: + list = builtins.trace "`types.list` has been removed; please use `types.listOf` instead" types.listOf; listOf = elemType: mkOptionType rec { name = "listOf"; @@ -326,110 +326,15 @@ rec { functor = (defaultFunctor name) // { wrapped = elemType; }; }; - # List or attribute set of ... - loaOf = elemType: - let - convertAllLists = loc: defs: - let - padWidth = stringLength (toString (length defs)); - unnamedPrefix = i: "unnamed-" + fixedWidthNumber padWidth i + "."; - in - imap1 (i: convertIfList loc (unnamedPrefix i)) defs; - convertIfList = loc: unnamedPrefix: def: - if isList def.value then - let - padWidth = stringLength (toString (length def.value)); - unnamed = i: unnamedPrefix + fixedWidthNumber padWidth i; - anyString = placeholder "name"; - nameAttrs = [ - { path = [ "environment" "etc" ]; - name = "target"; - } - { path = [ "containers" anyString "bindMounts" ]; - name = "mountPoint"; - } - { path = [ "programs" "ssh" "knownHosts" ]; - # hostNames is actually a list so we would need to handle it only when singleton - name = "hostNames"; - } - { path = [ "fileSystems" ]; - name = "mountPoint"; - } - { path = [ "boot" "specialFileSystems" ]; - name = "mountPoint"; - } - { path = [ "services" "znapzend" "zetup" ]; - name = "dataset"; - } - { path = [ "services" "znapzend" "zetup" anyString "destinations" ]; - name = "label"; - } - { path = [ "services" "geoclue2" "appConfig" ]; - name = "desktopID"; - } - ]; - matched = let - equals = a: b: b == anyString || a == b; - fallback = { name = "name"; }; - in findFirst ({ path, ... }: all (v: v == true) (zipListsWith equals loc path)) fallback nameAttrs; - nameAttr = matched.name; - nameValueOld = value: - if isList value then - if length value > 0 then - "[ " + concatMapStringsSep " " escapeNixString value + " ]" - else - "[ ]" - else - escapeNixString value; - nameValueNew = value: unnamed: - if isList value then - if length value > 0 then - head value - else - unnamed - else - value; - res = - { inherit (def) file; - value = listToAttrs ( - imap1 (elemIdx: elem: - { name = nameValueNew (elem.${nameAttr} or (unnamed elemIdx)) (unnamed elemIdx); - value = elem; - }) def.value); - }; - option = concatStringsSep "." loc; - sample = take 3 def.value; - more = lib.optionalString (length def.value > 3) "... "; - list = concatMapStrings (x: ''{ ${nameAttr} = ${nameValueOld (x.${nameAttr} or "unnamed")}; ...} '') sample; - set = concatMapStrings (x: ''${nameValueNew (x.${nameAttr} or "unnamed") "unnamed"} = {...}; '') sample; - msg = '' - In file ${def.file} - a list is being assigned to the option config.${option}. - This will soon be an error as type loaOf is deprecated. - See https://github.com/NixOS/nixpkgs/pull/63103 for more information. - Do - ${option} = - { ${set}${more}} - instead of - ${option} = - [ ${list}${more}] - ''; - in - lib.warn msg res - else - def; - attrOnly = attrsOf elemType; - in mkOptionType rec { - name = "loaOf"; - description = "list or attribute set of ${elemType.description}s"; - check = x: isList x || isAttrs x; - merge = loc: defs: attrOnly.merge loc (convertAllLists loc defs); - emptyValue = { value = {}; }; - getSubOptions = prefix: elemType.getSubOptions (prefix ++ [""]); - getSubModules = elemType.getSubModules; - substSubModules = m: loaOf (elemType.substSubModules m); - functor = (defaultFunctor name) // { wrapped = elemType; }; - }; + # TODO: drop this in the future: + loaOf = + let msg = + '' + `types.loaOf` has been removed and mixing lists with attribute values + is no longer possible; please use `types.attrsOf` instead. + See https://github.com/NixOS/nixpkgs/issues/1800 for the motivation. + ''; + in builtins.trace msg types.attrsOf; # Value of given type but with no merging (i.e. `uniq list`s are not concatenated). uniq = elemType: mkOptionType rec { diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml index 957349ad1811a..5a6dae6e9912e 100644 --- a/nixos/doc/manual/development/option-types.xml +++ b/nixos/doc/manual/development/option-types.xml @@ -385,17 +385,6 @@ - - - types.loaOf t - - - - An attribute set or a list of t type. Multiple - definitions are merged according to the value. - - - types.nullOr t diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index 83bc2f82bbfcc..bf96fb21a4156 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -743,6 +743,18 @@ CREATE ROLE postgres LOGIN SUPERUSER; See the PR that changed this for more info. + + + For NixOS configuration options, the type loaOf, after + its initial deprecation in release 20.03, has been removed. In NixOS and + Nixpkgs options using this type have been converted to attrsOf. + + + For more information on this change have look at these links: + issue #1800, + PR #63103. + + diff --git a/nixos/modules/config/users-groups.nix b/nixos/modules/config/users-groups.nix index 56b7af98b617b..0ab303d0ae47b 100644 --- a/nixos/modules/config/users-groups.nix +++ b/nixos/modules/config/users-groups.nix @@ -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. ''; diff --git a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix index 79c835dc39095..87545e8420308 100644 --- a/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix +++ b/nixos/modules/installer/cd-dvd/sd-image-raspberrypi4.nix @@ -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; }; diff --git a/nixos/modules/installer/tools/nixos-option/nixos-option.cc b/nixos/modules/installer/tools/nixos-option/nixos-option.cc index 1a7b07a74f8ac..f779d82edbd6f 100644 --- a/nixos/modules/installer/tools/nixos-option/nixos-option.cc +++ b/nixos/modules/installer/tools/nixos-option/nixos-option.cc @@ -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); diff --git a/nixos/modules/programs/ssh.nix b/nixos/modules/programs/ssh.nix index a983ffa4b890f..40af4d0ff5aeb 100644 --- a/nixos/modules/programs/ssh.nix +++ b/nixos/modules/programs/ssh.nix @@ -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; diff --git a/nixos/modules/programs/tsm-client.nix b/nixos/modules/programs/tsm-client.nix index eb6f12475286f..7ac4086d5f094 100644 --- a/nixos/modules/programs/tsm-client.nix +++ b/nixos/modules/programs/tsm-client.nix @@ -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"; diff --git a/nixos/modules/security/pam.nix b/nixos/modules/security/pam.nix index 565c15dec24b1..ce74805ef4132 100644 --- a/nixos/modules/security/pam.nix +++ b/nixos/modules/security/pam.nix @@ -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 diff --git a/nixos/modules/services/backup/znapzend.nix b/nixos/modules/services/backup/znapzend.nix index 8098617d11f3c..0ca71b413cee0 100644 --- a/nixos/modules/services/backup/znapzend.nix +++ b/nixos/modules/services/backup/znapzend.nix @@ -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 '' diff --git a/nixos/modules/services/desktops/geoclue2.nix b/nixos/modules/services/desktops/geoclue2.nix index 542b2ead41040..6702bd395a03e 100644 --- a/nixos/modules/services/desktops/geoclue2.nix +++ b/nixos/modules/services/desktops/geoclue2.nix @@ -160,7 +160,7 @@ in }; appConfig = mkOption { - type = types.loaOf appConfigModule; + type = types.attrsOf appConfigModule; default = {}; example = literalExample '' "com.github.app" = { diff --git a/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix b/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix index 6f49a1ab6d406..a6afa01dd8124 100644 --- a/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix +++ b/nixos/modules/services/hardware/sane_extra_backends/brscan4.nix @@ -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. diff --git a/nixos/modules/services/networking/hylafax/options.nix b/nixos/modules/services/networking/hylafax/options.nix index 4ac6d3fa8432d..9e28d09dffca5 100644 --- a/nixos/modules/services/networking/hylafax/options.nix +++ b/nixos/modules/services/networking/hylafax/options.nix @@ -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"; diff --git a/nixos/modules/services/networking/nylon.nix b/nixos/modules/services/networking/nylon.nix index 7c171281a9262..bfc358cb12fb1 100644 --- a/nixos/modules/services/networking/nylon.nix +++ b/nixos/modules/services/networking/nylon.nix @@ -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; }; diff --git a/nixos/modules/services/networking/prosody.nix b/nixos/modules/services/networking/prosody.nix index e53d7093be864..a6c1cb0f4797a 100644 --- a/nixos/modules/services/networking/prosody.nix +++ b/nixos/modules/services/networking/prosody.nix @@ -655,7 +655,7 @@ in description = "Define the virtual hosts"; - type = with types; loaOf (submodule vHostOpts); + type = with types; attrsOf (submodule vHostOpts); example = { myhost = { diff --git a/nixos/modules/services/networking/ssh/sshd.nix b/nixos/modules/services/networking/ssh/sshd.nix index 17f31e3a488d8..6b27cbc56bd94 100644 --- a/nixos/modules/services/networking/ssh/sshd.nix +++ b/nixos/modules/services/networking/ssh/sshd.nix @@ -361,7 +361,7 @@ in }; users.users = mkOption { - type = with types; loaOf (submodule userOptions); + type = with types; attrsOf (submodule userOptions); }; }; diff --git a/nixos/modules/services/security/tor.nix b/nixos/modules/services/security/tor.nix index b33e905c67dea..885b23ac6946e 100644 --- a/nixos/modules/services/security/tor.nix +++ b/nixos/modules/services/security/tor.nix @@ -597,7 +597,7 @@ in ]; } ''; - type = types.loaOf (types.submodule ({name, ...}: { + type = types.attrsOf (types.submodule ({name, ...}: { options = { name = mkOption { diff --git a/nixos/modules/system/boot/luksroot.nix b/nixos/modules/system/boot/luksroot.nix index 166f89c706611..a4cbb03a8e32b 100644 --- a/nixos/modules/system/boot/luksroot.nix +++ b/nixos/modules/system/boot/luksroot.nix @@ -516,7 +516,7 @@ in /dev/mapper/name. ''; - type = with types; loaOf (submodule ( + type = with types; attrsOf (submodule ( { name, ... }: { options = { name = mkOption { diff --git a/nixos/modules/system/boot/stage-1.nix b/nixos/modules/system/boot/stage-1.nix index a04660fb56e7d..97eb1d286a354 100644 --- a/nixos/modules/system/boot/stage-1.nix +++ b/nixos/modules/system/boot/stage-1.nix @@ -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; diff --git a/nixos/modules/system/etc/etc.nix b/nixos/modules/system/etc/etc.nix index 1f4d54a1ae205..7478e3e80717f 100644 --- a/nixos/modules/system/etc/etc.nix +++ b/nixos/modules/system/etc/etc.nix @@ -46,7 +46,7 @@ in Set of files that have to be linked in /etc. ''; - type = with types; loaOf (submodule ( + type = with types; attrsOf (submodule ( { name, config, ... }: { options = { diff --git a/nixos/modules/tasks/encrypted-devices.nix b/nixos/modules/tasks/encrypted-devices.nix index 9c3f2d8fccb23..dd337de98698c 100644 --- a/nixos/modules/tasks/encrypted-devices.nix +++ b/nixos/modules/tasks/encrypted-devices.nix @@ -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); diff --git a/nixos/modules/tasks/filesystems.nix b/nixos/modules/tasks/filesystems.nix index 0ade74b957a0c..3ea67dac7146d 100644 --- a/nixos/modules/tasks/filesystems.nix +++ b/nixos/modules/tasks/filesystems.nix @@ -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 (mountPoint = "/"). 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. diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index 565868724ad53..2e533fb604e76 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -519,7 +519,7 @@ in 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 { diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix index b0fa03917c822..8fbb4efd20196 100644 --- a/nixos/modules/virtualisation/nixos-containers.nix +++ b/nixos/modules/virtualisation/nixos-containers.nix @@ -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"; diff --git a/nixos/modules/virtualisation/railcar.nix b/nixos/modules/virtualisation/railcar.nix index 3f188fc68e55f..10464f6289846 100644 --- a/nixos/modules/virtualisation/railcar.nix +++ b/nixos/modules/virtualisation/railcar.nix @@ -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; From bc62423a8733e0629600a8dbeb72f94a694cf14f Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sun, 23 Aug 2020 19:11:40 +0200 Subject: [PATCH 2/3] nixos/doc: convert loaOf options refs to attrsOf --- nixos/doc/manual/administration/boot-problems.xml | 4 ++-- .../manual/administration/imperative-containers.xml | 2 +- nixos/doc/manual/configuration/file-systems.xml | 8 ++++---- nixos/doc/manual/configuration/ipv4-config.xml | 2 +- nixos/doc/manual/configuration/ipv6-config.xml | 2 +- nixos/doc/manual/configuration/luks-file-systems.xml | 6 +++--- nixos/doc/manual/configuration/network-manager.xml | 2 +- nixos/doc/manual/configuration/ssh.xml | 2 +- nixos/doc/manual/configuration/user-mgmt.xml | 12 ++++++------ nixos/doc/manual/installation/changing-config.xml | 2 +- .../installation/installing-from-other-distro.xml | 2 +- nixos/doc/manual/installation/installing.xml | 2 +- nixos/doc/manual/release-notes/rl-2003.xml | 2 +- nixos/doc/manual/release-notes/rl-2009.xml | 2 -- nixos/modules/services/networking/prosody.xml | 8 ++++---- 15 files changed, 28 insertions(+), 30 deletions(-) diff --git a/nixos/doc/manual/administration/boot-problems.xml b/nixos/doc/manual/administration/boot-problems.xml index badc374ebcfd9..e0f662840101d 100644 --- a/nixos/doc/manual/administration/boot-problems.xml +++ b/nixos/doc/manual/administration/boot-problems.xml @@ -58,9 +58,9 @@ Like boot.debug1 or boot.debug1devices, but runs stage1 until all filesystems that are mounted during initrd are mounted (see - + ). As a motivating example, this could be useful if you've forgotten to set - + on a file system. diff --git a/nixos/doc/manual/administration/imperative-containers.xml b/nixos/doc/manual/administration/imperative-containers.xml index 7ded0c11786e1..435ed230f5133 100644 --- a/nixos/doc/manual/administration/imperative-containers.xml +++ b/nixos/doc/manual/administration/imperative-containers.xml @@ -27,7 +27,7 @@ # nixos-container create foo --config ' = true; - users.users.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"]; + users.users.root.openssh.authorizedKeys.keys = ["ssh-dss AAAAB3N…"]; ' By default the next free address in the 10.233.0.0/16 subnet will be chosen diff --git a/nixos/doc/manual/configuration/file-systems.xml b/nixos/doc/manual/configuration/file-systems.xml index 3ac02a975ebf6..9747433375fc5 100644 --- a/nixos/doc/manual/configuration/file-systems.xml +++ b/nixos/doc/manual/configuration/file-systems.xml @@ -23,12 +23,12 @@ systemd-fstab-generator. The filesystem will be mounted automatically unless "noauto" is present in options. + linkend="opt-fileSystems._name_.options">options. "noauto" filesystems can be mounted explicitly using systemctl e.g. systemctl start data.mount. Mount points are created automatically if they don’t already exist. For - , + , it’s best to use the topology-independent device aliases in /dev/disk/by-label and /dev/disk/by-uuid, as these don’t change if the @@ -36,7 +36,7 @@ You can usually omit the file system type - (), + (), since mount can usually detect the type and load the necessary kernel module automatically. However, if the file system is needed at early boot (in the initial ramdisk) and is not ext2, @@ -49,7 +49,7 @@ System startup will fail if any of the filesystems fails to mount, dropping you to the emergency shell. You can make a mount asynchronous and non-critical by adding - options = [ + options = [ "nofail" ];. diff --git a/nixos/doc/manual/configuration/ipv4-config.xml b/nixos/doc/manual/configuration/ipv4-config.xml index 71ddf41491baf..884becf0979a0 100644 --- a/nixos/doc/manual/configuration/ipv4-config.xml +++ b/nixos/doc/manual/configuration/ipv4-config.xml @@ -10,7 +10,7 @@ automatically configure network interfaces. However, you can configure an interface manually as follows: -networking.interfaces.eth0.ipv4.addresses = [ { +networking.interfaces.eth0.ipv4.addresses = [ { address = "192.168.1.2"; prefixLength = 24; } ]; diff --git a/nixos/doc/manual/configuration/ipv6-config.xml b/nixos/doc/manual/configuration/ipv6-config.xml index 675a5d9a260dc..7b89b4092be7d 100644 --- a/nixos/doc/manual/configuration/ipv6-config.xml +++ b/nixos/doc/manual/configuration/ipv6-config.xml @@ -26,7 +26,7 @@ As with IPv4 networking interfaces are automatically configured via DHCPv6. You can configure an interface manually: -networking.interfaces.eth0.ipv6.addresses = [ { +networking.interfaces.eth0.ipv6.addresses = [ { address = "fe00:aa:bb:cc::2"; prefixLength = 64; } ]; diff --git a/nixos/doc/manual/configuration/luks-file-systems.xml b/nixos/doc/manual/configuration/luks-file-systems.xml index d3007843d68bd..8a8168c095f08 100644 --- a/nixos/doc/manual/configuration/luks-file-systems.xml +++ b/nixos/doc/manual/configuration/luks-file-systems.xml @@ -30,7 +30,7 @@ Enter passphrase for /dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d: *** /, add the following to configuration.nix: -boot.initrd.luks.devices.crypted.device = "/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d"; +boot.initrd.luks.devices.crypted.device = "/dev/disk/by-uuid/3f6b0024-3a44-4fde-a43a-767b872abe5d"; ."/".device = "/dev/mapper/crypted"; Should grub be used as bootloader, and /boot is located @@ -60,13 +60,13 @@ Added to key to device /dev/sda2, slot: 2 To ensure that this file system is decrypted using the FIDO2 compatible key, add the following to configuration.nix: boot.initrd.luks.fido2Support = true; -boot.initrd.luks.devices."/dev/sda2".fido2.credential = "f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7"; +boot.initrd.luks.devices."/dev/sda2".fido2.credential = "f1d00200108b9d6e849a8b388da457688e3dd653b4e53770012d8f28e5d3b269865038c346802f36f3da7278b13ad6a3bb6a1452e24ebeeaa24ba40eef559b1b287d2a2f80b7"; You can also use the FIDO2 passwordless setup, but for security reasons, you might want to enable it only when your device is PIN protected, such as Trezor. -boot.initrd.luks.devices."/dev/sda2".fido2.passwordLess = true; +boot.initrd.luks.devices."/dev/sda2".fido2.passwordLess = true; diff --git a/nixos/doc/manual/configuration/network-manager.xml b/nixos/doc/manual/configuration/network-manager.xml index 3953e0ffe851a..94d229fd803f5 100644 --- a/nixos/doc/manual/configuration/network-manager.xml +++ b/nixos/doc/manual/configuration/network-manager.xml @@ -19,7 +19,7 @@ All users that should have permission to change network settings must belong to the networkmanager group: -users.users.alice.extraGroups = [ "networkmanager" ]; +users.users.alice.extraGroups = [ "networkmanager" ]; diff --git a/nixos/doc/manual/configuration/ssh.xml b/nixos/doc/manual/configuration/ssh.xml index a4af1b96583d8..95ad3edff9352 100644 --- a/nixos/doc/manual/configuration/ssh.xml +++ b/nixos/doc/manual/configuration/ssh.xml @@ -20,7 +20,7 @@ follows: -users.users.alice.openssh.authorizedKeys.keys = +users.users.alice.openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3NzaC1kc3MAAACBAPIkGWVEt4..." ]; diff --git a/nixos/doc/manual/configuration/user-mgmt.xml b/nixos/doc/manual/configuration/user-mgmt.xml index 4b1710f3a2b11..68324cc85b547 100644 --- a/nixos/doc/manual/configuration/user-mgmt.xml +++ b/nixos/doc/manual/configuration/user-mgmt.xml @@ -11,11 +11,11 @@ that a user account named alice shall exist: .alice = { - isNormalUser = true; - home = "/home/alice"; - description = "Alice Foobar"; - extraGroups = [ "wheel" "networkmanager" ]; - openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3Nza... alice@foobar" ]; + isNormalUser = true; + home = "/home/alice"; + description = "Alice Foobar"; + extraGroups = [ "wheel" "networkmanager" ]; + openssh.authorizedKeys.keys = [ "ssh-dss AAAAB3Nza... alice@foobar" ]; }; Note that alice is a member of the @@ -36,7 +36,7 @@ account will cease to exist. Also, imperative commands for managing users and groups, such as useradd, are no longer available. Passwords may still be assigned by setting the user's - hashedPassword + hashedPassword option. A hashed password can be generated using mkpasswd -m sha-512 after installing the mkpasswd package. diff --git a/nixos/doc/manual/installation/changing-config.xml b/nixos/doc/manual/installation/changing-config.xml index 48193d986ab7c..4288806d5eb21 100644 --- a/nixos/doc/manual/installation/changing-config.xml +++ b/nixos/doc/manual/installation/changing-config.xml @@ -78,7 +78,7 @@ mutableUsers = false. Another way is to temporarily add the following to your configuration: -users.users.your-user.initialHashedPassword = "test"; +users.users.your-user.initialHashedPassword = "test"; Important: delete the $hostname.qcow2 file if you have started the virtual machine at least once without the right users, otherwise diff --git a/nixos/doc/manual/installation/installing-from-other-distro.xml b/nixos/doc/manual/installation/installing-from-other-distro.xml index 45d68f8787f1b..d2d1245c57ac9 100644 --- a/nixos/doc/manual/installation/installing-from-other-distro.xml +++ b/nixos/doc/manual/installation/installing-from-other-distro.xml @@ -211,7 +211,7 @@ nixpkgs https://nixos.org/channels/nixpkgs-unstable use sudo) -users.users.root.initialHashedPassword = ""; +users.users.root.initialHashedPassword = ""; diff --git a/nixos/doc/manual/installation/installing.xml b/nixos/doc/manual/installation/installing.xml index 5f216df66f84d..c7ed3b3c0c97f 100644 --- a/nixos/doc/manual/installation/installing.xml +++ b/nixos/doc/manual/installation/installing.xml @@ -550,7 +550,7 @@ Retype new UNIX password: *** # Note: setting fileSystems is generally not # necessary, since nixos-generate-config figures them out # automatically in hardware-configuration.nix. - #fileSystems."/".device = "/dev/disk/by-label/nixos"; + #fileSystems."/".device = "/dev/disk/by-label/nixos"; # Enable the OpenSSH server. services.sshd.enable = true; diff --git a/nixos/doc/manual/release-notes/rl-2003.xml b/nixos/doc/manual/release-notes/rl-2003.xml index 0e9ba027a382a..87f1228561949 100644 --- a/nixos/doc/manual/release-notes/rl-2003.xml +++ b/nixos/doc/manual/release-notes/rl-2003.xml @@ -796,7 +796,7 @@ users.users.me = or any other display manager in NixOS as they all support auto-login. If you used this module specifically because it permitted root auto-login you can override the lightdm-autologin pam module like: -security.pam.services.lightdm-autologin.text = lib.mkForce '' +security.pam.services.lightdm-autologin.text = lib.mkForce '' auth requisite pam_nologin.so auth required pam_succeed_if.so quiet auth required pam_permit.so diff --git a/nixos/doc/manual/release-notes/rl-2009.xml b/nixos/doc/manual/release-notes/rl-2009.xml index bf96fb21a4156..3d156e517c8df 100644 --- a/nixos/doc/manual/release-notes/rl-2009.xml +++ b/nixos/doc/manual/release-notes/rl-2009.xml @@ -748,8 +748,6 @@ CREATE ROLE postgres LOGIN SUPERUSER; For NixOS configuration options, the type loaOf, after its initial deprecation in release 20.03, has been removed. In NixOS and Nixpkgs options using this type have been converted to attrsOf. - - For more information on this change have look at these links: issue #1800, PR #63103. diff --git a/nixos/modules/services/networking/prosody.xml b/nixos/modules/services/networking/prosody.xml index 7859cb1578b7e..e3fedf8a67e16 100644 --- a/nixos/modules/services/networking/prosody.xml +++ b/nixos/modules/services/networking/prosody.xml @@ -43,10 +43,10 @@ services.prosody = { ssl.cert = "/var/lib/acme/example.org/fullchain.pem"; ssl.key = "/var/lib/acme/example.org/key.pem"; virtualHosts."example.org" = { - enabled = true; - domain = "example.org"; - ssl.cert = "/var/lib/acme/example.org/fullchain.pem"; - ssl.key = "/var/lib/acme/example.org/key.pem"; + enabled = true; + domain = "example.org"; + ssl.cert = "/var/lib/acme/example.org/fullchain.pem"; + ssl.key = "/var/lib/acme/example.org/key.pem"; }; muc = [ { domain = "conference.example.org"; From 3f8a3246f409513653a9e8739c69371af3e9f7b0 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Tue, 1 Sep 2020 15:12:36 +0200 Subject: [PATCH 3/3] nixos/lib/make-options-doc: remove loaOf subs Remove the substitution for the placeholder used by loaOf, now that the type has been deprecated. --- nixos/lib/make-options-doc/options-to-docbook.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/lib/make-options-doc/options-to-docbook.xsl b/nixos/lib/make-options-doc/options-to-docbook.xsl index 72ac89d4ff62c..18d19fddaca24 100644 --- a/nixos/lib/make-options-doc/options-to-docbook.xsl +++ b/nixos/lib/make-options-doc/options-to-docbook.xsl @@ -20,7 +20,7 @@ Configuration Options - +