Add exec, eachSystem, mkApp functions#173006
Add exec, eachSystem, mkApp functions#173006gytis-ivaskevicius wants to merge 3 commits intoNixOS:masterfrom
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.
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.
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.
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.
eachSystemfunction is copied from flake-utils, this allows hundreds if not thousands of flakes to removeflake-utilsas a dependencyThis should help to test out this PR gytis-ivaskevicius/nix2vim@33cd854
execfunction is used as part ofmkApp, but mainly inteadead for cases as such:Worth considering renaming
execto something likeIor_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 = trueset 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.shto update generated release notes