Merge staging-next into staging

authored by github-actions[bot] and committed by GitHub dfafc173 b6956b5e

+66 -18
+11 -1
nixos/doc/manual/development/settings-options.xml
··· 50 </varlistentry> 51 <varlistentry> 52 <term> 53 - <varname>pkgs.formats.ini</varname> { <replaceable>listsAsDuplicateKeys</replaceable> ? false, ... } 54 </term> 55 <listitem> 56 <para> ··· 63 <listitem> 64 <para> 65 A boolean for controlling whether list values can be used to represent duplicate INI keys 66 </para> 67 </listitem> 68 </varlistentry>
··· 50 </varlistentry> 51 <varlistentry> 52 <term> 53 + <varname>pkgs.formats.ini</varname> { <replaceable>listsAsDuplicateKeys</replaceable> ? false, <replaceable>listToValue</replaceable> ? null, ... } 54 </term> 55 <listitem> 56 <para> ··· 63 <listitem> 64 <para> 65 A boolean for controlling whether list values can be used to represent duplicate INI keys 66 + </para> 67 + </listitem> 68 + </varlistentry> 69 + <varlistentry> 70 + <term> 71 + <varname>listToValue</varname> 72 + </term> 73 + <listitem> 74 + <para> 75 + A function for turning a list of values into a single value. 76 </para> 77 </listitem> 78 </varlistentry>
+1 -3
nixos/modules/services/computing/slurm/slurm.nix
··· 403 requires = [ "munged.service" "mysql.service" ]; 404 405 preStart = '' 406 - cp ${slurmdbdConf} ${configPath} 407 - chmod 600 ${configPath} 408 - chown ${cfg.user} ${configPath} 409 ${optionalString (cfg.dbdserver.storagePassFile != null) '' 410 echo "StoragePass=$(cat ${cfg.dbdserver.storagePassFile})" \ 411 >> ${configPath}
··· 403 requires = [ "munged.service" "mysql.service" ]; 404 405 preStart = '' 406 + install -m 600 -o ${cfg.user} -T ${slurmdbdConf} ${configPath} 407 ${optionalString (cfg.dbdserver.storagePassFile != null) '' 408 echo "StoragePass=$(cat ${cfg.dbdserver.storagePassFile})" \ 409 >> ${configPath}
+8 -6
nixos/modules/services/networking/searx.nix
··· 4 5 let 6 runDir = "/run/searx"; 7 cfg = config.services.searx; 8 9 generateConfig = '' 10 cd ${runDir} 11 12 # write NixOS settings as JSON 13 - cat <<'EOF' > settings.yml 14 - ${builtins.toJSON cfg.settings} 15 - EOF 16 17 # substitute environment variables 18 env -0 | while IFS='=' read -r -d ''' n v; do 19 sed "s#@$n@#$v#g" -i settings.yml 20 done 21 - 22 - # set strict permissions 23 - chmod 400 settings.yml 24 ''; 25 26 settingType = with types; (oneOf
··· 4 5 let 6 runDir = "/run/searx"; 7 + 8 cfg = config.services.searx; 9 + 10 + settingsFile = pkgs.writeText "settings.yml" 11 + (builtins.toJSON cfg.settings); 12 13 generateConfig = '' 14 cd ${runDir} 15 16 # write NixOS settings as JSON 17 + ( 18 + umask 077 19 + cp --no-preserve=mode ${settingsFile} settings.yml 20 + ) 21 22 # substitute environment variables 23 env -0 | while IFS='=' read -r -d ''' n v; do 24 sed "s#@$n@#$v#g" -i settings.yml 25 done 26 ''; 27 28 settingType = with types; (oneOf
+2 -2
pkgs/applications/misc/metadata-cleaner/default.nix
··· 17 18 python3.pkgs.buildPythonApplication rec { 19 pname = "metadata-cleaner"; 20 - version = "1.0.5"; 21 22 format = "other"; 23 ··· 25 owner = "rmnvgr"; 26 repo = "metadata-cleaner"; 27 rev = "v${version}"; 28 - sha256 = "sha256-9s9i703Svql1Nn1M1sFp3FOtLGjuxXi6YR6nsUJCkeg="; 29 }; 30 31 nativeBuildInputs = [
··· 17 18 python3.pkgs.buildPythonApplication rec { 19 pname = "metadata-cleaner"; 20 + version = "1.0.6"; 21 22 format = "other"; 23 ··· 25 owner = "rmnvgr"; 26 repo = "metadata-cleaner"; 27 rev = "v${version}"; 28 + sha256 = "0k9qnycaqxnmsjsyxqgip6xr5w9affzxjc4zyb38ajbq4arfq5wv"; 29 }; 30 31 nativeBuildInputs = [
+24 -2
pkgs/pkgs-lib/formats.nix
··· 56 }; 57 }; 58 59 - ini = { listsAsDuplicateKeys ? false, ... }@args: { 60 61 type = with lib.types; let 62 ··· 74 coercedTo singleIniAtom lib.singleton (listOf singleIniAtom) // { 75 description = singleIniAtom.description + " or a list of them for duplicate keys"; 76 } 77 else 78 singleIniAtom; 79 80 in attrsOf (attrsOf iniAtom); 81 82 - generate = name: value: pkgs.writeText name (lib.generators.toINI args value); 83 84 }; 85
··· 56 }; 57 }; 58 59 + ini = { 60 + # Represents lists as duplicate keys 61 + listsAsDuplicateKeys ? false, 62 + # Alternative to listsAsDuplicateKeys, converts list to non-list 63 + # listToValue :: [IniAtom] -> IniAtom 64 + listToValue ? null, 65 + ... 66 + }@args: 67 + assert !listsAsDuplicateKeys || listToValue == null; 68 + { 69 70 type = with lib.types; let 71 ··· 83 coercedTo singleIniAtom lib.singleton (listOf singleIniAtom) // { 84 description = singleIniAtom.description + " or a list of them for duplicate keys"; 85 } 86 + else if listToValue != null then 87 + coercedTo singleIniAtom lib.singleton (nonEmptyListOf singleIniAtom) // { 88 + description = singleIniAtom.description + " or a non-empty list of them"; 89 + } 90 else 91 singleIniAtom; 92 93 in attrsOf (attrsOf iniAtom); 94 95 + generate = name: value: 96 + let 97 + transformedValue = 98 + if listToValue != null 99 + then 100 + lib.mapAttrs (section: lib.mapAttrs (key: val: 101 + if lib.isList val then listToValue val else val 102 + )) value 103 + else value; 104 + in pkgs.writeText name (lib.generators.toINI (removeAttrs args ["listToValue"]) transformedValue); 105 106 }; 107
+16
pkgs/pkgs-lib/tests/formats.nix
··· 124 ''; 125 }; 126 127 testTomlAtoms = { 128 drv = evalFormat formats.toml {} { 129 false = false;
··· 124 ''; 125 }; 126 127 + testIniListToValue = { 128 + drv = evalFormat formats.ini { listToValue = concatMapStringsSep ", " (generators.mkValueStringDefault {}); } { 129 + foo = { 130 + bar = [ null true "test" 1.2 10 ]; 131 + baz = false; 132 + qux = "qux"; 133 + }; 134 + }; 135 + expected = '' 136 + [foo] 137 + bar=null, true, test, 1.200000, 10 138 + baz=false 139 + qux=qux 140 + ''; 141 + }; 142 + 143 testTomlAtoms = { 144 drv = evalFormat formats.toml {} { 145 false = false;
+2 -2
pkgs/servers/computing/slurm/default.nix
··· 9 10 stdenv.mkDerivation rec { 11 pname = "slurm"; 12 - version = "20.11.5.1"; 13 14 # N.B. We use github release tags instead of https://www.schedmd.com/downloads.php 15 # because the latter does not keep older releases. ··· 18 repo = "slurm"; 19 # The release tags use - instead of . 20 rev = "${pname}-${builtins.replaceStrings ["."] ["-"] version}"; 21 - sha256 = "1anzjv9sdl1a3j6sxsy2q8dy4dax1a4yqc9rnprlzymjkgb8hy75"; 22 }; 23 24 outputs = [ "out" "dev" ];
··· 9 10 stdenv.mkDerivation rec { 11 pname = "slurm"; 12 + version = "20.11.6.1"; 13 14 # N.B. We use github release tags instead of https://www.schedmd.com/downloads.php 15 # because the latter does not keep older releases. ··· 18 repo = "slurm"; 19 # The release tags use - instead of . 20 rev = "${pname}-${builtins.replaceStrings ["."] ["-"] version}"; 21 + sha256 = "1c2dqqddw5bfb27smq7rqa7v1wymdj155ky50rbyvl36pmhc9djp"; 22 }; 23 24 outputs = [ "out" "dev" ];
+2 -2
pkgs/tools/system/bpytop/default.nix
··· 7 8 stdenv.mkDerivation rec { 9 pname = "bpytop"; 10 - version = "1.0.64"; 11 12 src = fetchFromGitHub { 13 owner = "aristocratos"; 14 repo = pname; 15 rev = "v${version}"; 16 - sha256 = "sha256-BwpMBPTWSrfmz7SHYa1+SZ79V2YZdIkZcOTLtlVlgr8="; 17 }; 18 19 nativeBuildInputs = [ makeWrapper ];
··· 7 8 stdenv.mkDerivation rec { 9 pname = "bpytop"; 10 + version = "1.0.65"; 11 12 src = fetchFromGitHub { 13 owner = "aristocratos"; 14 repo = pname; 15 rev = "v${version}"; 16 + sha256 = "sha256-sWANeoUbvnrTksqfeIRU4a5XeX7QVzT9+ZT3R5Utp+4="; 17 }; 18 19 nativeBuildInputs = [ makeWrapper ];