diff options
author | Jasper Ras <jras@hostnet.nl> | 2025-04-28 11:53:26 +0200 |
---|---|---|
committer | Jasper Ras <jras@hostnet.nl> | 2025-04-28 11:53:26 +0200 |
commit | f43d0473320b9b2297b1a00880316aee9066b81a (patch) | |
tree | ce84a3a3db59098948329ab484be5a17e7bb8d77 | |
parent | 691d635de907755566a290c889206b93a590bc42 (diff) |
vault backup: 2025-04-28 11:53:26
-rw-r--r-- | Nix derivations.md | 2 | ||||
-rw-r--r-- | Nix stdenv.md | 51 |
2 files changed, 52 insertions, 1 deletions
diff --git a/Nix derivations.md b/Nix derivations.md index 9bd25a9..e62d44d 100644 --- a/Nix derivations.md +++ b/Nix derivations.md @@ -2,4 +2,4 @@ tags: - nix --- -Are sort of recipes for how to build a program.
\ No newline at end of file +Are sort of recipes for how to build a program. Best use [[Nix stdenv]] mkDerivations
\ No newline at end of file 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 |