stackage2nix
stackage2nix copied to clipboard
Generate Nix build instructions from a Stack file
Parse Cabal flags section from stack.yaml file, and produce appropriate Nix overrides. ``` flags: package-name: flag-name: true ``` https://docs.haskellstack.org/en/stable/yaml_configuration/#flags https://docs.haskellstack.org/en/stable/GUIDE/#cabal-flag-management
``` $ nix-build nix/stackage2nix these derivations will be built: /nix/store/6zycxh4iczz9qxzffyb7ickackcjl68f-stm-2.4.4.1.drv /nix/store/02n9vy745g7ca51b9ifaiw44pfml1ng9-stm-chans-3.0.0.4.drv /nix/store/6gpzsb5lp646frvl83jsgzpfp1jbadnm-text-1.2.2.2.drv /nix/store/83jx78vanwx9j4hn52qnp01rda2iz2yh-hashable-1.2.6.1.drv /nix/store/79h11zq7mdpd4ik5bk4vzbcpwg22qr8n-unordered-containers-0.2.8.0.drv /nix/store/59ilnzy1c77z2ig2sr8i99kn56mpp1ri-integer-logarithms-1.0.2.drv /nix/store/6dfwf8vmp5abfa924a7dpq244y32fp9a-primitive-0.6.2.0.drv /nix/store/aqf8b6wp7r9xb9vsiq7abll5rhfr2yik-scientific-0.3.5.1.drv /nix/store/97kaqsfl3il3pifkigxkji1nvcygn85c-attoparsec-0.13.1.0.drv /nix/store/bfxckvbg6ibi6awz1d2sfy7axsh22nl9-base-compat-0.9.3.drv /nix/store/flbxmyh9la7jx7nv20wp4k34jw46qsz8-dlist-0.8.0.3.drv /nix/store/dj2d4f7c6112vnd1jmyka8aix6pn7jk2-transformers-compat-0.5.1.4.drv /nix/store/k1b5ji03kfv5f0nl6jyyyhvjlkqkm1s7-tagged-0.8.5.drv /nix/store/1rlaxsp2kjmb4nwizcsw0hfc638rd9x0-random-1.1.drv /nix/store/pvn3rsrsrln55phn6vi0x7dydv1n380j-uuid-types-1.0.3.drv /nix/store/ynyk5nzy2kdv2vz8kx33128mkk95zssm-vector-0.12.0.1.drv /nix/store/zqql05y47bhjdfffrd0pvryjh02mz6n3-time-locale-compat-0.1.1.3.drv /nix/store/06s32wzjs27f58al4zg15jb5xk6y2q80-aeson-1.1.2.0.drv /nix/store/2wkw2f3clwx08yg8h0y62s2mpdvx76zr-semigroups-0.18.3.drv /nix/store/r3kxi73kffxz64qjyrflsgi0194frdyj-Cabal-2.0.0.2.drv /nix/store/4sa45wqk2213xxmj3f7hijxk6yy7s5kc-cabal-doctest-1.0.2.drv...
`packages.nix` need only be regenerated when the resolver changes (and if the user has made changes to `packages-configuration.nix`, regenerating when not needed is actively harmful), whereas `default.nix` might more frequent...
If additional dependencies are specified in stack.yaml, as per: ``` nix: packages: [ openssl ] ``` they should be added to the package configuration using `addBuildDepend` for the packages defined...