typeable / stackage2nix

Generate Nix build instructions from a Stack file
BSD 3-Clause "New" or "Revised" License
49 stars 18 forks source link

Generate separate Nix function for stack.yaml packages #63

Closed 4e6 closed 6 years ago

4e6 commented 6 years ago

Generate Nix function that filters root packages from stack.yaml

Example usage with shellFor:

let
  # generated packages
  stackagePackages  = import ./. {};
  stackYamlPackages = import ./stack-yaml-packages.nix stackagePackages;
in stackagePackages.shellFor {
  packages = _: lib.mapAttrsToList (_: pkg: pkg) stackYamlPackages;
}

Where stack-yaml-packages.nix:

self: { inherit (self) foo bar; }

generated from stack.yaml

resolver: lts-0.0
projects:
  - foo
  - bar
extra-deps:
  - acme-missiles-0.1.0.0