flakify better

Signed-off-by: Xe <me@christine.website>
This commit is contained in:
Cadey Ratio 2022-02-19 14:19:28 -05:00
parent 9b0a391482
commit 58947b7571
1 changed files with 23 additions and 1 deletions

View File

@ -43,6 +43,28 @@
RUST_SRC_PATH = rustPlatform.rustLibSrc; RUST_SRC_PATH = rustPlatform.rustLibSrc;
}; };
}); nixosModule = { config, lib }: {
options.xeserv.mara-bot.enable = lib.mkEnableOption "enable Mara bot";
config = lib.mkIf config.xeserv.mara-bot.enable {
users.users.mara-bot = {
createHome = true;
isSystemUser = true;
home = "/var/lib/mara-bot";
};
systemd.services.mara-bot = {
wantedBy = [ "multi-user.target" ];
environment.RUST_LOG = "tower_http=debug,info";
serviceConfig = {
User = "mara-bot";
Group = "mara-bot";
Restart = "always";
ConditionPathExists = "/var/lib/mara-bot/config.yaml";
WorkingDirectory = "/var/lib/mara-bot";
};
};
};
};
});
} }