nixos/specialisation: Rephrase in terms of extendModules, noUserModules#144094
Merged
roberth merged 1 commit intoNixOS:masterfrom Dec 1, 2021
Merged
Conversation
By using the new extendModules function to produce the specialisations, we avoid reimplementing the eval-config.nix logic in reverse and fix cross compilation support for specialisations in the process.
roberth
commented
Nov 1, 2021
| children = mapAttrs (childName: childConfig: | ||
| (import ../../../lib/eval-config.nix { | ||
| inherit lib baseModules specialArgs; | ||
| system = config.nixpkgs.initialSystem; |
Member
Author
There was a problem hiding this comment.
I believe this to have been insufficient for cross compiled NixOS. (which is fixed by this pr, as mentioned)
Member
|
Can't build my config which uses specialisations and I think it's after this change went in. https://gist.github.com/TransLunarInjection/0121aa404aab1786cd2a347d2b80380e - full error trace |
13 tasks
Member
Author
|
@TransLunarInjection The supposedly legacy |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
By using the new extendModules function #143207 to produce the specialisations,
we avoid reimplementing the eval-config.nix logic in reverse and fix
cross compilation support for specialisations in the process.
This does change the order of the modules, leading to ordering changes in list-typed options such as
environment.systemPackages. This is a slight conceptual flaw in the module system, but at least some of us are aware of the potential issue and others have been saved by the fact that in many cases the order does not matter.Normally I would consider this an acceptable change when refactoring, but I'm a little hesitant to do it right now, considering the imminent 21.11 branch-off.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)