diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-05-14 17:27:25 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-05-15 17:04:25 +0200 |
commit | cc60f81e69154789ad3e23f0ec60110ed3f7aece (patch) | |
tree | 7c70d66ed73617ef073aeebd8f4ffb49620f81a5 /doc/builders | |
parent | 80a3e0dc0ef11ecd7c6171318d2e3f2f5390b6ac (diff) |
writeDirectReferencesToFile: init
Diffstat (limited to 'doc/builders')
-rw-r--r-- | doc/builders/trivial-builders.chapter.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/builders/trivial-builders.chapter.md b/doc/builders/trivial-builders.chapter.md index 32944567c053a..432183eaf0f6f 100644 --- a/doc/builders/trivial-builders.chapter.md +++ b/doc/builders/trivial-builders.chapter.md @@ -50,3 +50,24 @@ Many more commands wrap `writeTextFile` including `writeText`, `writeTextDir`, ` ## `symlinkJoin` {#trivial-builder-symlinkJoin} This can be used to put many derivations into the same directory structure. It works by creating a new derivation and adding symlinks to each of the paths listed. It expects two arguments, `name`, and `paths`. `name` is the name used in the Nix store path for the created derivation. `paths` is a list of paths that will be symlinked. These paths can be to Nix store derivations or any other subdirectory contained within. + +## `writeDirectReferencesToFile` {#trivial-builder-writeDirectReferencesToFile} + +Writes the set of references to the output file, that is, their immediate dependencies. + +This produces the equivalent of `nix-store -q --references`. + +For example, + +```nix +writeDirectReferencesToFile (writeScriptBin "hi" ''${hello}/bin/hello'') +``` + +produces an output path `/nix/store/<hash>-runtime-references` containing + +```nix +/nix/store/<hash>-hello-2.10 +``` + +but none of `hello`'s dependencies, because those are not referenced directly +by `hi`'s output. |