hnix-store/shell.nix
2023-11-11 19:00:21 +01:00

38 lines
901 B
Nix

attrs@{...}:
let
inherit (import ./. attrs) pkgs haskellPackages;
hlib = pkgs.haskell.lib;
packages = [ "hnix-store-core" "hnix-store-remote" ];
extract-external-inputs = p:
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