WIP: sketch domain data model

This commit is contained in:
Valentin Gagarin 2025-06-10 15:45:14 +02:00 committed by Kiara Grouwstra
parent f89162cc48
commit 2ec1979f1a
Signed by: kiara
SSH key fingerprint: SHA256:COspvLoLJ5WC5rFb9ZDe5urVCkK4LJZOsjfF4duRJFU
2 changed files with 60 additions and 0 deletions

View file

@ -24,6 +24,12 @@ with types;
};
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 = [
@ -33,6 +39,19 @@ with types;
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; };
};
};
});
};
};
}
];

View file

@ -0,0 +1,41 @@
{
lib,
...
}:
let
inherit (lib) types mkOption;
in
{
options = {
infrastructure = mkOption {
description = "Infrastructure for Fediversity applications to run on";
type =
with types;
attrsOf (attrTag {
single-nixos-machine-via-usb = mkOption {
type =
with types;
submodule {
# TODO: maybe steal some data structures from NixOS
options = {
hasNetwork = mkOption {
type = types.bool;
};
disks = mkOption {
type =
with types;
attrsOf (submodule {
options.size = mkOption {
type = types.bytes;
};
});
};
};
};
};
});
};
};
}