2021-06-29 10:02:43 +02:00
|
|
|
{
|
|
|
|
description = "A simple, stateless NixOS deployment tool modeled after NixOps.";
|
|
|
|
|
|
|
|
inputs = {
|
|
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
|
|
|
utils.url = "github:numtide/flake-utils";
|
|
|
|
|
|
|
|
flake-compat = {
|
|
|
|
url = "github:edolstra/flake-compat";
|
|
|
|
flake = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = { self, nixpkgs, utils, ... }: let
|
2021-09-20 07:03:39 +02:00
|
|
|
supportedSystems = utils.lib.defaultSystems;
|
2021-06-29 10:02:43 +02:00
|
|
|
in utils.lib.eachSystem supportedSystems (system: let
|
|
|
|
pkgs = import nixpkgs { inherit system; };
|
|
|
|
in rec {
|
|
|
|
# We still maintain the expression in a Nixpkgs-acceptable form
|
2021-09-20 07:03:39 +02:00
|
|
|
defaultPackage = self.packages.${system}.colmena;
|
2021-11-18 07:21:00 +01:00
|
|
|
packages = rec {
|
|
|
|
colmena = import ./default.nix { inherit pkgs; };
|
|
|
|
|
2021-11-18 22:15:20 +01:00
|
|
|
# Full user manual
|
2021-11-18 07:21:00 +01:00
|
|
|
manual = let
|
|
|
|
colmena = self.packages.${system}.colmena;
|
|
|
|
evalNix = import ./src/nix/eval.nix {
|
|
|
|
hermetic = true;
|
|
|
|
};
|
|
|
|
deploymentOptionsMd = (pkgs.nixosOptionsDoc {
|
|
|
|
options = evalNix.docs.deploymentOptions pkgs;
|
|
|
|
}).optionsMDDoc;
|
|
|
|
metaOptionsMd = (pkgs.nixosOptionsDoc {
|
|
|
|
options = evalNix.docs.metaOptions pkgs;
|
|
|
|
}).optionsMDDoc;
|
|
|
|
in pkgs.callPackage ./manual {
|
|
|
|
inherit colmena deploymentOptionsMd metaOptionsMd;
|
|
|
|
};
|
|
|
|
|
2021-11-18 22:15:20 +01:00
|
|
|
# User manual without the CLI reference
|
2021-11-18 07:21:00 +01:00
|
|
|
manualFast = manual.override { colmena = null; };
|
2021-11-18 22:15:20 +01:00
|
|
|
|
|
|
|
# User manual with the version treated as stable
|
|
|
|
manualForceStable = manual.override { unstable = false; };
|
2021-11-18 07:21:00 +01:00
|
|
|
};
|
2021-06-29 10:02:43 +02:00
|
|
|
|
|
|
|
defaultApp = self.apps.${system}.colmena;
|
|
|
|
apps.colmena = {
|
|
|
|
type = "app";
|
|
|
|
program = "${defaultPackage}/bin/colmena";
|
|
|
|
};
|
|
|
|
|
|
|
|
devShell = pkgs.mkShell {
|
|
|
|
inputsFrom = [ defaultPackage ];
|
2021-11-18 22:15:20 +01:00
|
|
|
nativeBuildInputs = with pkgs; [ mdbook python3 ];
|
2021-06-29 11:04:54 +02:00
|
|
|
shellHook = ''
|
|
|
|
export NIX_PATH=nixpkgs=${pkgs.path}
|
|
|
|
'';
|
2021-06-29 10:02:43 +02:00
|
|
|
};
|
2021-09-20 07:03:39 +02:00
|
|
|
}) // {
|
|
|
|
overlay = final: prev: {
|
|
|
|
colmena = import ./default.nix {
|
|
|
|
pkgs = final;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-06-29 10:02:43 +02:00
|
|
|
}
|