.\" -*- mode: troff; coding: utf-8 -*- .TH "nix3-show-derivation" "1" "" .PP \fBWarning\fR: This program is \fBexperimental\fR and its interface is subject to change. .SH Name \fCnix show-derivation\fR - show the contents of a store derivation .SH Synopsis \fCnix show-derivation\fR [\fIoption\fR\[u2026]] \fIinstallables\fR\[u2026] .SH Examples .IP "\(bu" 2 Show the store derivation that results from evaluating the Hello package: .LP .EX # nix show-derivation nixpkgs#hello { \(dq/nix/store/s6rn4jz1sin56rf4qj5b5v8jxjm32hlk-hello-2.10.drv\(dq: { … } } .EE .IP "\(bu" 2 Show the full derivation graph (if available) that produced your NixOS system: .LP .EX # nix show-derivation -r /run/current-system .EE .IP "\(bu" 2 Print all files fetched using \fCfetchurl\fR by Firefox\[u2019]s dependency graph: .LP .EX # nix show-derivation -r nixpkgs#firefox \e | jq -r '.[] | select(.outputs.out.hash and .env.urls) | .env.urls' \e | uniq | sort .EE .IP Note that \fC.outputs.out.hash\fR selects \fIfixed-output derivations\fR (derivations that produce output with a specified content hash), while \fC.env.urls\fR selects derivations with a \fCurls\fR attribute. .SH Description This command prints on standard output a JSON representation of the store derivations to which \fIinstallables\fR evaluate. Store derivations are used internally by Nix. They are store paths with extension \fC.drv\fR that represent the build-time dependency graph to which a Nix expression evaluates. .PP By default, this command only shows top-level derivations, but with \fC--recursive\fR, it also shows their dependencies. .PP The JSON output is a JSON object whose keys are the store paths of the derivations, and whose values are a JSON object with the following fields: .IP "\(bu" 2 \fCoutputs\fR: Information about the output paths of the derivation. This is a JSON object with one member per output, where the key is the output name and the value is a JSON object with these fields: .RS .IP "\(bu" 2 \fCpath\fR: The output path. .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 2 \fChashAlgo\fR: For fixed-output derivations, the hashing algorithm (e.g. \fCsha256\fR), optionally prefixed by \fCr:\fR if \fChash\fR denotes a NAR hash rather than a flat file hash. .if n \ .sp -1 .if t \ .sp -0.25v .IP "\(bu" 2 \fChash\fR: For fixed-output derivations, the expected content hash in base-16. .RE .IP Example: .LP .EX \(dqoutputs\(dq: { \(dqout\(dq: { \(dqpath\(dq: \(dq/nix/store/2543j7c6jn75blc3drf4g5vhb1rhdq29-source\(dq, \(dqhashAlgo\(dq: \(dqr:sha256\(dq, \(dqhash\(dq: \(dq6fc80dcc62179dbc12fc0b5881275898f93444833d21b89dfe5f7fbcbb1d0d62\(dq } } .EE .IP "\(bu" 2 \fCinputSrcs\fR: A list of store paths on which this derivation depends. .IP "\(bu" 2 \fCinputDrvs\fR: A JSON object specifying the derivations on which this derivation depends, and what outputs of those derivations. For example, .LP .EX \(dqinputDrvs\(dq: { \(dq/nix/store/6lkh5yi7nlb7l6dr8fljlli5zfd9hq58-curl-7.73.0.drv\(dq: [\(dqdev\(dq], \(dq/nix/store/fn3kgnfzl5dzym26j8g907gq3kbm8bfh-unzip-6.0.drv\(dq: [\(dqout\(dq] } .EE .IP specifies that this derivation depends on the \fCdev\fR output of \fCcurl\fR, and the \fCout\fR output of \fCunzip\fR. .IP "\(bu" 2 \fCsystem\fR: The system type on which this derivation is to be built (e.g. \fCx86_64-linux\fR). .IP "\(bu" 2 \fCbuilder\fR: The absolute path of the program to be executed to run the build. Typically this is the \fCbash\fR shell (e.g. \fC/nix/store/r3j288vpmczbl500w6zz89gyfa4nr0b1-bash-4.4-p23/bin/bash\fR). .IP "\(bu" 2 \fCargs\fR: The command-line arguments passed to the \fCbuilder\fR. .IP "\(bu" 2 \fCenv\fR: The environment passed to the \fCbuilder\fR. .SH Options .IP "\(bu" 2 \fC--recursive\fR / \fC-r\fR .br Include the dependencies of the specified derivations. .LP \fBCommon evaluation options:\fR .IP "\(bu" 2 \fC--arg\fR \fIname\fR \fIexpr\fR .br Pass the value \fIexpr\fR as the argument \fIname\fR to Nix functions. .IP "\(bu" 2 \fC--argstr\fR \fIname\fR \fIstring\fR .br Pass the string \fIstring\fR as the argument \fIname\fR to Nix functions. .IP "\(bu" 2 \fC--eval-store\fR \fIstore-url\fR .br The Nix store to use for evaluations. .IP "\(bu" 2 \fC--impure\fR .br Allow access to mutable paths and repositories. .IP "\(bu" 2 \fC--include\fR / \fC-I\fR \fIpath\fR .br Add \fIpath\fR to the list of locations used to look up \fC<...>\fR file names. .IP "\(bu" 2 \fC--override-flake\fR \fIoriginal-ref\fR \fIresolved-ref\fR .br Override the flake registries, redirecting \fIoriginal-ref\fR to \fIresolved-ref\fR. .LP \fBCommon flake-related options:\fR .IP "\(bu" 2 \fC--commit-lock-file\fR .br Commit changes to the flake\[u2019]s lock file. .IP "\(bu" 2 \fC--inputs-from\fR \fIflake-url\fR .br Use the inputs of the specified flake as registry entries. .IP "\(bu" 2 \fC--no-registries\fR .br Don\[u2019]t allow lookups in the flake registries. This option is deprecated; use \fC--no-use-registries\fR. .IP "\(bu" 2 \fC--no-update-lock-file\fR .br Do not allow any updates to the flake\[u2019]s lock file. .IP "\(bu" 2 \fC--no-write-lock-file\fR .br Do not write the flake\[u2019]s newly generated lock file. .IP "\(bu" 2 \fC--override-input\fR \fIinput-path\fR \fIflake-url\fR .br Override a specific flake input (e.g. \fCdwarffs/nixpkgs\fR). This implies \fC--no-write-lock-file\fR. .IP "\(bu" 2 \fC--recreate-lock-file\fR .br Recreate the flake\[u2019]s lock file from scratch. .IP "\(bu" 2 \fC--update-input\fR \fIinput-path\fR .br Update a specific flake input (ignoring its previous entry in the lock file). .LP \fBOptions that change the interpretation of installables:\fR .IP "\(bu" 2 \fC--derivation\fR .br Operate on the store derivation rather than its outputs. .IP "\(bu" 2 \fC--expr\fR \fIexpr\fR .br Interpret installables as attribute paths relative to the Nix expression \fIexpr\fR. .IP "\(bu" 2 \fC--file\fR / \fC-f\fR \fIfile\fR .br Interpret installables as attribute paths relative to the Nix expression stored in \fIfile\fR. If \fIfile\fR is the character -, then a Nix expression will be read from standard input.