shell.nix: layouting

This commit is contained in:
Anton-Latukha 2021-06-10 12:53:47 +03:00 committed by Anton Latukha
parent 0eb0e023c9
commit d390fcda7d

View File

@ -1,19 +1,36 @@
let
packages = [ "hnix-store-core" "hnix-store-remote" ];
inherit (import ./. {}) pkgs haskellPackages;
hslib = pkgs.haskell.lib;
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) (hslib.getHaskellBuildInputs haskellPackages.${p}));
external-inputs = map (x: haskellPackages.${x}) (builtins.concatLists
(map extract-external-inputs packages));
package-envs = builtins.listToAttrs (map (p: {
name = p;
value = haskellPackages.${p}.env;
}) packages);
in (haskellPackages.mkDerivation {
pname = "hnix-store-core";
version = "0.0.0.0";
libraryHaskellDepends = external-inputs;
license = pkgs.stdenv.lib.licenses.asl20;
}).env // package-envs
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