2019-01-02 12:10:28 +03:00
|
|
|
{ stdenv, lib
|
|
|
|
, coreutils, docker_compose, jq
|
|
|
|
}:
|
2019-03-26 16:06:50 +03:00
|
|
|
let
|
2019-01-02 11:54:46 +03:00
|
|
|
|
2019-06-23 22:27:13 +03:00
|
|
|
# TODO: Replace by a new expression for the new Haskell main
|
2019-03-26 16:06:50 +03:00
|
|
|
arion = stdenv.mkDerivation {
|
2019-01-02 11:54:46 +03:00
|
|
|
name = "arion";
|
|
|
|
src = ./src;
|
|
|
|
unpackPhase = "";
|
|
|
|
buildPhase = "";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/share/arion
|
|
|
|
cp -a nix $out/share/arion/
|
|
|
|
cp -a arion-image $out/share/arion/
|
2019-01-27 01:47:35 +03:00
|
|
|
tar -czf $out/share/arion/arion-image/tarball.tar.gz -C arion-image/tarball .
|
2019-01-02 11:54:46 +03:00
|
|
|
substitute arion $out/bin/arion \
|
2019-01-02 12:10:28 +03:00
|
|
|
--subst-var-by path ${lib.makeBinPath [jq coreutils docker_compose]} \
|
2019-01-02 11:54:46 +03:00
|
|
|
--subst-var-by nix_dir $out/share/arion/nix \
|
|
|
|
;
|
|
|
|
chmod a+x $out/bin/arion
|
|
|
|
'';
|
2019-03-26 16:06:50 +03:00
|
|
|
inherit passthru;
|
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
inherit eval build;
|
|
|
|
};
|
|
|
|
|
|
|
|
eval = import "${nix_dir}/eval-composition.nix";
|
|
|
|
|
|
|
|
build = args@{...}:
|
|
|
|
let composition = eval args;
|
|
|
|
in composition.config.build.dockerComposeYaml;
|
|
|
|
|
|
|
|
nix_dir = "${arion.outPath}/share/arion/nix";
|
|
|
|
|
|
|
|
in
|
|
|
|
arion
|