-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Add exec, eachSystem, mkApp functions #173006
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
|
@Artturin Now that's useful 👍 @jtojnar I knew about a couple of them, thought it's about time to give it another shot due to following reasons:
So at this point, I vote for us to merge it since:
|
mkApp libnotify "notify-send" | ||
=> { type = "app"; program = "/nix/store/.../bin/notify-send"; } | ||
*/ | ||
mkApp' = drv: binName: { |
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.
Wouldn't it be easier to combine those and fall back to the first argument of the second is not defined?
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 don't think it's possible to do it that way? The best I can think of in terms of merging is to swap arguments and check if the first argument is a derivation or a string, if its a string - return a function that accepts derivation
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.
Actually, another thought occurred - one argument that accepts either attribute set (same as flake-utils) or derivation. This would be a pretty clean implementation.
Anyways, let's wait and see what supreme codeowners has to say about all this, not sure what are your thoughts on the matter but I think its time for reviewers to give in and merge this or something similar
Fortunately, this is not about the merits of flake. But about dropping one needless dependency for a lot of users that pollutes the dependency tree in the lockfile (roughly doubling its size). So 👍 |
I'm very 👎 on merging anything related to Flakes in the Flakes are still an experimental feature. Merging anything related to them in |
And here's me thinking flakes was about allowing to depend on Nix expressions outside of nixpkgs… |
With the same motivation as #173093 (comment) I'm closing this. |
Please join NixOS/rfcs#82
This really shouldn't matter. If the size of the lockfile already matters around this small number of dependencies, that would be indicative of a significant problem in the design of Flakes.
This reads like you're constructing a deferred, inspectable function application or something. Might be my personal professional deformation though. |
I think we've considered |
Description of changes
Added several helper functions.
eachSystem
function is copied from flake-utils, this allows hundreds if not thousands of flakes to removeflake-utils
as a dependencyThis should help to test out this PR gytis-ivaskevicius/nix2vim@33cd854
exec
function is used as part ofmkApp
, but mainly inteadead for cases as such:Worth considering renaming
exec
to something likeI
or_
so it would look more like an operator. I personally would love such change but did not commit it in such a way to avoid people protesting outside my windowThings done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes