-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
linkFarmFromDrvs: Add a trivial builder to create a linkFarm from a list of derivations #70154
Conversation
What is a "link farm"? |
@edolstra Thanks for taking a look at this.
nixpkgs/pkgs/build-support/trivial-builders.nix Lines 294 to 312 in 6b11080
I'm using This PR adds an additional helper function called |
What’s the difference to |
@Profpatsch $ nix-build -E 'with import ./. {}; linkFarmFromDrvs "example" [ pkgs.hello pkgs.gcc pkgs.xterm ]'
...
/nix/store/hsi98apxc80l8r3lpi13hzc3lk8i8623-example
$ tree /nix/store/hsi98apxc80l8r3lpi13hzc3lk8i8623-example
/nix/store/hsi98apxc80l8r3lpi13hzc3lk8i8623-example
├── gcc-wrapper-8.3.0 -> /nix/store/7hzmz83nv8khpwsk858yaac7y3idh0a7-gcc-wrapper-8.3.0
├── hello-2.10 -> /nix/store/rr3y0c6zyk7kjjl8y19s4lsrhn4aiq1z-hello-2.10
└── xterm-348 -> /nix/store/y0cz7w39v4sb743mix5qps3kc2ra9b72-xterm-348 You can see that the directory However, $ nix-build -E 'with import <nixpkgs> {}; symlinkJoin { name = "example"; paths = [ pkgs.hello pkgs.stack ]; }'
/nix/store/wh0nkyg2qklrlq74z17fpy6yqfbdxc4m-example
$ tree /nix/store/wh0nkyg2qklrlq74z17fpy6yqfbdxc4m-example
/nix/store/wh0nkyg2qklrlq74z17fpy6yqfbdxc4m-example
├── bin
│ ├── hello -> /nix/store/qy93dp4a3rqyn2mz63fbxjg228hffwyw-hello-2.10/bin/hello
│ └── stack -> /nix/store/6lzdpxshx78281vy056lbk553ijsdr44-stack-2.1.3.1/bin/stack
└── share
├── bash-completion
│ └── completions
│ └── stack -> /nix/store/6lzdpxshx78281vy056lbk553ijsdr44-stack-2.1.3.1/share/bash-completion/completions/stack
├── fish
│ └── vendor_completions.d
│ └── stack.fish -> /nix/store/6lzdpxshx78281vy056lbk553ijsdr44-stack-2.1.3.1/share/fish/vendor_completions.d/stack.fish
├── info
│ └── hello.info -> /nix/store/qy93dp4a3rqyn2mz63fbxjg228hffwyw-hello-2.10/share/info/hello.info
... You can see here that We use |
Then +1 to that change, but let’s move these three functions together and have an overview of their differences. |
…ist of derivations
348084a
to
a4c1c05
Compare
@Profpatsch Reorganizing the functions is a good idea. I just added a new commit that reorders the functions in this file, adds an example output for I think this should be ready for a final review and hopefully a merge-in. |
a4c1c05
to
678a01a
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review-may-2019/3032/117 |
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.
Fantastic! LGTM
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/comment-doc-praise-thread/6325/2 |
Motivation for this change
This PR adds a trivial builder called
linkFarmFromDrvs
. It is similar tolinkFarm
, but it is a easier to use if you just want directory with a bunch of links to derivations, but you're fine with links just being the name of the derivation.We use this in a couple places in our nix code-base at work, and we thought it could be helpful to other nix users.
Here's an example of using it:
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)Notify maintainers
cc @