diff --git a/servers/cirno/secrets/pomo.nix b/secrets/pomo.nix similarity index 100% rename from servers/cirno/secrets/pomo.nix rename to secrets/pomo.nix diff --git a/servers/cirno/secrets/sendlimiter.nix b/secrets/sendlimiter.nix similarity index 100% rename from servers/cirno/secrets/sendlimiter.nix rename to secrets/sendlimiter.nix diff --git a/secrets/terraform.tfstate b/secrets/terraform.tfstate index af14404..b01bea9 100644 Binary files a/secrets/terraform.tfstate and b/secrets/terraform.tfstate differ diff --git a/secrets/terraform.tfstate.backup b/secrets/terraform.tfstate.backup index e03d85b..0c105d8 100644 Binary files a/secrets/terraform.tfstate.backup and b/secrets/terraform.tfstate.backup differ diff --git a/servers/cirno/secrets/triggers-env.nix b/secrets/triggers-env.nix similarity index 100% rename from servers/cirno/secrets/triggers-env.nix rename to secrets/triggers-env.nix diff --git a/servers/cirno/configuration.nix b/servers/cirno/configuration.nix index f994657..31e2a1c 100644 --- a/servers/cirno/configuration.nix +++ b/servers/cirno/configuration.nix @@ -52,40 +52,10 @@ in }; }; - systemd.services.triggers = { - enable = true; - description = "Triggers (Crying Counter) Discord bot"; - after = [ "network-online.target" ]; - wantedBy = [ "multi-user.target" ]; - environment = import ./secrets/triggers-env.nix; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.triggers}/bin/triggers"; - DynamicUser = true; - Restart = "on-failure"; - RestartSec = "1s"; - }; - }; - - systemd.services.pomo = { - enable = true; - description = "Pomodoro timer server/Discord bot"; - after = [ "network-online.target" ]; - wantedBy = [ "multi-user.target" ]; - environment = import ./secrets/pomo.nix; - serviceConfig = { - Type = "simple"; - ExecStart = "${pkgs.pomo}/bin/pomo"; - DynamicUser = true; - Restart = "on-failure"; - RestartSec = "1s"; - }; - }; - systemd.services.sendlimiter = let extraArgs = []; - secrets = import ./secrets/sendlimiter.nix; + secrets = import ; args = lib.concatStringsSep " " (map lib.escapeShellArg (extraArgs ++ secrets.channelIDs)); diff --git a/servers/cs306/services.nix b/servers/cs306/services.nix index 5268c54..92d9399 100644 --- a/servers/cs306/services.nix +++ b/servers/cs306/services.nix @@ -3,7 +3,7 @@ { imports = [ ./caddy - ]; + ]; systemd.services.quizler = { enable = true; @@ -30,4 +30,34 @@ RestrictNetworkInterfaces = "lo"; # enough for localhost }; }; + + systemd.services.triggers = { + enable = true; + description = "Triggers (Crying Counter) Discord bot"; + after = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + environment = import ; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.triggers}/bin/triggers"; + DynamicUser = true; + Restart = "on-failure"; + RestartSec = "1s"; + }; + }; + + systemd.services.pomo = { + enable = true; + description = "Pomodoro timer server/Discord bot"; + after = [ "network-online.target" ]; + wantedBy = [ "multi-user.target" ]; + environment = import ; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.pomo}/bin/pomo"; + DynamicUser = true; + Restart = "on-failure"; + RestartSec = "1s"; + }; + }; }