1
0
Fork 0
mirror of https://git.sr.ht/~neverness/ultima synced 2025-01-10 02:53:53 +00:00
ultima/modules/nixos/programs/torrserver/default.nix

40 lines
665 B
Nix
Raw Normal View History

{
x,
pkgs,
lib,
config,
...
}:
2024-11-21 09:24:15 +00:00
with lib;
with x;
2024-11-21 09:24:15 +00:00
let
cfg = config.module.programs.torrserver;
torr = pkgs.callPackage ./package.nix { };
in
{
options = {
module.programs.torrserver = {
enable = mkBool;
};
};
2024-11-21 09:24:15 +00:00
config = mkIf cfg.enable {
systemd.services = {
torrserver = {
enable = true;
after = [
"multi-user.target"
"network.target"
];
2024-11-21 09:24:15 +00:00
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "${torr}/bin/torrserver";
Restart = "on-failure";
Type = "simple";
TimeoutSec = 30;
};
};
};
};
}