Skip to content

Instantly share code, notes, and snippets.

@hellwolf
Created March 27, 2023 11:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hellwolf/39feed6c494b4b93ebbd6e52aba2e8df to your computer and use it in GitHub Desktop.
Save hellwolf/39feed6c494b4b93ebbd6e52aba2e8df to your computer and use it in GitHub Desktop.
Nix Helpers: trace-symlink & trace-which
#!/usr/bin/env sh
a=$(which "$1") && exec trace-symlink "$a"
@hellwolf
Copy link
Author

Example usages:

$ trace-which cloc
/etc/profiles/per-user/hellwolf/bin/cloc
/nix/store/jm2q37h0z0915b52675z47ngjgmwlkga-user-environment/bin/cloc
/nix/store/30b5j6zq93p6xkdnsasr971z5qv1rf3p-cloc-1.94/bin/cloc
$ trace-symlink ~/.nix-profile
/home/hellwolf/.nix-profile
/nix/var/nix/profiles/per-user/hellwolf/profile
/nix/var/nix/profiles/per-user/hellwolf/profile-67-link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment