diff --git a/deployment/application.nix b/deployment/application.nix index 12326907..6a4225e7 100644 --- a/deployment/application.nix +++ b/deployment/application.nix @@ -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; }; + }; + }; + }); + }; }; } ]; diff --git a/deployment/runtime-environment.nix b/deployment/runtime-environment.nix new file mode 100644 index 00000000..e333af53 --- /dev/null +++ b/deployment/runtime-environment.nix @@ -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; + }; + + }); + }; + }; + }; + }; + }); + }; + }; +}