feat: add withConfig & buildConfig from nixpkgs#559
Merged
brianmcgee merged 1 commit intonumtide:mainfrom Mar 19, 2025
Merged
Conversation
Inherit the `withConfig` and `buildConfig` wrapper functions added in NixOS/nixpkgs#390147 If the current nixpkgs revision does not have these attrs, a sane error message is thrown when attempting to use them. The `treefmt` argument passed is overridden to refer to `perSystem.self.treefmt`.
brianmcgee
approved these changes
Mar 19, 2025
Member
|
This reminds me, we should probably move away from |
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.
Inherit the
withConfigandbuildConfigwrapper functions added in NixOS/nixpkgs#390147Fixes #558
If the current nixpkgs revision does not have these attrs, a sane error message is thrown when attempting to use them.
I've tested this with and without
nix flake lock --override-input nixpkgs 'github:nixos/nixpkgs/nixos-unstable-small'. With the newer nixpkgs revision the wrapper functions seem to work correctly.The
treefmtargument passed is overridden to refer toperSystem.self.treefmt.I considered using
lib.genAttrsto simplify the inheritence, however doing that with//caused the entirepassthruto be indented by alejandra. I also considered usinginherit (lib.genAttrs), however this didn't seem much of an improvement:I added some calls to
traceto verify that thetreefmtpackage argument is being correctly overridden:We see that
withConfigoverrides itstreefmtarg, whilebuildConfigdoes not depend ontreefmt: