hnix-store/shell.nix

38 lines
901 B
Nix
Raw Normal View History

attrs@{...}:
2019-03-10 02:32:01 +03:00
let
inherit (import ./. attrs) pkgs haskellPackages;
2021-06-10 12:53:47 +03:00
hlib = pkgs.haskell.lib;
packages = [ "hnix-store-core" "hnix-store-remote" ];
2019-03-10 02:32:01 +03:00
extract-external-inputs = p:
2021-06-10 12:53:47 +03:00
builtins.filter
(dep: !(builtins.elem dep packages))
(map
(x: x.pname)
(hlib.getHaskellBuildInputs haskellPackages.${p}));
external-inputs =
map
(x: haskellPackages.${x})
(builtins.concatLists
(map
extract-external-inputs
packages));
metaPackage =
haskellPackages.mkDerivation
{ pname = "hnix-store-core";
version = "0.0.0.0";
libraryHaskellDepends = external-inputs;
license = pkgs.stdenv.lib.licenses.asl20;};
package-envs =
builtins.listToAttrs
(map
(p:
{ name = p;
value = haskellPackages.${p}.env;})
packages);
in
metaPackage.env // package-envs