2020-10-05 17:22:15 +03:00
|
|
|
{
|
|
|
|
description = "Arion - use Docker Compose via Nix";
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs }:
|
|
|
|
let
|
|
|
|
lib = import (nixpkgs + "/lib");
|
|
|
|
systems = [
|
|
|
|
"aarch64-linux"
|
|
|
|
"x86_64-darwin"
|
|
|
|
"x86_64-linux"
|
|
|
|
];
|
2020-10-05 18:38:48 +03:00
|
|
|
arionFromPkgs = pkgs: import ./nix/arion.nix { inherit pkgs; };
|
2020-10-05 17:22:15 +03:00
|
|
|
in {
|
|
|
|
|
2020-10-05 18:38:48 +03:00
|
|
|
# The overlay is currently the recommended way to integrate arion,
|
|
|
|
# because its arion attribute behaves just like Nixpkgs.
|
|
|
|
overlay = final: prev: {
|
|
|
|
arion = arionFromPkgs final;
|
|
|
|
};
|
|
|
|
|
2020-10-05 17:22:15 +03:00
|
|
|
packages = lib.genAttrs systems (system:
|
|
|
|
let
|
|
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
in
|
|
|
|
{
|
2020-10-05 18:38:48 +03:00
|
|
|
arion = arionFromPkgs pkgs;
|
2020-10-05 17:22:15 +03:00
|
|
|
});
|
|
|
|
|
2020-10-05 18:36:39 +03:00
|
|
|
# Does not include the eval and build functions like you may expect from Nixpkgs.
|
2020-10-05 17:22:15 +03:00
|
|
|
defaultPackage = lib.genAttrs systems (system:
|
|
|
|
self.packages.${system}.arion
|
|
|
|
);
|
|
|
|
|
2020-10-05 18:36:39 +03:00
|
|
|
lib = {
|
|
|
|
eval = import ./src/nix/eval-composition.nix;
|
|
|
|
build = args@{...}:
|
|
|
|
let composition = self.lib.eval args;
|
|
|
|
in composition.config.out.dockerComposeYaml;
|
|
|
|
};
|
|
|
|
|
2020-10-05 17:22:15 +03:00
|
|
|
};
|
|
|
|
}
|