mirror of
https://github.com/haskell-nix/hnix-store.git
synced 2024-11-30 12:53:11 +03:00
shell.nix: layouting
This commit is contained in:
parent
0eb0e023c9
commit
d390fcda7d
49
shell.nix
49
shell.nix
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user