numtide / devshell

Per project developer environments
https://numtide.github.io/devshell/
MIT License
1.22k stars 87 forks source link

WIP: implement packagesFrom #219

Open blaggacao opened 1 year ago

blaggacao commented 1 year ago

This is a rebase of #6.

@srid @GTrunSec @zimbatm Would you give me some hints to finish this off?

Tried:

direnv: loading ~/src/github.com/numtide/devshell/.envrc
these 2 derivations will be built:
  /nix/store/xszl7qmfb0q3n2vyyy2adwrk787qjanp-devshell-dir.drv
  /nix/store/rrph5q45rg5vw0g6f2mnpmhf3dra9znh-devshell.drv
these 13 paths will be fetched (218.97 MiB download, 1273.93 MiB unpacked):
  /nix/store/0br4jcc7q8n8ys7if632n39b5jl9b38q-cargo-build-hook.sh
  /nix/store/1sgmqdlgskcsmdr088qm9bwgp7v1qmzg-cargo-1.57.0
  /nix/store/5lzxpdzrg7j47vvjrv3ryfz2amwvwnch-llvm-13.0.0-dev
  /nix/store/624pb0bvdn9ijiy78j2d8502d7cw3cj9-cargo-setup-hook.sh
  /nix/store/86a3xci0nskr75agzrj3wc8cvj7xfndn-hook
  /nix/store/bs3r4wl8parh850d9dskx6yahckhy6gr-nss-cacert-3.74
  /nix/store/kn4rqs1qvdvpyjci5r528wrs3d2fl2dl-hook
  /nix/store/m2wsxg44akqgrkzxdy8193lvbxc7nnqp-cargo-install-hook.sh
  /nix/store/mrqiiah7nyjfw4lnp5vlnw625ac6c9fl-llvm-13.0.0
  /nix/store/qipj3xllnn4hrf4j2wgd6rwq97qci2if-cargo-check-hook.sh
  /nix/store/rfr5p58can52ra7fwls598af4xr9h1la-rustc-1.57.0
  /nix/store/v5yn01qxxb98vqi1my8jnd5c1pwgp2ri-llvm-13.0.0-lib
  /nix/store/zhr1cq6i88zl7yf6kvi7i6nwr5hc8s32-libpfm-4.11.0
copying path '/nix/store/m2wsxg44akqgrkzxdy8193lvbxc7nnqp-cargo-install-hook.sh' from 'https://cache.nixos.org'..
[...]

Does that look actually good enough?

GTrunSec commented 1 year ago

In most cases, we want packagesFrom to be able to use inputsFrom and haskell.shellFor. Could @blaggacao you submit a completed PR about that? The packagesFrom is invalid in my devshell.

=   4 │ │ devshell.url = "github:numtide/devshell/?ref=refs/pull/219/head";
 packagesFrom = [
=   1 │ │ │ │ pkgs.openssl
=  14 │ │ │ ];      

error: The option `packagesFrom' does not exist. Definition values:
       - In `<unknown-file>':
           [
             <derivation /nix/store/69avlc6pmxvkipl80jbh5dfd9f2mdqls-openssl-3.0.5.drv>
           ]
jmgilman commented 1 year ago

This is a really useful feature to have :)