diff --git a/fediversity/default.nix b/fediversity/default.nix index 379b1b2..5ff0883 100644 --- a/fediversity/default.nix +++ b/fediversity/default.nix @@ -31,6 +31,19 @@ in { pixelfed.enable = mkEnableOption "default Fediversity Pixelfed configuration"; peertube.enable = mkEnableOption "default Fediversity PeerTube configuration"; + temp = mkOption { + description = "options that are only used while developing; should be removed eventually"; + default = {}; + type = types.submodule { + options = { + cores = mkOption { + description = "number of cores; should be obtained from NixOps4"; + type = types.int; + }; + }; + }; + }; + internal = mkOption { description = "options that are only meant to be used internally; change at your own risk"; default = {}; diff --git a/fediversity/mastodon.nix b/fediversity/mastodon.nix index d19edca..14568a7 100644 --- a/fediversity/mastodon.nix +++ b/fediversity/mastodon.nix @@ -66,6 +66,10 @@ lib.mkIf (config.fediversity.enable && config.fediversity.mastodon.enable) { localDomain = config.fediversity.internal.mastodon.domain; configureNginx = true; + # from the documentation: recommended is the amount of your CPU cores minus + # one. but it also must be a positive integer + streamingProcesses = lib.max 1 (config.fediversity.temp.cores - 1); + # TODO: configure a mailserver so this works smtp = { fromAddress = "noreply@${config.fediversity.internal.mastodon.domain}"; diff --git a/vm/mastodon-vm.nix b/vm/mastodon-vm.nix index b9d28b1..ecf880c 100644 --- a/vm/mastodon-vm.nix +++ b/vm/mastodon-vm.nix @@ -8,16 +8,14 @@ enable = true; domain = "localhost"; mastodon.enable = true; + + temp.cores = config.virtualisation.cores; }; services.mastodon = { extraConfig = { EMAIL_DOMAIN_ALLOWLIST = "example.com"; }; - - # from the documentation: recommended is the amount of your CPU cores - # minus one. but it also must be a positive integer - streamingProcesses = lib.max 1 (config.virtualisation.cores - 1); }; security.acme = lib.mkVMOverride {