arion/flake.nix

43 lines
1 KiB
Nix
Raw Normal View History

2020-10-05 16:22:15 +02: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 17:38:48 +02:00
arionFromPkgs = pkgs: import ./nix/arion.nix { inherit pkgs; };
2020-10-05 16:22:15 +02:00
in {
2020-10-05 17:38:48 +02: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 16:22:15 +02:00
packages = lib.genAttrs systems (system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
2020-10-05 17:38:48 +02:00
arion = arionFromPkgs pkgs;
2020-10-05 16:22:15 +02:00
});
2020-10-05 17:36:39 +02:00
# Does not include the eval and build functions like you may expect from Nixpkgs.
2020-10-05 16:22:15 +02:00
defaultPackage = lib.genAttrs systems (system:
self.packages.${system}.arion
);
2020-10-05 17:36:39 +02: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 16:22:15 +02:00
};
}