diff --git a/configs/menstruation.nix b/configs/menstruation.nix new file mode 100644 index 0000000..8eb8435 --- /dev/null +++ b/configs/menstruation.nix @@ -0,0 +1,41 @@ +{ pkgs, lib, ... }: +let + backend = pkgs.callPackage {}; + telegram = pkgs.callPackage {}; + backendPort = 8000; +in +{ + containers.menstruation.autoStart = true; + containers.menstruation.config = { config, pkgs, ... }: { + services.redis.enable = true; + + systemd.services.menstruation-telegram = { + wants = [ + "network-online.target" + "menstruation-backend.service" + "redis.service" + ]; + wantedBy = [ "multi-user.target" ]; + environment = { + MENSTRUATION_TOKEN = lib.strings.fileContents ; + MENSTRUATION_ENDPOINT = "http://localhost:${toString backendPort}"; + MENSTRUATION_MODERATORS = "18980945"; + }; + serviceConfig = { + Restart = "always"; + DynamicUser = true; + ExecStart = "${telegram}/bin/menstruation-telegram"; + }; + }; + + systemd.services.menstruation-backend = { + wants = [ "network-online.target" ]; + environment.ROCKET_PORT = toString backendPort; + serviceConfig = { + Restart = "always"; + DynamicUser = true; + ExecStart = "${backend}/bin/menstruation_server"; + }; + }; + }; +} diff --git a/submodules/menstruation-telegram b/submodules/menstruation-telegram index 3eab0f8..d941ccb 160000 --- a/submodules/menstruation-telegram +++ b/submodules/menstruation-telegram @@ -1 +1 @@ -Subproject commit 3eab0f8e4c96f42350a70f425a12c0a31b5800fd +Subproject commit d941ccb4c1aa3874d099f77eebd790ffc4767002 diff --git a/systems/makanek/configuration.nix b/systems/makanek/configuration.nix index 68368e0..a7bf61d 100644 --- a/systems/makanek/configuration.nix +++ b/systems/makanek/configuration.nix @@ -59,6 +59,7 @@ in +