···658658659659## `writeReferencesToFile` {#trivial-builder-writeReferencesToFile}
660660661661-Writes the closure of transitive dependencies to a file.
661661+Deprecated. Use [`writeClosure`](#trivial-builder-writeClosure) instead.
662662663663-This produces the equivalent of `nix-store -q --requisites`.
663663+## `writeClosure` {#trivial-builder-writeClosure}
664664+665665+Given a list of [store paths](https://nixos.org/manual/nix/stable/glossary#gloss-store-path) (or string-like expressions coercible to store paths), write their collective [closure](https://nixos.org/manual/nix/stable/glossary#gloss-closure) to a text file.
666666+667667+The result is equivalent to the output of `nix-store -q --requisites`.
664668665669For example,
666670667671```nix
668668-writeReferencesToFile (writeScriptBin "hi" ''${hello}/bin/hello'')
672672+writeClosure [ (writeScriptBin "hi" ''${hello}/bin/hello'') ]
669673```
670674671675produces an output path `/nix/store/<hash>-runtime-deps` containing
+2
nixos/doc/manual/release-notes/rl-2405.section.md
···171171172172- Invidious has changed its default database username from `kemal` to `invidious`. Setups involving an externally provisioned database (i.e. `services.invidious.database.createLocally == false`) should adjust their configuration accordingly. The old `kemal` user will not be removed automatically even when the database is provisioned automatically.(https://github.com/NixOS/nixpkgs/pull/265857)
173173174174+- `writeReferencesToFile` is deprecated in favour of the new trivial build helper `writeClosure`. The latter accepts a list of paths and has an unambiguous name and cleaner implementation.
175175+174176- `inetutils` now has a lower priority to avoid shadowing the commonly used `util-linux`. If one wishes to restore the default priority, simply use `lib.setPrio 5 inetutils` or override with `meta.priority = 5`.
175177176178- `paperless`' `services.paperless.extraConfig` setting has been removed and converted to the freeform type and option named `services.paperless.settings`.
-18
nixos/tests/nixops/default.nix
···93939494 inherit (import ../ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
95959696- /*
9797- Return a store path with a closure containing everything including
9898- derivations and all build dependency outputs, all the way down.
9999- */
100100- allDrvOutputs = pkg:
101101- let name = "allDrvOutputs-${pkg.pname or pkg.name or "unknown"}";
102102- in
103103- pkgs.runCommand name { refs = pkgs.writeReferencesToFile pkg.drvPath; } ''
104104- touch $out
105105- while read ref; do
106106- case $ref in
107107- *.drv)
108108- cat $ref >>$out
109109- ;;
110110- esac
111111- done <$refs
112112- '';
113113-11496in
11597tests
···88# and how deep in the tree they live. Equally-"popular" paths are then
99# sorted by name.
1010#
1111-# The existing writeReferencesToFile prints the paths in a simple
1212-# ascii-based sorting of the paths.
1111+# The existing writeClosure prints the paths in a simple ascii-based
1212+# sorting of the paths.
1313#
1414# Sorting the paths by graph improves the chances that the difference
1515# between two builds appear near the end of the list, instead of near