nix/hosts/marvin/services/go-jamming.nix

40 lines
1 KiB
Nix

{pkgs, ...}: let
config = pkgs.writeText "config.json" ''
{
"baseURL": "https:/wm.thehedgehog.me",
"adminEmail": "me@thehedgehog.me",
"port": 6915,
"token": "VeryCoolToken",
"allowedWebmentionSources": [
"thehedgehog.me",
"blog.thehedgehog.me",
"mrhedgehog.xyz",
"mrhedgehog.blog"
],
"blacklist": [
"youtube.com"
]
}
'';
in {
systemd.services.go-jamming = {
after = [ "network.target" ];
description = "Go-Jamming Webmentions Server";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
User = "go-jamming";
Group = "go-jamming";
WorkingDirectory = "/var/lib/go-jamming";
ExecStart = "${pkgs.my-pkgs.go-jamming}/bin/go-jamming";
ExecStartPre = "${pkgs.coreutils}/bin/cp -f ${config} /var/lib/go-jamming/config.json";
SuccessExitStatus = 0;
};
};
users.users.go-jamming = {
group = "go-jamming";
isSystemUser = true;
};
users.groups.go-jamming = {};
}