mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-11-27 06:20:29 +00:00
feat: nix repl -f flake:nixpkgs
This commit is contained in:
parent
696f57b353
commit
915fc47eef
2 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
## Debugging with `nix repl`
|
||||
|
||||
> NOTE: If you have disabled `NIX_PATH`, you won't be able to use syntax like `<nixpkgs>`. Instead, you should use `nix repl -f flake:nixpkgs` to load nixpkgs.
|
||||
|
||||
We have frequently used nix repl `<nixpkgs>` throughout this guide to examine the source code. It is a powerful tool that helps us understand how things work in Nix.
|
||||
|
||||
Let's take a closer look at the help message of nix repl:
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
## 通过 `nix repl` 查看源码、调试配置
|
||||
|
||||
> 注:如果你禁用了 `NIX_PATH`,那么 `<nixpkgs>` 这样的语法将无法使用,你需要改用 `nix repl -f flake:nixpkgs` 来加载 nixpkgs。
|
||||
|
||||
前面我们已经使用 `nix repl '<nixpkgs>'` 看过很多次源码了,这是一个非常强大的工具,可以帮助我们理解 Nix 的工作原理。
|
||||
|
||||
要学会用 `nix repl`,最好先看看它的 help 信息:
|
||||
|
|
Loading…
Reference in a new issue