News for hackers. Stuff that matters.
Re:The Curse of NixOS by mplanchard on Monday January 24, 2022 @10:02AM (#30058406)
The best way I’ve found around this is to always keep a local clone of nixpkgs so that I can grep for where functions are defined and hope like hell that there are some comments in the vicinity. Definitely not ideal.
Re:The Curse of NixOS by rgoulter on Monday January 24, 2022 @10:54AM (#30059162)
If you're using Nix on your system, you can also find nixpkgs symlinked under ~/.nix-defexpr/channels/nixpkgs/pkgs/ or so.
Re:The Curse of NixOS by Filligree on Monday January 24, 2022 @12:06PM (#30060499)
And if you have flakes and nix-command enabled, you can run `nix edit nixpkgs#lib.sort` to get the definition of the sort function.

(This will just tell you it's imported from lists. `nix edit nixpkgs#lib.lists.sort` will get you the actual definition.)

Re:The Curse of NixOS by mplanchard on Monday January 24, 2022 @11:34AM (#30059922)
Nice, I did not know this. Thanks!