diff --git a/docs/nixos-with-flakes/other-useful-tips.md b/docs/nixos-with-flakes/other-useful-tips.md index 549af87..3914bf4 100644 --- a/docs/nixos-with-flakes/other-useful-tips.md +++ b/docs/nixos-with-flakes/other-useful-tips.md @@ -76,7 +76,7 @@ sudo nix store gc --debug To find out why a package is installed, you can use the following command: -1. Enter a shell with `nix-tree` available: `nix shell nixpkgs#nix-tree nixpkgs#ripgrep` +1. Enter a shell with `nix-tree` & `rg` available: `nix shell nixpkgs#nix-tree nixpkgs#ripgrep` 1. ` nix-store --gc --print-roots | rg -v '/proc/' | rg -Po '(?<= -> ).*' | xargs -o nix-tree` 1. `/` to find the package you want to check. 1. `w` to show the package is depended by which packages, and the full dependency chain. diff --git a/docs/zh/nixos-with-flakes/other-useful-tips.md b/docs/zh/nixos-with-flakes/other-useful-tips.md index a13cc69..55f7f00 100644 --- a/docs/zh/nixos-with-flakes/other-useful-tips.md +++ b/docs/zh/nixos-with-flakes/other-useful-tips.md @@ -72,7 +72,7 @@ sudo nix store gc --debug 查询为什么某个包被安装,当前环境中的谁依赖了它: -1. 进入一个带有 `nix-tree` 的 shell:`nix shell nixpkgs#nix-tree` +1. 进入一个带有 `nix-tree` 与 `rg` 的 shell:`nix shell nixpkgs#nix-tree nixpkgs#ripgrep` 1. ` nix-store --gc --print-roots | rg -v '/proc/' | rg -Po '(?<= -> ).*' | xargs -o nix-tree` 1. `/` 以查找到你想查询的包 1. 输入 `w`,看看谁依赖了它(`why depends`),以及完整的依赖链。