ark/hosts/wolumonde/modules/bernbot.nix

31 lines
670 B
Nix
Raw Normal View History

2022-07-30 10:44:10 +03:00
{
2023-05-08 23:09:44 +03:00
config,
2022-07-30 10:44:10 +03:00
inputs,
pkgs,
lib,
...
}: let
2023-08-23 14:06:38 +03:00
bernbotPkg = inputs.bernbot.packages.${pkgs.system}.bernbot-release;
2022-07-30 10:44:10 +03:00
in {
systemd.services.bernbot = {
description = "bernbot";
wantedBy = ["multi-user.target"];
after = ["network.target"];
serviceConfig = lib.mkMerge [
{
User = "bernbot";
ExecStart = "${bernbotPkg}/bin/bernbot";
Restart = "on-failure";
RestartSec = 5;
WorkingDirectory = "/var/lib/bernbot";
2023-05-08 23:09:44 +03:00
EnvironmentFile = config.age.secrets.bernbotToken.path;
2022-07-30 10:44:10 +03:00
}
];
};
users.users.bernbot = {
isSystemUser = true;
group = "bernbot";
};
users.groups.bernbot = {};
}