arion/nix/overlay.nix

57 lines
1.8 KiB
Nix
Raw Normal View History

2019-06-14 16:10:37 +02:00
self: super:
let
inherit (self.arion-project) haskellPkgs;
inherit (super) lib;
2019-06-23 21:27:13 +02:00
srcDir = ../src; # TODO gitignoreSource + whitelist nix and arion-image
eval = import (srcDir + "/nix/eval-composition.nix");
build = args@{...}:
let composition = eval args;
in composition.config.build.dockerComposeYaml;
hlib = super.haskell.lib;
2019-06-14 16:10:37 +02:00
in
{
2019-06-23 21:27:13 +02:00
2019-06-15 22:07:20 +02:00
arion-v0 = super.callPackage ../arion.nix {};
2019-06-23 21:27:13 +02:00
arion = hlib.justStaticExecutables (hlib.overrideCabal haskellPkgs.arion-compose (o: {
buildTools = o.buildTools ++ [super.makeWrapper];
2019-06-23 21:27:13 +02:00
passthru = o.passthru // {
inherit eval build;
};
pname = "arion"; # Cover up the needlessly long Haskell package name
# PYTHONPATH
#
# We close off the python module search path!
#
# Accepting directories from the environment into the search path
# tends to break things. Docker Compose does not have a plugin
# system as far as I can tell, so I don't expect this to break a
# feature, but rather to make the program more robustly self-
# contained.
postInstall = ''${o.postInstall or ""}
mkdir -p $out/libexec
mv $out/bin/arion $out/libexec
makeWrapper $out/libexec/arion $out/bin/arion \
--unset PYTHONPATH \
--prefix PATH : ${lib.makeBinPath [ self.docker-compose ]} \
;
'';
2019-06-23 21:27:13 +02:00
}));
tests = super.callPackage ../tests {};
2019-03-03 23:42:40 +01:00
doc = super.callPackage ../doc {};
2019-06-14 16:10:37 +02:00
arion-project = super.recurseIntoAttrs {
haskellPkgs = super.haskellPackages.extend (import ./haskell-overlay.nix self super);
shell = haskellPkgs.shellFor {
packages = p: [p.arion-compose];
buildInputs = [
haskellPkgs.cabal-install
haskellPkgs.ghcid
2019-09-27 21:01:57 +02:00
super.docker-compose
2019-06-14 16:10:37 +02:00
];
};
};
}