···306306 /* Splits the elements of a list in two lists, `right` and
307307 `wrong`, depending on the evaluation of a predicate.
308308309309- Type: (a -> bool) -> [a] -> { right :: [a], wrong :: [a] }
309309+ Type: (a -> bool) -> [a] -> { right :: [a]; wrong :: [a]; }
310310311311 Example:
312312 partition (x: x > 2) [ 5 1 2 3 4 ]
···374374 /* Merges two lists of the same size together. If the sizes aren't the same
375375 the merging stops at the shortest.
376376377377- Type: zipLists :: [a] -> [b] -> [{ fst :: a, snd :: b}]
377377+ Type: zipLists :: [a] -> [b] -> [{ fst :: a; snd :: b; }]
378378379379 Example:
380380 zipLists [ 1 2 ] [ "a" "b" ]
+3-3
lib/options.nix
···114114115115 You can omit the default path if the name of the option is also attribute path in nixpkgs.
116116117117- Type: mkPackageOption :: pkgs -> string -> { default :: [string], example :: null | string | [string] } -> option
117117+ Type: mkPackageOption :: pkgs -> string -> { default :: [string]; example :: null | string | [string]; } -> option
118118119119 Example:
120120 mkPackageOption pkgs "hello" { }
···201201202202 /* Extracts values of all "value" keys of the given list.
203203204204- Type: getValues :: [ { value :: a } ] -> [a]
204204+ Type: getValues :: [ { value :: a; } ] -> [a]
205205206206 Example:
207207 getValues [ { value = 1; } { value = 2; } ] // => [ 1 2 ]
···211211212212 /* Extracts values of all "file" keys of the given list
213213214214- Type: getFiles :: [ { file :: a } ] -> [a]
214214+ Type: getFiles :: [ { file :: a; } ] -> [a]
215215216216 Example:
217217 getFiles [ { file = "file1"; } { file = "file2"; } ] // => [ "file1" "file2" ]
+11
lib/strings.nix
···128128 # List of input strings
129129 list: concatStringsSep sep (lib.imap1 f list);
130130131131+ /* Concatenate a list of strings, adding a newline at the end of each one.
132132+ Defined as `concatMapStrings (s: s + "\n")`.
133133+134134+ Type: concatLines :: [string] -> string
135135+136136+ Example:
137137+ concatLines [ "foo" "bar" ]
138138+ => "foo\nbar\n"
139139+ */
140140+ concatLines = concatMapStrings (s: s + "\n");
141141+131142 /* Construct a Unix-style, colon-separated search path consisting of
132143 the given `subDir` appended to each of the given paths.
133144
···211211 </listitem>
212212 <listitem>
213213 <para>
214214+ The <literal>services.kubo.settings</literal> option is now no
215215+ longer stateful. If you changed any of the options in
216216+ <literal>services.kubo.settings</literal> in the past and then
217217+ removed them from your NixOS configuration again, those
218218+ changes are still in your Kubo configuration file but will now
219219+ be reset to the default. If you’re unsure, you may want to
220220+ make a backup of your configuration file (probably
221221+ /var/lib/ipfs/config) and compare after the update.
222222+ </para>
223223+ </listitem>
224224+ <listitem>
225225+ <para>
214226 The EC2 image module no longer fetches instance metadata in
215227 stage-1. This results in a significantly smaller initramfs,
216228 since network drivers no longer need to be included, and
···696708 about compression in Brotli format
697709 <link xlink:href="https://github.com/google/ngx_brotli/blob/master/README.md">here</link>.
698710 </para>
711711+ </listitem>
712712+ <listitem>
713713+ <para>
714714+ Updated recommended settings in
715715+ <literal>services.nginx.recommendedGzipSettings</literal>:
716716+ </para>
717717+ <itemizedlist spacing="compact">
718718+ <listitem>
719719+ <para>
720720+ Enables gzip compression for only certain proxied
721721+ requests.
722722+ </para>
723723+ </listitem>
724724+ <listitem>
725725+ <para>
726726+ Allow checking and loading of precompressed files.
727727+ </para>
728728+ </listitem>
729729+ <listitem>
730730+ <para>
731731+ Updated gzip mime-types.
732732+ </para>
733733+ </listitem>
734734+ <listitem>
735735+ <para>
736736+ Increased the minimum length of a response that will be
737737+ gzipped.
738738+ </para>
739739+ </listitem>
740740+ </itemizedlist>
699741 </listitem>
700742 <listitem>
701743 <para>
+8
nixos/doc/manual/release-notes/rl-2305.section.md
···60606161- `git-bug` has been updated to at least version 0.8.0, which includes backwards incompatible changes. The `git-bug-migration` package can be used to upgrade existing repositories.
62626363+- The `services.kubo.settings` option is now no longer stateful. If you changed any of the options in `services.kubo.settings` in the past and then removed them from your NixOS configuration again, those changes are still in your Kubo configuration file but will now be reset to the default. If you're unsure, you may want to make a backup of your configuration file (probably /var/lib/ipfs/config) and compare after the update.
6464+6365- The EC2 image module no longer fetches instance metadata in stage-1. This results in a significantly smaller initramfs, since network drivers no longer need to be included, and faster boots, since metadata fetching can happen in parallel with startup of other services.
6466 This breaks services which rely on metadata being present by the time stage-2 is entered. Anything which reads EC2 metadata from `/etc/ec2-metadata` should now have an `after` dependency on `fetch-ec2-metadata.service`
6567···178180- Enabling global redirect in `services.nginx.virtualHosts` now allows one to add exceptions with the `locations` option.
179181180182- A new option `recommendedBrotliSettings` has been added to `services.nginx`. Learn more about compression in Brotli format [here](https://github.com/google/ngx_brotli/blob/master/README.md).
183183+184184+- Updated recommended settings in `services.nginx.recommendedGzipSettings`:
185185+ - Enables gzip compression for only certain proxied requests.
186186+ - Allow checking and loading of precompressed files.
187187+ - Updated gzip mime-types.
188188+ - Increased the minimum length of a response that will be gzipped.
181189182190- [Garage](https://garagehq.deuxfleurs.fr/) version is based on [system.stateVersion](options.html#opt-system.stateVersion), existing installations will keep using version 0.7. New installations will use version 0.8. In order to upgrade a Garage cluster, please follow [upstream instructions](https://garagehq.deuxfleurs.fr/documentation/cookbook/upgrading/) and force [services.garage.package](options.html#opt-services.garage.package) or upgrade accordingly [system.stateVersion](options.html#opt-system.stateVersion).
183191
+19-2
nixos/modules/services/misc/paperless.nix
···226226227227 # Auto-migrate on first run or if the package has changed
228228 versionFile="${cfg.dataDir}/src-version"
229229- if [[ $(cat "$versionFile" 2>/dev/null) != ${pkg} ]]; then
229229+ version=$(cat "$versionFile" 2>/dev/null || echo 0)
230230+231231+ if [[ $version != ${pkg.version} ]]; then
230232 ${pkg}/bin/paperless-ngx migrate
231231- echo ${pkg} > "$versionFile"
233233+234234+ # Parse old version string format for backwards compatibility
235235+ version=$(echo "$version" | grep -ohP '[^-]+$')
236236+237237+ versionLessThan() {
238238+ target=$1
239239+ [[ $({ echo "$version"; echo "$target"; } | sort -V | head -1) != "$target" ]]
240240+ }
241241+242242+ if versionLessThan 1.12.0; then
243243+ # Reindex documents as mentioned in https://github.com/paperless-ngx/paperless-ngx/releases/tag/v1.12.1
244244+ echo "Reindexing documents, to allow searching old comments. Required after the 1.12.x upgrade."
245245+ ${pkg}/bin/paperless-ngx document_index reindex
246246+ fi
247247+248248+ echo ${pkg.version} > "$versionFile"
232249 fi
233250 ''
234251 + optionalString (cfg.passwordFile != null) ''
···5566 settingsFormat = pkgs.formats.json {};
7788+ rawDefaultConfig = lib.importJSON (pkgs.runCommand "kubo-default-config" {
99+ nativeBuildInputs = [ cfg.package ];
1010+ } ''
1111+ export IPFS_PATH="$TMPDIR"
1212+ ipfs init --empty-repo --profile=${profile}
1313+ ipfs --offline config show > "$out"
1414+ '');
1515+1616+ # Remove the PeerID (an attribute of "Identity") of the temporary Kubo repo.
1717+ # The "Pinning" section contains the "RemoteServices" section, which would prevent
1818+ # the daemon from starting as that setting can't be changed via ipfs config replace.
1919+ defaultConfig = builtins.removeAttrs rawDefaultConfig [ "Identity" "Pinning" ];
2020+2121+ customizedConfig = lib.recursiveUpdate defaultConfig cfg.settings;
2222+2323+ configFile = settingsFormat.generate "kubo-config.json" customizedConfig;
2424+825 kuboFlags = utils.escapeSystemdExecArgs (
926 optional cfg.autoMount "--mount" ++
1027 optional cfg.enableGC "--enable-gc" ++
···161178 };
162179 };
163180 description = lib.mdDoc ''
164164- Attrset of daemon configuration to set using {command}`ipfs config`, every time the daemon starts.
181181+ Attrset of daemon configuration.
165182 See [https://github.com/ipfs/kubo/blob/master/docs/config.md](https://github.com/ipfs/kubo/blob/master/docs/config.md) for reference.
166166- Keep in mind that this configuration is stateful; i.e., unsetting anything in here does not reset the value to the default!
183183+ You can't set `Identity` or `Pinning`.
167184 '';
168185 default = { };
169186 example = {
···211228 ###### implementation
212229213230 config = mkIf cfg.enable {
231231+ assertions = [
232232+ {
233233+ assertion = !builtins.hasAttr "Identity" cfg.settings;
234234+ message = ''
235235+ You can't set services.kubo.settings.Identity because the ``config replace`` subcommand used at startup does not support modifying any of the Identity settings.
236236+ '';
237237+ }
238238+ {
239239+ assertion = !((builtins.hasAttr "Pinning" cfg.settings) && (builtins.hasAttr "RemoteServices" cfg.settings.Pinning));
240240+ message = ''
241241+ You can't set services.kubo.settings.Pinning.RemoteServices because the ``config replace`` subcommand used at startup does not work with it.
242242+ '';
243243+ }
244244+ ];
245245+214246 environment.systemPackages = [ cfg.package ];
215247 environment.variables.IPFS_PATH = cfg.dataDir;
216248···262294263295 preStart = ''
264296 if [[ ! -f "$IPFS_PATH/config" ]]; then
265265- ipfs init ${optionalString cfg.emptyRepo "-e"} --profile=${profile}
297297+ ipfs init ${optionalString cfg.emptyRepo "-e"}
266298 else
267299 # After an unclean shutdown this file may exist which will cause the config command to attempt to talk to the daemon. This will hang forever if systemd is holding our sockets open.
268300 rm -vf "$IPFS_PATH/api"
269301 '' + optionalString cfg.autoMigrate ''
270302 ${pkgs.kubo-migrator}/bin/fs-repo-migrations -to '${cfg.package.repoVersion}' -y
271303 '' + ''
272272- ipfs --offline config profile apply ${profile} >/dev/null
273304 fi
274274- '' + ''
275275- ipfs --offline config show \
276276- | ${pkgs.jq}/bin/jq '. * $settings' --argjson settings ${
277277- escapeShellArg (builtins.toJSON cfg.settings)
278278- } \
279279- | ipfs --offline config replace -
305305+ ipfs --offline config show |
306306+ ${pkgs.jq}/bin/jq -s '.[0].Pinning as $Pinning | .[0].Identity as $Identity | .[1] + {$Identity,$Pinning}' - '${configFile}' |
307307+308308+ # This command automatically injects the private key and other secrets from
309309+ # the old config file back into the new config file.
310310+ # Unfortunately, it doesn't keep the original `Identity.PeerID`,
311311+ # so we need `ipfs config show` and jq above.
312312+ # See https://github.com/ipfs/kubo/issues/8993 for progress on fixing this problem.
313313+ # Kubo also wants a specific version of the original "Pinning.RemoteServices"
314314+ # section (redacted by `ipfs config show`), such that that section doesn't
315315+ # change when the changes are applied. Whyyyyyy.....
316316+ ipfs --offline config replace -
280317 '';
281318 serviceConfig = {
282319 ExecStart = [ "" "${cfg.package}/bin/ipfs daemon ${kuboFlags}" ];
···258258 host_toolchain = "//build/toolchain/linux/unbundle:default";
259259 # Don't build against a sysroot image downloaded from Cloud Storage:
260260 use_sysroot = false;
261261- # The default value is hardcoded instead of using pkg-config:
262262- system_wayland_scanner_path = "${wayland.bin}/bin/wayland-scanner";
263261 # Because we use a different toolchain / compiler version:
264262 treat_warnings_as_errors = false;
265263 # We aren't compiling with Chrome's Clang (would enable Chrome-specific
···293291 chrome_pgo_phase = 0;
294292 clang_base_path = "${llvmPackages.clang}";
295293 use_qt = false;
294294+ } // lib.optionalAttrs (!chromiumVersionAtLeast "110") {
296295 # The default has changed to false. We'll build with libwayland from
297296 # Nixpkgs for now but might want to eventually use the bundled libwayland
298297 # as well to avoid incompatibilities (if this continues to be a problem
299298 # from time to time):
300299 use_system_libwayland = true;
300300+ # The default value is hardcoded instead of using pkg-config:
301301+ system_wayland_scanner_path = "${wayland.bin}/bin/wayland-scanner";
301302 } // lib.optionalAttrs proprietaryCodecs {
302303 # enable support for the H.264 codec
303304 proprietary_codecs = true;