From 915fc47eefd337050cbd397b3247db5392ff57d9 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 16 Dec 2023 20:03:08 +0800 Subject: [PATCH] feat: nix repl -f flake:nixpkgs --- docs/best-practices/debugging.md | 2 ++ docs/zh/best-practices/debugging.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/docs/best-practices/debugging.md b/docs/best-practices/debugging.md index 259500b..5349355 100644 --- a/docs/best-practices/debugging.md +++ b/docs/best-practices/debugging.md @@ -2,6 +2,8 @@ ## Debugging with `nix repl` +> NOTE: If you have disabled `NIX_PATH`, you won't be able to use syntax like ``. Instead, you should use `nix repl -f flake:nixpkgs` to load nixpkgs. + We have frequently used nix repl `` 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: diff --git a/docs/zh/best-practices/debugging.md b/docs/zh/best-practices/debugging.md index 0ed3bf7..d25d6e3 100644 --- a/docs/zh/best-practices/debugging.md +++ b/docs/zh/best-practices/debugging.md @@ -2,6 +2,8 @@ ## 通过 `nix repl` 查看源码、调试配置 +> 注:如果你禁用了 `NIX_PATH`,那么 `` 这样的语法将无法使用,你需要改用 `nix repl -f flake:nixpkgs` 来加载 nixpkgs。 + 前面我们已经使用 `nix repl ''` 看过很多次源码了,这是一个非常强大的工具,可以帮助我们理解 Nix 的工作原理。 要学会用 `nix repl`,最好先看看它的 help 信息: