Skip to content

Commit 9cf6930

Browse files
authored
closureInfo: write a doc comment (#391079)
2 parents 62ee197 + 8215ed0 commit 9cf6930

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

pkgs/build-support/closure-info.nix

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
1-
# This derivation builds two files containing information about the
2-
# closure of 'rootPaths': $out/store-paths contains the paths in the
3-
# closure, and $out/registration contains a file suitable for use with
4-
# "nix-store --load-db" and "nix-store --register-validity
5-
# --hash-given".
6-
71
{
82
stdenvNoCC,
93
coreutils,
104
jq,
115
}:
126

7+
/**
8+
Produces metadata about the closure of the given root paths.
9+
10+
1. Total NAR size in `$out/total-nar-size`.
11+
2. Registration, suitable for `nix-store --load-db`, in `$out/registration`.
12+
Can also be used with `nix-store --register-validity --hash-given`.
13+
3. All store paths for the closure in `$out/store-paths`.
14+
15+
# Inputs
16+
17+
`rootPaths` ([Path])
18+
19+
: List of root paths to include in the closure information.
20+
21+
# Type
22+
23+
```
24+
closureInfo :: { rootPaths :: [Path]; } -> Derivation
25+
```
26+
27+
# Examples
28+
:::{.example}
29+
## `pkgs.closureInfo` usage example
30+
```
31+
pkgs.closureInfo {
32+
rootPaths = [ pkgs.hello pkgs.bc pkgs.dwarf2json ];
33+
}
34+
=>
35+
«derivation /nix/store/...-closure-info.drv»
36+
```
37+
38+
:::
39+
*/
1340
{ rootPaths }:
1441

1542
assert builtins.langVersion >= 5;

0 commit comments

Comments
 (0)