1 working derivation 为了让derivation两个阶段成功运行,除了必要的三个元素,还需要out path存在 为了构建out path,使用bash脚本来进行
1 generic builder 前面我们构建了两个简单的derivation。每个derivation含有两个部分: 描述构建过程,作为builder的参数的build
1 automatic runtime 分析构建时依赖和运行时依赖 build dependency nix-instantiate hellov2.nix /nix/store/3g7ccvlxrpmb2s9m4vkasz8y6444fwsc-hello.drv nix-store -q --references /nix/store/3g7ccvlxrpmb2s9m4vkasz8y6444fwsc-hello.drv /nix/store/3077wznnjrbd318k17j7fjsgxy9xgrcl-gnutar-1.35.drv /nix/store/3mdqlcjhflm8mdm2192bap27g8zv60sq-generic-builder.sh /nix/store/982f8csn028v499k0fkrl66x28cbj3b8-bash-5.2-p15.drv /nix/store/dxsdysn7gpyjajiqjvab03bilarjjn15-coreutils-9.3.drv /nix/store/f7glbcn7n59k22b911bx1vyy13g4bdxh-binutils-2.40.drv /nix/store/fimilhby9fyqbfwmw826id3hwfhya6qx-hello-2.12.1.tar.gz /nix/store/fis965lcaxlhxsibjqr7g99l074niraj-gnumake-4.4.1.drv /nix/store/jhkn3namnqqkl7hmxmcml0ffir0dv774-gnugrep-3.11.drv /nix/store/n20wzc7mdmdq91vq5b6gklsz1171k82r-gnused-4.9.drv /nix/store/w1nk39ahhnzkj9yqa5vpggxgff11056g-gawk-5.2.2.drv /nix/store/w3f8imf2csiwc7jfinmgf682rvhg7fna-gcc-wrapper-12.3.0.drv /nix/store/zq7wlgpchcp0857swj8jv5hdwk0pzlg7-gzip-1.12.drv runtime dependency derivation的运行时依赖是由Nix自动识别的 把deri
1 developing(debug) with nix-shell 当我们运行nix-shell hellov2.nix时,与nix-build的区别是其只会进入bash环境,并把derivation 中
1 garbage collector Nix有着比dpkg,rpm等更细粒度,更精确的垃圾回收 gc root是/nix/store下的文件或目录 Nix用了类似编程语言自动GC的
1 input design pattern 我们已经写了一个setup.sh来方便nix-shell处于一个和nix-build类似的隔离环境,并有分步构建,手动调试的能力,并
1 callPackage pattern 在前面的一节中,我们为了用户灵活度和与仓库文件解耦合,用了input design(将包构建写作函数) 并为了方便包的调用,集中管理,我们