logoalt Hacker News

nh2yesterday at 3:56 PM2 repliesview on HN

Worth pointing out that with Nix/NixOS this problem doesn't exist.

The problem in other distros is that if you prefix PATH so that it contains your executable "foo", and then run a program that invokes "foo" from PATH and expects it to do something else, the program breaks.

With Nix, this problem does not exist because all installed programs invoke all other programs not via PATH but via full absolute paths starting with /nix/store/HASH...


Replies

aheppyesterday at 5:01 PM

The "solution" of only ever using full absolute paths works on any unix system, doesn't it?

show 1 reply
ablobyesterday at 4:21 PM

So if I want to use grep in a small script, do I have to write:

/nix/store/grep-hash -flags files | /nix/store/head-hash

instead of: "grep -flags files | head"?

show 2 replies