-
Notifications
You must be signed in to change notification settings - Fork 52
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
nix-darwin install #580
Comments
I've managed to follow the flakes install with success before from https://github.com/LnL7/nix-darwin#flakes-experimental. Here's one instance where I was debugging an uninstall issue: #528 (comment) This seems to be a regular issue folks raise, I wonder how we can better help guide folks... Maybe some nix-darwin specific doc pointers. |
Yeah, I don't have any strong opinions on what the best thing to do is, just wanted to share what I ran into. I'm not having any problems right now, so please feel free to close this out if you want. I'd close it myself, but also maybe you want to keep it as a reminder. |
Just in case anyone else does run into this and want to know how to go about installing After renaming
That enables the experimental features that the installer had enabled in the |
I run that command and ➜ cat /etc/nix/nix.conf
# WARNING: this file is generated from the nix.* options in
# your nix-darwin configuration. Do not edit it!
allowed-users = *
auto-optimise-store = false
build-users-group = nixbld
builders =
cores = 0
experimental-features = nix-command flakes
extra-sandbox-paths =
max-jobs = auto
require-sigs = true
sandbox = false
sandbox-fallback = false
substituters = https://cache.nixos.org/
trusted-public-keys = cache.nixos.org-1:.....=
trusted-substituters =
trusted-users = root |
Note you do not want |
Currently, On the |
Related to #562 |
Noting this is a good workaround in the meantime: #608 (comment) |
This should help: #620 |
So as someone who's considering switching to this installer for future Nix installs on macOS, what is the current status of this issue? Does |
I just installed Nix about a hundred times, and got the same hash for the config every time. This was largely because we updated the nix-config-parser crate to use an ordered HashMap, instead of the regular HashMap. The remaining variability in here will be from the version number in the comment, and any custom configuration the user has specified. Let's remove the version number from the comment and instead suggest looking at the receipt.json or nix-installer binary for the version number. I think that should solve this issue! |
FYI, I used dac0adc to install Nix on a fresh macOS install (14.1.1). The initial Now, after a reboot, I'm getting the same complaint about |
For clarity, our position is that our installer does the best job it can to produce a working system, nicely configured for users. What that means will change over time. Since nix-darwin is trying to detect (by hash) a known config to replace it with something else, it is always going to have periods of time where our config is updated for one reason or another and nix-darwin has to catch up. It'd probably be good to open an issue on nix-darwin about how to handle the issue better. I'm a bit surprised to hear it described as completely broken, though. If that is the case, nix-darwin probably needs to do a bit more work to convey to the user what is wrong and how to repair it. |
I think that, at the very least, the conflict between what this installer does and what |
I understand it's out of the current scope of this tool, but maybe it could optionally also install popular things like nix-darwin and home-manager? And set them up with the a flake-based approach from the start. While it's not that hard to do, there is so much existing content that assumes nix with channels. |
Now that LnL7/nix-darwin#809 is merged on the nix-darwin side, the latest version of DetSys's nix-installer should be working again, feel free to file issues on the nix-darwin side as well if you still run into issues |
🎉 thank you a lot Will and Enzime and everyone for helping to get this sorted for nix-darwin users :). We'll sort out the next bits around the "survival mode" overwriting the rc files ... |
Just tried to install warning: Git tree '/Users/boda/.config' is dirty
warning: creating lock file '/Users/boda/.config/nix-darwin/flake.lock'
warning: Git tree '/Users/boda/.config' is dirty
building the system configuration...
warning: Git tree '/Users/boda/.config' is dirty
Password:
setting up /run via /etc/synthetic.conf...
error: Unexpected files in /etc, aborting activation
The following files have unrecognized content and would be overwritten:
/etc/zshenv
Please check there is nothing critical in these files, rename them by adding .before-nix-darwin to the end, and then try again. By checking boda@ip-192-168-1-112 ~ % cat /etc/zshenv
# Set up Nix only on SSH connections
# See: https://github.com/DeterminateSystems/nix-installer/pull/714
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ] && [ -n "${SSH_CONNECTION}" ] && [ "${SHLVL}" -eq 1 ]; then
. '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
fi
# End Nix Is the workaround to rename Installed nix with nix-installer 0.15.1 |
That should be OK, yes. You can also probably delete it safely. (An uninstall may report an erorr but it should be fine) |
- nix-darwin now sets the flake registry to that of the nixpkgs passed to nix-darwin.lib.darwinSystem. Not only do I no longer need to do it, but I got an error when trying to rebuild my system because the option was being set in two place. LnL7/nix-darwin#1067 - apparently auto-allocate-uids is broken so I'm not going to enable it anymore: DeterminateSystems/nix-installer#580 (comment)
Hey thanks for the new installer, I've been trying it out for some new VMs and I like that it turns on flakes and command by default.
The changes though to nix.conf make the default nix-darwin install fail (at least with the flake path
nix run nix-darwin -- switch --flake ~/.config/nix-darwin
) since it sees things it's not expecting. It advises you to move the nix.conf file, which then of course removes setting flakes+command being enabled. This is all easy enough to work around if you know what you're doing, but it feels like a bit of a stumbling block.Would it be out of line for this installer to also set up a default nix-darwin flake and set up nix-darwin too? Or maybe have that be an option?
The text was updated successfully, but these errors were encountered: