hnix-store/shell.nix
Richard Marko 69a02d3066 init hnix-store-nar
Closes #233
2023-11-22 11:16:17 +01:00

45 lines
1002 B
Nix

attrs@{...}:
let
inherit (import ./. attrs) pkgs haskellPackages;
hlib = pkgs.haskell.lib;
packages = [
"hnix-store-core"
"hnix-store-db"
"hnix-store-nar"
"hnix-store-readonly"
"hnix-store-remote"
"hnix-store-tests"
];
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-shell";
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