2020-12-10 20:14:18 +02:00
|
|
|
R""(
|
|
|
|
|
|
|
|
# Examples
|
|
|
|
|
2022-12-20 16:37:40 +02:00
|
|
|
* Show the [store derivation] that results from evaluating the Hello
|
2020-12-10 20:14:18 +02:00
|
|
|
package:
|
|
|
|
|
|
|
|
```console
|
2023-04-02 20:59:19 +03:00
|
|
|
# nix derivation show nixpkgs#hello
|
2020-12-10 20:14:18 +02:00
|
|
|
{
|
|
|
|
"/nix/store/s6rn4jz1sin56rf4qj5b5v8jxjm32hlk-hello-2.10.drv": {
|
|
|
|
…
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
* Show the full derivation graph (if available) that produced your
|
|
|
|
NixOS system:
|
|
|
|
|
|
|
|
```console
|
2023-04-02 20:59:19 +03:00
|
|
|
# nix derivation show -r /run/current-system
|
2020-12-10 20:14:18 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
* Print all files fetched using `fetchurl` by Firefox's dependency
|
|
|
|
graph:
|
|
|
|
|
|
|
|
```console
|
2023-04-02 20:59:19 +03:00
|
|
|
# nix derivation show -r nixpkgs#firefox \
|
2020-12-10 20:14:18 +02:00
|
|
|
| jq -r '.[] | select(.outputs.out.hash and .env.urls) | .env.urls' \
|
|
|
|
| uniq | sort
|
|
|
|
```
|
|
|
|
|
|
|
|
Note that `.outputs.out.hash` selects *fixed-output derivations*
|
|
|
|
(derivations that produce output with a specified content hash),
|
|
|
|
while `.env.urls` selects derivations with a `urls` attribute.
|
|
|
|
|
|
|
|
# Description
|
|
|
|
|
|
|
|
This command prints on standard output a JSON representation of the
|
2023-02-18 01:37:35 +02:00
|
|
|
[store derivation]s to which [*installables*](./nix.md#installables) evaluate.
|
|
|
|
|
|
|
|
Store derivations are used internally by Nix. They are store paths with
|
|
|
|
extension `.drv` that represent the build-time dependency graph to which
|
|
|
|
a Nix expression evaluates.
|
2020-12-10 20:14:18 +02:00
|
|
|
|
|
|
|
By default, this command only shows top-level derivations, but with
|
|
|
|
`--recursive`, it also shows their dependencies.
|
|
|
|
|
2023-10-23 03:01:01 +03:00
|
|
|
[store derivation]: @docroot@/glossary.md#gloss-store-derivation
|
2020-12-10 20:14:18 +02:00
|
|
|
|
2023-10-23 03:01:01 +03:00
|
|
|
`nix derivation show` outputs a JSON map of [store path]s to derivations in the following format:
|
2020-12-10 20:14:18 +02:00
|
|
|
|
2023-10-23 03:01:01 +03:00
|
|
|
[store path]: @docroot@/glossary.md#gloss-store-path
|
2020-12-10 20:14:18 +02:00
|
|
|
|
2024-02-08 10:08:58 +02:00
|
|
|
{{#include ../../protocols/json/derivation.md}}
|
2020-12-10 20:14:18 +02:00
|
|
|
|
|
|
|
)""
|