Skip to content
New issue

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

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

Already on GitHub? # to your account

Write nix.settings to nix.custom.conf instead of nix.conf #57

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

cole-h
Copy link
Member

@cole-h cole-h commented Jan 21, 2025

No description provided.

grahamc and others added 4 commits January 21, 2025 09:06
* Make check creation more modular
* Add check to test `nix.custom.conf` behavior
* Move `checks` to `packages` (so we can build them and do additional checks in GHA)
* Reformat according to nixfmt-rfc-style
@cole-h
Copy link
Member Author

cole-h commented Jan 21, 2025

(Waiting about 2 hours to see if the user in the nix-installer issue above tries it out and sees success, but otherwise I think this is the right approach and will merge with or without their feedback once that time limit has passed)

@teekennedy
Copy link

teekennedy commented Jan 21, 2025

@cole-h I agree that this is the right approach, but unless I'm missing something, it only works for the initial darwin-rebuild switch.

Nix-darwin has a check to see whether /etc/nix/nix.custom.conf's hash matches one known to be generated by determinate nix installer 0.33+. On the first darwin-rebuild switch, the hash matches and nix-darwin overwrites the file. On subsequent runs, nix.custom.conf contains nix-darwin generated config and doesn't match the hash, so it errors out.

I've been working around this by running darwin-rebuild build --flake . && sudo mv /etc/nix/nix.custom.conf /etc/nix/$(date "+%Y-%m-%d_%H:%M:%S")-nix.custom.conf && darwin-rebuild switch --flake . to update my config.

Personally I'm in favor of merging this PR, but this won't be a full solution without some changes to nix-darwin.

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

Successfully merging this pull request may close these issues.

3 participants