parent
9b0a391482
commit
58947b7571
24
flake.nix
24
flake.nix
|
@ -43,6 +43,28 @@
|
|||
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";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue