This commit is contained in:
7
main.typ
7
main.typ
@@ -150,7 +150,7 @@ Nix 的优势:将 *编译/配置过程* 抽象成 *可复现、可版本管理
|
|||||||
- 使用可读写的 store 目录。编译机上建立相同的目录,编译好再上传。
|
- 使用可读写的 store 目录。编译机上建立相同的目录,编译好再上传。
|
||||||
- 不能设置 `real` 参数指向 `/nix/store`,否则会破坏编译机的 Nix 数据库。
|
- 不能设置 `real` 参数指向 `/nix/store`,否则会破坏编译机的 Nix 数据库。
|
||||||
|
|
||||||
```
|
```sh
|
||||||
# this will break the build machine's nix database
|
# this will break the build machine's nix database
|
||||||
sudo nix build --store 'local?store=/data/gpfs01/jykang/.nix/store&real=/nix/store' .#jykang
|
sudo nix build --store 'local?store=/data/gpfs01/jykang/.nix/store&real=/nix/store' .#jykang
|
||||||
# this is safe
|
# this is safe
|
||||||
@@ -183,9 +183,10 @@ sudo nix build --store 'local?store=/data/gpfs01/jykang/.nix/store&state=/data/g
|
|||||||
|
|
||||||
=== 一个例子(曾经的 NVIDIA HPC SDK 打包)
|
=== 一个例子(曾经的 NVIDIA HPC SDK 打包)
|
||||||
|
|
||||||
```
|
```nix
|
||||||
let
|
let
|
||||||
builder = buildFHSEnv { targetPkgs = _: []; extraBwrapArgs = [ "--bind" "$out" "$out" ]; };
|
builder = buildFHSEnv
|
||||||
|
{ extraBwrapArgs = [ "--bind" "$out" "$out" ]; };
|
||||||
buildScript = writeShellScript "build.sh" ''xxxxx'';
|
buildScript = writeShellScript "build.sh" ''xxxxx'';
|
||||||
in stdenvNoCC.mkDerivation
|
in stdenvNoCC.mkDerivation
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user