5 ms·
There is a very good reason. Nix strives to be reproducible. Thus all hardcoded paths in builds have to point somewhere. /nix was chosen.
by costrouc 7y ago
There is a very good reason. Nix strives to be reproducible. Thus all hardcoded paths in builds have to point somewhere. /nix was chosen.
- hpfr 7y agoI recognize your nick—I found a few comments of yours [0] [1] that were intriguing. You should publish your config, if you can sanitize it. [0]: https://old.reddit.com/r/linux/comments/9o44id/how_do_you_automate_your_distro_setup/e7sxhko/?context=3 https://old.reddit.com/r/linux/comments/9o44id/how_do_you_au... [1]: https://old.reddit.com/r/NixOS/comments/9mm2pb/syncing_across_machines/e7g65nq/?context=3 https://old.reddit.com/r/NixOS/comments/9mm2pb/syncing_acros...
- kohtatsu 7y agoSure, but you can translate the user-configured path to be /nix on inputs and outputs.
- rgoulter 7y agoSo, if you were to build a package assuming /opt/nix instead of /nix, the sets of packages would be entirely different. The "can't" is more of a "seems impractical" than "hardcoded assumption in the nix program itself".
- zeckalpha 7y agoThis ignores chroot
- echelon 7y agoI don't mean to slight you or the effort you've put into this if you're an author or maintainer, but that's a terrible rationale. Given this choice, your tool doesn't fit well with other software, and from a systems perspective, it feels slightly egotistical. In the future, file systems will be immutable and only a few sanctioned volumes will be writable (if any). It'd be better if systems like this abstracted away the notion of the file system and operating system altogether. Everything should be virtual and that is how hermeticity and reproducibility should be achieved. That said, I admire the work you're doing and can't really point fingers as I'm not a contributor.
- catalogia 7y ago> In the future, file systems will be immutable and only a few sanctioned volumes will be writable (if any). If any?! Where do I put my files if not on a filesystem? In some corporate cloud? Writable filesystems for corporations but not for the common plebian? Is that the sort of dystopian future you're envisioning? If I've misunderstood what you're saying, then I apologize. But I'm alarmed by my perception of what you're saying.
- echelon 7y agoSome IDEs allocate config directories in your homedir: .idea, .vscode, .vim Some of them do it under .config. Some systems write to /usr/local Some things scope to the project you're working in. Python venv, node_modules, etc. Build systems, such as Cargo, Maven, and Pants each do their own thing. Make, autotools... Have you looked at an Android filesystem? I don't even know how to describe it. Everything everywhere is horribly inconsistent. I'm thinking in terms of workloads, of which building and linking are merely types of work that produce artifacts. There are many types: server workloads, jobs, userland software. If you semantically declare what a workload needs, what dependencies it has, where those dependencies must exist, and what outputs it produces, everything can be wired together logically and hermetically. I'm hoping the immutable containers of the Docker/microservice world make their way onto the desktop. If I can reduce my entire desktop environment into a single config file and have it reliably reconstruct itself, it would be magical. I would freeze and wipe my machine constantly. Of course writable, mutable volumes will exist for humans, but software can't play in that realm or it will lose hermeticity. I've sort of gotten off track and am no longer speaking about package managers / build systems. I think there's a more general solution to all of these problems.
- tazjin 7y ago> If I can reduce my entire desktop environment into a single config file and have it reliably reconstruct itself, it would be magical. I would freeze and wipe my machine constantly. You can do this with Nix. I do this with Nix even on non-NixOS machines. The thing is that Nix has a certain "path of enlightenment" that one needs to walk until it becomes a tool that adds certain capabilities[0] to your mental model. All the software is inconsistent, but we can wrap it consistently by whichever means are necessary for that particular thing. Anything from flags setting paths to dynamically patching the source (and describing that operation as code) is possible. [0]: e.g. https://git.tazj.in/tree/web/cgit-taz/default.nix#n61 https://git.tazj.in/tree/web/cgit-taz/default.nix#n61
- xenadu02 7y agoTaking a top-level directory isn't very good form IMHO. I understand wanting a hard-coded path but /opt/nix seems more in keeping with the Unix philosophy.
- Annatar 7y agoIt would be /var/opt/nix since it's data. Payload in /opt/nix and configuration in /etc/opt/nix. That's what the specification states.