-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: make nix work out of the box on rpm-ostree #8
Conversation
a823e33
to
5ae2f48
Compare
Booting still warns with:
However it seems to work as expected. Also, since Silverblue is so special, it's not really working after boot. You still need to do:
After installing and rebooting. |
Hmm it still fails weird when I |
I closed it because I didn't feel motivated to push it through. Of course it's more than welcome for others to pick up the mantle :) |
Thanks! I really love Fedora Silverblue and nix, and both share similar mindsets, but not being able to mix both was very sad. I just hope I can get this to a point where I don't sacrifice experience for normal Fedora users. Having a couple extra systemd units shouldn't be a big problem as long as they just work IMHO. The point of having to add nixbld group and users manually is relatively normal in rpm-ostree world. It's actually documented. We would just drop a note in the readme and it should be enough. Now the biggest problem I have with current code is that it logs this after each boot:
For some weird reason, it thinks that My current workaround is to I've tried several ideas to fix the loop, but none of them worked. Do you have any suggestion? |
Finally it seems I found how to deal with all corner cases and unit loops. I added to the README specific rpm-ostree instructions. I'm using it right now on my dev PC and works fine. Also tested in a bare-bones Fedora Silverblue VM I've set up. Just follow the instructions and all will go fine. |
On Silverblue 36, after # Verify all works
nix --version
# Create nixbld group and users
grep -E '^nixbld:' /usr/lib/group | sudo tee -a /etc/group
grep -E '^nixbld' /usr/lib/passwd | sudo tee -a /etc/passwd
sudo groupmod nixbld -aU $(grep -oE '^nixbld[[:digit:]]+' /usr/lib/passwd | tr '\n' ,)
# Reboot again
systemctl reboot everything worked as expected. I've run |
f803f3f
to
ed1e3c5
Compare
Thanks for your feedback. I rebased and updated the rpm-ostree-specific instructions on the readme to make them more straightforward. |
Are there any plans to merge this? I am currently using my rather janky script to get Nix running on my machines, and would like to migrate to this. |
I've been using this for 2 months on my dev Silverblue machine and it works like a charm. It's up to the maintainer to decide if he wants to merge. On my side AFAIK it's all done. |
@yajo: I am attempting to bake this into an OSTree. I have found that this is needed in
Without that, the |
Would you mind to open a PR against my branch? |
Hi folks. This has been working without any hassle for some months. Do you think you could merge it? FWIW I built it locally, so you can test it fast: nix-multi-user.rpm.zip |
The main difference is that restorecon is executed against `/var/nix` instead of against `/nix`, because that's the path that actually exists at that point. To make it work, SELinux policies are duplicated for the `/var/nix` prefix. From there onwards, no more recursive restorecon calls are needed. Fixed a bug in the start conditions for the socket. Start the nix-setup.service before nix-daemon.service, not before nix.mount. This is because mounting the empty directory first doesn't have any negative effect, but running the service before the mount enters a service dependency loop that we want to avoid. @moduon MT-83
Following instructions from https://fedoraproject.org/wiki/Packaging%3aUsersAndGroups#Dynamic_allocation now: - Do not hardcode GID/UID. - Preexisting users is normal sysadmin work. - Use getent to know that.
I rebased and rebuilt to include #14 and other changes. Updated zip: nix-multi-user.rpm.zip |
https://gitlab.com/ahayzen/silverblue-nix check this out |
@dankmemermusic
This repo does not have that issue, it creates the required SELinux policies. |
What's the current status of this being merged? If it needs more testing, I can install it locally and see if I can find any issues. |
Hm, found a weird issue. If I run my rpm-ostree config without this installer, it works just fine. However, the moment I install it, my terminal apps don't launch, and Firefox's theme resets. Uninstalling this installer fixes all of that. It seems to happen regardless of whether or not the systemd service is going, too. |
I've been using this package for more than 6 months without an issue. @orowith2os have you followed instructions in the readme? Those that are added in this PR |
I did them step-by-step, and still have the issue. My Firefox theme goes back to light, Nautilus and any terminal apps don't open, and some other (GNOME) apps don't work, like Disks. Are there any logs I should upload? |
Could you make sure your nix profile is totally empty? I'm thinking that maybe some nix apps are conflicting with usual fedora apps. Otherwise, you could post your logs for all |
@yajo I haven't installed anything via Nix, only enabled it, so I don't see why anything would conflict. On the systemd unit topic, any commands I should use to grab the logs? |
okay this is a lil weird I thought I could get into a terminal using vscode's terminal emulator, but something's weird with dbus, I think, and it gives me "the name is not activatable" |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/should-the-default-nix-store-location-be-below-usr/32222/13 |
I now installed nix with the rpm package, but when I run nix in my shell I get command not found. The only places where I have found a nix executable are:
should I just add the bin in the store to path? 😬 |
Not even after rebooting? |
I found out that it works when I run bash but in my standard shell zsh it does not work |
I'm no longer using rpm-ostree systems, and https://github.com/DeterminateSystems/nix-installer supports those, so I have no longer interest in this feature. Closing. You can continue in #22 if you wish. |
The main difference is that restorecon is executed against
/var/nix
instead of against/nix
, because that's the path that actually exists at that point.To make it work, SELinux policies are duplicated for the
/var/nix
prefix.From there onwards, no more recursive restorecon calls are needed.
Also fixed a bug in the start conditions for the socket.
@moduon MT-83
I know you closed #5 but I hope you can reconsider it now that, with this patch, all works out of the box.
All you need to do is build it, and then
rpm-ostree install --reboot ./nix.rpm
. Then, after reboot:systemctl enable --now nix-daemon
.