mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-12-12 08:07:39 +03:00
38 lines
901 B
Nix
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
|