feat: show detailed error messages

This commit is contained in:
Ryan Yin
2024-01-23 09:48:55 +08:00
parent 4a71d5934a
commit b2e9c6a2a7
8 changed files with 43 additions and 1 deletions

View File

@@ -1,5 +1,13 @@
# Debugging Derivations and Nix Expressions
## Show detailed error messages
You can always try to add `--show-trace -L` to the `nixos-rebuild` command to get the detailed error message if you encounter any errors during the deployment. e.g.
```bash
sudo nixos-rebuild switch --flake .#myhost --show-trace -L
```
## 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.