add workout-sync

This commit is contained in:
Joakim Repomaa
2025-02-08 00:47:15 +02:00
parent 0b4e55e0b4
commit d32a5dc147
4 changed files with 53 additions and 1 deletions

View File

@@ -34,5 +34,6 @@
./workout-tracker.nix
./gotosocial.nix
./bin.nix
./workout-sync.nix
];
}

View File

@@ -0,0 +1,26 @@
{ pkgs, inputs, config, ... }:
let
fqdn = "ws.freun.dev";
port = 3344;
workout-sync = inputs.workout-sync.packages.${pkgs.system}.default;
in
{
systemd.services.workout-sync = {
enable = true;
description = "Workout sync service";
environment = {
PORT = toString port;
WORKOUT_TRACKER_URL = "http://localhost:${toString config.services.workout-tracker.port}";
};
serviceConfig = {
ExecStart = "${workout-sync}/bin/workout-sync";
Restart = "always";
DynamicUser = true;
EnvironmentFile = "/var/secrets/workout-sync.env";
};
wantedBy = [ "multi-user.target" ];
confinement.enable = true;
};
modules.webserver.vHosts.${fqdn}.locations."/".proxyPort = port;
}