Fediversity/deployment/application.nix
2025-06-20 09:30:57 +02:00

83 lines
2.6 KiB
Nix

{
lib,
...
}:
let
inherit (lib) types mkOption;
in
with types;
{
options = {
runtime-environments = mkOption {
type = attrsOf (attrTag {
nixos = mkOption {
type = submodule {
options = {
module = mkOption {
description = "The NixOS module of the run-time environment";
type = deferredModule;
};
};
};
};
});
};
applications = mkOption {
description = "Collection of NixOS modules, each implementing a Fediversity application";
example.hello = {
enable = true;
module = {pkgs, ...}: {
environment.systemPackages = [ pkgs.hello ];
};
};
type = attrsOf (submoduleWith {
description = "A Fediversity application";
modules = [
{
options = {
module = mkOption {
description = "The NixOS module to compose into an operator's configuration";
type = deferredModule;
};
components = mkOption {
type = with types; attrsOf (attrTag {
file-system-state = mkOption {
desciption = "files stored by the application";
type = with types; attrsOf (submodule {
options.minSize = types.bytes;
});
database-state = mkOption {
desciption = "state stored in databases by the application";
type =
with types;
attrsOf (submodule {
postgresql = mkOption {
desciption = "state stored in PostgreSQL by the application";
type =
with types;
attrsOf (submodule {
options = {
};
});
};
key-val = mkOption {
desciption = "state stored in a key-value store by the application";
type =
with types;
attrsOf (submodule {
options = {
};
});
};
});
};
};
});
};
};
}
];
});
};
};
}