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

checks: check /etc/nix/nix.custom.conf hash #1266

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

emilazy
Copy link
Collaborator

@emilazy emilazy commented Jan 13, 2025

After DeterminateSystems/nix-installer#1379, the Determinate Systems installer will write custom user configuration to nix.custom.conf and include it from nix.conf. We need to check for its presence and error out if it contains any settings so as to not inadvertently clobber user configuration. The error message here could maybe be improved but it’s better than not handling it at all.

Drafted until that PR is ready to ship and we know what the hash of the nix.conf and empty nix.custom.conf will be.

This should land before #1259 if it’s ready in time, or else get backported.


Note: This work was funded by Determinate Systems. The design is my own.

# Generated by https://github.com/DeterminateSystems/nix-installer.
# See `/nix/nix-installer --version` for the version details.

!include nix.custom.conf
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be at the bottom to be able to override their defaults?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, yeah. This is what’s shipped in the wild in v0.33.0, though, so I think we have to handle this version of the file anyway.

@emilazy
Copy link
Collaborator Author

emilazy commented Jan 14, 2025

A new version with the relevant PR has been released; I’ve tested the code and fixed it to use etcChecks and a separate removal step (curse you, user activation). It handles both the stock file and user customizations correctly.

@emilazy emilazy marked this pull request as ready for review January 14, 2025 23:46
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

Successfully merging this pull request may close these issues.

2 participants