forked from Fediversity/Fediversity
50 lines
1.4 KiB
Nix
50 lines
1.4 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";
|
|
example.hello = {
|
|
enable = true;
|
|
module = {pkgs, ...}: {
|
|
environment.systemPackages = [ pkgs.hello ];
|
|
};
|
|
};
|
|
type = with types; attrsOf (submoduleWith {
|
|
class = "nixos";
|
|
description = "A Fediversity application";
|
|
modules = [
|
|
(application: {
|
|
options = {
|
|
enable = mkOption {
|
|
type = types.bool;
|
|
};
|
|
module = mkOption {
|
|
default = "The NixOS module to compose into an operator's configuration"
|
|
type = types.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; };
|
|
};
|
|
};
|
|
});
|
|
};
|
|
};
|
|
})
|
|
];
|
|
});
|
|
};
|
|
}
|