-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Generalize nixConfig attributes to systems #5993
base: master
Are you sure you want to change the base?
Generalize nixConfig attributes to systems #5993
Conversation
See my comment here: #5989 (comment) Regarding the implementation: The name |
deac470
to
41e2b34
Compare
@edolstra - I modified and force-pushed the patchest given your feedback; hopefully it's a bit cleaner now. The git history is similar to the previous iteration, but the perSystem attribute is implemented in a commit following the one allowing system specific changes in the first place. |
This refactor is a natural extension of encapsulation, and provides more visual room for both the caller (getFlake) and parseAttrs itself. Functionality is unchanged.
System-specific config settings are read into ConfigFile::settingsBySys, and only applied by ConfigFile::apply if the system is either none (used to represent system-agnostic settings) or the current system.
Previous commits allowed the following, but this is undesired per the discussion in NixOS#5989. nixConfig.x86_64-linux.<opt> = <val>; This commit ammends the implementation to exclusively accept options like the following: nixConfig.perSystem.x86_64-linux.<opt> = <val>;
See discussion in 5989. We want to have system-agnostic settings override global /etc/nix settings, but we want to combine system-specific settings with non-global system-agnostic settings.
bb4e54c
to
3bb1537
Compare
Rebased on current master and added documentation. |
CC @roberth I suspect this should be linked to the other issues trying to solve flake system problems? |
What is it for? The original use case ( @Ericson2314 idk where to link for this specifically. It seems that this shares the problem of having to enumerate systems, and this only adds to the problem.
Maybe it used to be a function? Sad if true. |
See #5989 for context. The implementation here should be pretty straightforward.
Assuming no outstanding implementation issues, how can (should?) I write tests for these changes? Given the inherent host environment impurity, I'm not sure where to start with it.