forked from fediversity/fediversity
75 lines
2.6 KiB
Nix
75 lines
2.6 KiB
Nix
{
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
inherit (lib) types mkOption;
|
|
in
|
|
{
|
|
options = {
|
|
enable = lib.mkEnableOption "Fediversity configuration";
|
|
applications = mkOption {
|
|
description = "Collection of NixOS modules, each implementing a Fediversity application";
|
|
type =
|
|
with types;
|
|
attrsOf (submoduleWith {
|
|
class = "nixos";
|
|
description = "A Fediversity application";
|
|
modules = [
|
|
(application: {
|
|
options = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
};
|
|
# this seems part of the abstract one as well
|
|
module = mkOption {
|
|
default = "The NixOS module to compose into an operator's configuration";
|
|
type = types.deferredModule;
|
|
};
|
|
# wait, so this isn't the abstract application but a deployed one huh
|
|
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 = {
|
|
};
|
|
});
|
|
};
|
|
});
|
|
};
|
|
});
|
|
};
|
|
};
|
|
})
|
|
];
|
|
});
|
|
};
|
|
};
|
|
}
|