Closed infinisil closed 1 year ago
@andir search.nixos.org and nix edit
use pkgs.<name>.meta.position
, which uses builtins.unsafeGetAttrPos
to get the location of the meta.description
attribute. So it won't break those two use cases. We should add search.nixos.org to the "Interactions" section
There might be other use cases that do rely on builtins.unsafeGetAttrPos "<name>" pkgs
not being null
, but I expect those to be very brittle because they're probably tied to all-packages.nix
. Those use cases are probably better implemented using the unit directories anyways though.
I do agree that "impure" is the better word here. While "unsafe" in Nix often does mean impure, it's a bit misleading here
Rewording to:
This functionality is impure and therefore the result can't be assumed to stay the same over time
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/2022-01-09-nixpkgs-architecture-team-meeting-24/24556/1
https://github.com/nixpkgs-architecture/simple-package-paths/blob/5ed6a81349479bb4718d71e95c00b4b28a745dc8/README.md?plain=1#L101-L103
Code comment by @andir: