diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-09-30 22:36:50 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-09-30 22:41:53 +0000 |
commit | f4f3203aa7c2fc9225a8ae220db25593066fb397 (patch) | |
tree | 9063673af148e34069dd894a2fd6a2981b13ff26 /src/nix/print-dev-env.md | |
parent | 1b6cf0d5f56e166a1cbbf38142375b7a92fc88f2 (diff) | |
parent | 6a8d6246f603a372d557ab026670ae42bad558b0 (diff) |
Merge remote-tracking branch 'upstream/master' into path-info
Diffstat (limited to 'src/nix/print-dev-env.md')
-rw-r--r-- | src/nix/print-dev-env.md | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/src/nix/print-dev-env.md b/src/nix/print-dev-env.md index b80252acf..2aad491de 100644 --- a/src/nix/print-dev-env.md +++ b/src/nix/print-dev-env.md @@ -8,12 +8,43 @@ R""( # . <(nix print-dev-env nixpkgs#hello) ``` +* Get the build environment in JSON format: + + ```console + # nix print-dev-env nixpkgs#hello --json + ``` + + The output will look like this: + + ```json + { + "bashFunctions": { + "buildPhase": " \n runHook preBuild;\n...", + ... + }, + "variables": { + "src": { + "type": "exported", + "value": "/nix/store/3x7dwzq014bblazs7kq20p9hyzz0qh8g-hello-2.10.tar.gz" + }, + "postUnpackHooks": { + "type": "array", + "value": ["_updateSourceDateEpochFromSourceRoot"] + }, + ... + } + } + ``` + # Description -This command prints a shell script that can be sourced by `b`ash and -that sets the environment variables and shell functions defined by the -build process of *installable*. This allows you to get a similar build +This command prints a shell script that can be sourced by `bash` and +that sets the variables and shell functions defined by the build +process of *installable*. This allows you to get a similar build environment in your current shell rather than in a subshell (as with `nix develop`). +With `--json`, the output is a JSON serialisation of the variables and +functions defined by the build process. + )"" |