configuration.nix/home/services/transmission.nix

31 lines
1,017 B
Nix
Raw Permalink Normal View History

2024-03-24 08:27:13 +05:30
{ config, pkgs, ... }: {
systemd.user.services = {
transmission-daemon =
let
torrents-dir = "${config.xdg.userDirs.download}/Torrents";
transmission-daemon = "${pkgs.transmission_4}/bin/transmission-daemon";
in
{
Unit = {
Description = "Transmission Daemon";
Documentation = [ "man:transmission-daemon(1)" ];
};
Install = {
WantedBy = [ "default.target" ];
};
Service = {
2024-03-31 03:35:09 +05:30
Type = "notify";
2024-03-24 08:27:13 +05:30
ExecStart = ''
2024-03-31 13:42:47 +05:30
${transmission-daemon} -f --log-level=error --encryption-preferred --portmap --dht --lpd --utp --peerport 41414 --port 9092 \
2024-04-13 15:03:51 +05:30
--allowed 127.0.0.1,10.10.10.* \
2024-03-29 11:36:56 +05:30
-c "${torrents-dir}/init" \
--incomplete-dir "${torrents-dir}/.incomplete" \
--download-dir "${torrents-dir}/downloads" \
2024-03-24 08:27:13 +05:30
'';
2024-03-31 22:29:03 +05:30
ExecStop = "kill -s STOP $MAINPID";
ExecReload = "kill -s HUP $MAINPID";
2024-03-24 08:27:13 +05:30
};
};
};
}