4 ms·
If you truly want to be "cross-platform" with long-term future proofing in mind, `/nix` is (edit: was) probably the most stable choice. I get it, people are se
by kempbellt 6y ago
If you truly want to be "cross-platform" with long-term future proofing in mind, `/nix` is (edit: was) probably the most stable choice.
I get it, people are sensitive about the root directory. "But it's where ALL the stuff lives!". So yeah, try not to ever run 'rm -rf /' (even though this is blocked in most cases now).
But why make it completely inaccessible for creating files/directories in? So much hand-holding for people to make it impossible for a user to ever make a mistake just locks down the ecosystem more, forcing developers to implement proprietary hacks that don't scale properly.
`/var/opt/nix` and `/opt/nix` are options, sure. But you cannot guarantee that those directories will exist on every platform. And if you have to create them, why is this better than `/nix`?
- catalogia 6y agoIf you have to `mkdir /nix`, what's wrong with `mkdir -p /opt/nix`? I don't see how one is "more stable" than the other. The big difference between the two is the later conforms to convention while the former doesn't.
- kempbellt 6y ago`mkdir -p /opt/nix` assumes that there is a convention, and that this is the correct convention - which may not be the case for every situation, and would result in creating unnecessary nested directories. You could make a more sophisticated installation script that attempts to install Nix into conventional locations depending on the specific operating system - or user input - but if you want a simple catch-all, simple installation script `/nix` was a perfect cross-platform installation location, until now.
- catalogia 6y ago> `mkdir -p /opt/nix` assumes that there is a convention A correct assumption on virtually all relevant extant systems... > which may not be the case for every situation In the supposed scenario where the assumption isn't correct, the downside of /opt/nix vs /nix is basically insignificant. What's the overhead of one level of directory nesting, a single extra inode? Big whoop.
- kempbellt 6y agoAnd what is the issue with leaving it as `/nix`, which is (was) accessible on virtually all extant systems? Other than "the root folder is special!"
- catalogia 6y agoNothing was wrong with it, except that it violated convention. As I said: "The big difference between the two is the later conforms to convention while the former doesn't." Violating convention comes with risk. Whether violating convention and assuming that risk is a good idea depends on whether the risk is worth the reward. For Nix, I don't think it was.