forked from fediversity/fediversity
WIP: sketch domain data model
This commit is contained in:
parent
f9645b9384
commit
df926fee34
2 changed files with 60 additions and 0 deletions
|
|
@ -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; };
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
|
|
|
|||
41
deployment/runtime-environment.nix
Normal file
41
deployment/runtime-environment.nix
Normal 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;
|
||||
};
|
||||
|
||||
});
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue