summaryrefslogtreecommitdiff
path: root/Nix stdenv.md
diff options
context:
space:
mode:
Diffstat (limited to 'Nix stdenv.md')
-rw-r--r--Nix stdenv.md51
1 files changed, 51 insertions, 0 deletions
diff --git a/Nix stdenv.md b/Nix stdenv.md
new file mode 100644
index 0000000..69ef515
--- /dev/null
+++ b/Nix stdenv.md
@@ -0,0 +1,51 @@
+---
+tags:
+ - nix
+---
+Is itself a derivation containing a file `setup`. It is basically a builder.
+
+Exposed by nixpkgs so we can call it from nix:
+https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/make-derivation.nix
+
+Runs in phases:
+- unpackPhase
+- configurePhase
+- buildPhase
+- checkPhase
+- installPhase
+- fixupPhase
+
+```console
+nix-build '<nixpkgs>' -A stdenv
+/nix/store/k4jklkcag4zq4xkqhkpy156mgfm34ipn-stdenv
+```
+
+```console
+ls -R result/
+result/:
+nix-support/ setup
+
+result/nix-support:
+propagated-user-env-packages
+```
+
+```console
+nix-store -q --references result
+/nix/store/3a45nb37s0ndljp68228snsqr3qsyp96-bzip2-1.0.6
+/nix/store/a457ywa1haa0sgr9g7a1pgldrg3s798d-coreutils-8.24
+/nix/store/zmd4jk4db5lgxb8l93mhkvr3x92g2sx2-bash-4.3-p39
+/nix/store/47sfpm2qclpqvrzijizimk4md1739b1b-gcc-wrapper-4.9.3
+...
+```
+
+```console
+head result/setup
+export SHELL=/nix/store/zmd4jk4db5lgxb8l93mhkvr3x92g2sx2-bash-4.3-p39/bin/bash
+initialPath="/nix/store/a457ywa1haa0sgr9g7a1pgldrg3s798d-coreutils-8.24 ..."
+defaultNativeBuildInputs="/nix/store/sgwq15xg00xnm435gjicspm048rqg9y6-patchelf-0.8 ..."
+```
+
+
+---
+https://nixos.org/guides/nix-pills/19-fundamentals-of-stdenv.html
+https://nixos.org/manual/nixpkgs/stable/#chap-stdenv \ No newline at end of file