>> I am to package Stack project which >> >> 1) depends on old lts-2.21 package set from stackage >> 2) doesn't have .cabals anymore, only .yamls. >> >> The question is basically How to do it? > > Run "hpack" to generate the Cabal files. Then run "cabal2nix" to > generate the Nix files. Add those Nix builds to Nixpkgs as explained in > the user's manual at: > > > http://nixos.org/nixpkgs/manual/#how-to-create-nix-builds-for-your-own-private-haskell-packages >
OK, I've managed to create a prototype nix-shell script to packaging (not simply building) dependencies for a Stack project. Parameters are explained in its header. https://github.com/grwlf/nixcfg/blob/unstable/ideas/unstack.sh It works by 1) Calling stack list-dependencies 2) Calling cabal2nix for every dependency 3) Producing top-level all.nix expression The script is not for end-users yet, it doesn't produce final expression to build the Stack project, only its dependencies. Also, small modification of pkgs/development/haskell-modules/default.nix is required: One should replace line `inherit mkDerivation callPackage;` with `inherit mkDerivation callPackage callPackageWithScope;`. Thus, callPackageWithScope function will be accessible for the script. Regards, Sergey _______________________________________________ nix-dev mailing list nix-dev@lists.science.uu.nl http://lists.science.uu.nl/mailman/listinfo/nix-dev