{ lib, config, True, ... }: with lib; let cfg = config.module.services.transmission; in { options = { module.services.transmission = { enable = mkEnableOption ""; }; }; config = mkIf cfg.enable { systemd.services.transmission.serviceConfig.UMask = lib.mkForce "0037"; services.transmission = True // { home = "/var/lib/transmission"; downloadDirPermissions = "777"; performanceNetParameters = true; openRPCPort = true; openPeerPorts = true; settings = let home = config.services.transmission.home; in { peer-limit-per-torrent = 5; upload-slots-per-torrent = 2; download-dir = "${home}/Completed"; incomplete-dir = "${home}/.incompleted"; }; }; }; }