mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-11-27 06:20:29 +00:00
feat: nix shell
This commit is contained in:
parent
8598bb3361
commit
d0ce0ffafd
2 changed files with 2 additions and 2 deletions
|
@ -232,7 +232,7 @@ Example:
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Then execute `nix run .#dev`, you will enter a nushell session, where you can use the `node` `pnpm` command normally, and the node version is 20.
|
Then execute `nix run .#dev` or `nix shell .#dev --command 'dev-shell'`, you will enter a nushell session, where you can use the `node` `pnpm` command normally, and the node version is 20.
|
||||||
|
|
||||||
The wrapper generated in this way is an executable file, which does not actually depend on the `nix run` or `nix shell` command.
|
The wrapper generated in this way is an executable file, which does not actually depend on the `nix run` or `nix shell` command.
|
||||||
|
|
||||||
|
|
|
@ -234,7 +234,7 @@ stdenv.mkDerivation ({
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
然后执行 `nix run .#dev`,就能进入一个 nushell session,可以在其中正常使用 `node` `pnpm` 命令.
|
然后执行 `nix run .#dev` 或者 `nix shell .#dev --command 'dev-shell'`,就能进入一个 nushell session,可以在其中正常使用 `node` `pnpm` 命令.
|
||||||
|
|
||||||
这种方式生成的 wrapper 是一个可执行文件,它实际不依赖 `nix run` 命令,比如说我们可以直接通过 NixOS 的 `environment.systemPackages` 来安装这个 wrapper,然后直接执行它:
|
这种方式生成的 wrapper 是一个可执行文件,它实际不依赖 `nix run` 命令,比如说我们可以直接通过 NixOS 的 `environment.systemPackages` 来安装这个 wrapper,然后直接执行它:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue