Skip to content

Commit

Permalink
Disable fullyhacks-qrms; move some services to CS306
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Mar 12, 2024
1 parent 22a3122 commit cc3aae9
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 55 deletions.
78 changes: 23 additions & 55 deletions servers/cirno/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,59 +25,27 @@ in
};
};

systemd.services.sendlimiter =
let
extraArgs = [];
secrets = import <acm-aws/secrets/sendlimiter.nix>;
args = lib.concatStringsSep
" "
(map lib.escapeShellArg (extraArgs ++ secrets.channelIDs));
in {
enable = true;
description = "Send limiter Discord bot";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
BOT_TOKEN = secrets.botToken;
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.sendlimiter}/bin/sendlimiter ${args}";
Restart = "on-failure";
RestartSec = "1s";
};
};

services.christmasd-test = {
enable = true;
ledPointsFile = builtins.fetchurl
"https://gist.githubusercontent.com/diamondburned/1d9a83347e153686ca192c6f5baf0b79/raw/63b06ed82fd858bdb8b15a5971df92dd4bab40c3/led-points.csv";
extraFlags = {
http-addr = "unix://$RUNTIME_DIRECTORY/http.sock";
};
};

systemd.services."fullyhacks-qrms" =
let
tokenFile = <acm-aws/secrets/fullyhacks-token.txt>;
port = 38574;
in
{
enable = true;
description = "Fullyhacks QR Management System";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
Type = "simple";
DynamicUser = true;
ReadOnlyPaths = [ tokenFile ];
StateDirectory = "fullyhacks-qrms";
};
script = ''
${pkgs.fullyhacks-qrms}/bin/fullyhacks-qrms \
--root-token-file "${tokenFile}" \
--addr ":${builtins.toString port}" \
--db "$STATE_DIRECTORY/database.db"
'';
};
# systemd.services."fullyhacks-qrms" =
# let
# tokenFile = <acm-aws/secrets/fullyhacks-token.txt>;
# port = 38574;
# in
# {
# enable = true;
# description = "Fullyhacks QR Management System";
# after = [ "network-online.target" ];
# wantedBy = [ "multi-user.target" ];
# serviceConfig = {
# Type = "simple";
# DynamicUser = true;
# ReadOnlyPaths = [ tokenFile ];
# StateDirectory = "fullyhacks-qrms";
# };
# script = ''
# ${pkgs.fullyhacks-qrms}/bin/fullyhacks-qrms \
# --root-token-file "${tokenFile}" \
# --addr ":${builtins.toString port}" \
# --db "$STATE_DIRECTORY/database.db"
# '';
# };
}
32 changes: 32 additions & 0 deletions servers/cs306/services.nix
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ in
};
};

services.christmasd-test = {
enable = true;
ledPointsFile = builtins.fetchurl
"https://gist.githubusercontent.com/diamondburned/1d9a83347e153686ca192c6f5baf0b79/raw/63b06ed82fd858bdb8b15a5971df92dd4bab40c3/led-points.csv";
extraFlags = {
http-addr = "unix://$RUNTIME_DIRECTORY/http.sock";
};
};

systemd.services.sendlimiter =
let
extraArgs = [];
secrets = import <acm-aws/secrets/sendlimiter.nix>;
args = lib.concatStringsSep
" "
(map lib.escapeShellArg (extraArgs ++ secrets.channelIDs));
in {
enable = true;
description = "Send limiter Discord bot";
after = [ "network-online.target" ];
wantedBy = [ "multi-user.target" ];
environment = {
BOT_TOKEN = secrets.botToken;
};
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.sendlimiter}/bin/sendlimiter ${args}";
Restart = "on-failure";
RestartSec = "1s";
};
};

services.dischord = {
enable = true;
config = builtins.readFile <acm-aws/secrets/dischord-config.toml>;
Expand Down

0 comments on commit cc3aae9

Please sign in to comment.