Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude /nix from ostree changes and effects #2739

Closed
orowith2os opened this issue Oct 14, 2022 · 5 comments
Closed

Exclude /nix from ostree changes and effects #2739

orowith2os opened this issue Oct 14, 2022 · 5 comments

Comments

@orowith2os
Copy link

Nix, as a packaging format, requires that /nix exist, and be mutable.

However, ostree prevents /nix from being created, and even if it were, it would be immutable, preventing the use of Nix on ostree systems.

I suggest taking the appropriate measures to ensure that Nix is usable on an ostree-based system. Some folks from the Nix community may be able to detail everything that would be required to support this, I am just making this issue, as it's one of my (few!) complaints about using an ostree-based system (Fedora Silverblue).

@cgwalters
Copy link
Member

Hi, I think Nix has a ton of great ideas, and I definitely want ostree to play nicely with it.
This issue touches on #2681

Try this today:

mkdir /var/nix
chattr -i /
ln -sr /var/nix /nix

Does that work? IOW can /nix be a symlink? If so, then things get simpler. If it can't be, can it be a mountpoint? i.e. does

chattr -i /
mkdir -p /nix /var/nix
mount --bind /var/nix /nix

work?

@lucab
Copy link
Member

lucab commented Oct 14, 2022

There is some related discussion in coreos/rpm-ostree#337 as well.
Over there, it was mentioned that the symlink may have some negative side-effects on the artefacts purity, and that the mountpoint approach is recommended instead: https://nixos.org/manual/nix/stable/command-ref/env-common.html#env-NIX_IGNORE_SYMLINK_STORE.

So overall I think the deployment should carry an empty top-level /nix directory, to be bind-mounted to node-local storage.

@orowith2os
Copy link
Author

What's the current status of this? I can see some work being done over in nix-community/nix-installers#8 that installs to /var/nix, but some utilities might still use /nix if they're used to it.

@jcdickinson
Copy link

jcdickinson commented Nov 25, 2022

@orowith2os nix-installers (specifically that PR) installs to /var/nix and mounts that to /nix using systemd. No changes are required for rpm-ostree.

@orowith2os
Copy link
Author

Closing this issue, since the PR seems to handle everything needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants