I have a software application that can be created and installed using stack . I would also like to offer a binary package for Linux and Mac. For this, I am considering nix because, by the way, it can be used on Linux and Mac. This will save me from having to support two types of packages.
After reading about how nix packages are defined, I expect that a stack based project can be built with a configuration that looks like this:
{ stdenv, fetchurl, stack }: # we need to depend on stack stdenv.mkDerivation { name = "some-haskell-package-0.1"; builder = ./builder.sh; # here we would call `stack install` src = fetchurl { # ... }; }
Looking at available resources on the Internet, I cannot find any description of how this can be done. I don't know if that means stack and nix not meant to be used that way.
The only thing I could find in the guide: how stack can use nix , and stack to nix .
I am also open to alternatives for multi-platform packaging.
source share