Fediversity/deployment/application.nix

61 lines
1.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;
});
example = {
"/foo/bar/baz" = { minSize = 1024; };
};
};
});
};
};
}
];
});
};
};
}