Hacker News new | past | comments | ask | show | jobs | submit login

There is a very good reason. Nix strives to be reproducible. Thus all hardcoded paths in builds have to point somewhere. /nix was chosen.



I 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.


For what it's worth, the prefix is configurable, but if you can keep the default /nix, then you get benefits like sharing reproducible builds and build caches with everyone else using it.

Your "everything is virtual" will also make it increasingly trivial for a process tree to elect to see some arbitrary filesytem tree at /nix, so that physical volume configuration won't matter and there is no "canonical" filesystem layout to make /nix feel intrusive.


> 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.


Some 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.


> 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


> If I can reduce my entire desktop environment into a single config file and have it reliably reconstruct itself, it would be magical.

I might be missing something, but it sounds like that's what home-manager[1] was designed to do. Certainly works pretty well for me.

[1]: https://github.com/rycee/home-manager


> In the future, file systems will be immutable and only a few sanctioned volumes will be writable (if any).

Certainly not on any system I will ever choose to use.


Sure; Nix is transitional, and runs on existing kernels. That is the main distinction between what you are imagining and what we currently have.


Taking 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.


It 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.


I 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_au...

[1]: https://old.reddit.com/r/NixOS/comments/9mm2pb/syncing_acros...


Sure, but you can translate the user-configured path to be /nix on inputs and outputs.


So, 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".


This ignores chroot




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: