-
Notifications
You must be signed in to change notification settings - Fork 84
lib: eachDefaultSystemPassThrough/eachSystemPassThrough: init
#119
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
Merged
zimbatm
merged 8 commits into
numtide:main
from
trueNAHO:lib-each-default-system-pass-through-each-system-pass-through-init
Sep 17, 2024
Merged
lib: eachDefaultSystemPassThrough/eachSystemPassThrough: init
#119
zimbatm
merged 8 commits into
numtide:main
from
trueNAHO:lib-each-default-system-pass-through-each-system-pass-through-init
Sep 17, 2024
Conversation
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
zimbatm
reviewed
Sep 13, 2024
Reformatting the eachSystem function using 'nixfmt-rfc-style --width 80' avoids formatting arguments in the following commits.
Inline single-use local variables to minimize cognitive load while reading the code, unless they cache computational results.
Simplify boolean expression to reduce nesting and improve performance.
d29791e to
fc95db3
Compare
Contributor
Author
Expose the eachDefaultSystemPassThrough and eachSystemPassThrough
functions to handle cases where the system key should not be injected by
eachDefaultSystem and eachSystem:
inputs.flake-utils.lib.eachDefaultSystem (system: {
checks./*<SYSTEM>.*/"<CHECK>" = /* ... */;
devShells./*<SYSTEM>.*/"<DEV_SHELL>" = /* ... */;
packages./*<SYSTEM>.*/"<PACKAGE>" = /* ... */;
})
// inputs.flake-utils.lib.eachDefaultSystemPassThrough (system: {
homeConfigurations."<HOME_CONFIGURATION>" = /* ... */;
nixosConfigurations."<NIXOS_CONFIGURATION>" = /* ... */;
})
These functions prevent users from re-implementing simplified
eachDefaultSystem and eachSystem versions to avoid system key
injections, while benefiting from current and future complex logic, like
handling the '--impure' flag.
This addresses flake-utils' arguably biggest issue. [1]
[1]: https://ayats.org/blog/no-flake-utils
fc95db3 to
fa06cc1
Compare
Contributor
Author
Changelogv2: fa06cc1
v1: fc95db3
v0: d29791e |
Member
|
thanks! |
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.
This patchset introduces the
eachDefaultSystemPassThroughandeachSystemPassThroughfunctions after cleaning up theREADME.mdfile and theeachSystemfunction.The rationale for adding these new functions is outlined in the commit message:
Feel free to propose alternative names for the
eachDefaultSystemPassThroughandeachSystemPassThroughfunctions.For reference, the new
eachDefaultSystemPassThroughfunction simplifies my Home Manager setup as follows:To ensure a clear and easily reversible commit history, it would be best to avoid merge and squash commits and merge each commit individually.