-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
template: Clean up outputs #49
Open
cyntheticfox
wants to merge
2
commits into
nix-community:master
Choose a base branch
from
cyntheticfox:patch/template-cleanup
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this. On one hand this makes the overlay self-contained. On the other, it is no longer pure – and if the overlay no longer works with a single coherent set of packages, there are not many reasons to choose it over just
legacyPackages
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I'm not very familiar with both creating and using overlays; I use them very coarsely in my dotfiles when I use them at all. Since the package requires napalm to build, providing it purely would require adding the napalm overlay to
prev
, right? Is something like this possible?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nix flake check
doesn't seem to error on it, so I'll test it outThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer is no, it does not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would re-create a new Nixpkgs instance from scratch, likely discarding other overlays in the stack.
You could do something like the following:
but that would also override
napalm
people put in theiroverlays
.Or maybe something like:
But that would still not allow people to override napalm.
We could allow that using conditional stacking:
But I think that is too magic and would just befuddle people.
So I tend to use just plain old
And mention the dependency in readme.
But maybe there is some other idiom concerning interdependent overlays that I am not aware of. Maybe ask on Discourse or Matrix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the conditional stacking, but yeah, might be complex to have in a template. Not sure that it's common though to have an external builder be passed purely though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I added an implementation of the conditional stacking I've managed to get working right, alongside some explanatory comments. It's close to what you had, but with
napalm.buildPackage
as the checked attr, as that's both specifically what we need, and should help avoid collision problems (e.g. there's already a napalm package in nixpkgs, but it's different).It's probably enough to do things like this, as overlays themselves are more of an advanced use-case.
EDIT: Got it working in 7bfe032 specifically.