add transmission module for downloads bt torrent

This commit is contained in:
ulic-youthlic 2025-01-24 17:06:45 +08:00
parent 5611e67d44
commit fd2fe39655
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
6 changed files with 92 additions and 0 deletions

View file

@ -37,6 +37,7 @@
unixName = "david";
};
open-webui.enable = true;
transmission.enable = true;
};
gui.enabled = "cosmic";
};

View file

@ -28,6 +28,7 @@
./kanata.nix
./kvm.nix
./open-webui.nix
./transmission.nix
];
config = {

View file

@ -0,0 +1,38 @@
{
pkgs,
config,
lib,
inputs,
rootPath,
...
}:
let
cfg = config.youthlic.programs.transmission;
in
{
options = {
youthlic.programs.transmission = {
enable = lib.mkEnableOption "transmission";
};
};
config = lib.mkIf cfg.enable {
users.groups."${config.services.transmission.group}".members = [
config.youthlic.home-manager.unixName
];
sops.secrets."transmission-config" = {
sopsFile = rootPath + "/secrets/transmission.yaml";
};
services.transmission = {
enable = true;
package = pkgs.transmission_4;
settings = {
utp-enabled = true;
watch-dir-enabled = true;
default-trackers = builtins.readFile "${inputs.bt-tracker}/all.txt";
};
openRPCPort = true;
openPeerPorts = true;
credentialsFile = "${config.sops.secrets.transmission-config.path}";
};
};
}