Add a homepage module that generates a static landing page served on port 9999 via nginx. Each service module registers itself via the shared mod.homepage.services option, so enabling a module automatically adds it to the page.
55 lines
1.1 KiB
Nix
55 lines
1.1 KiB
Nix
{
|
|
pkgs,
|
|
lib,
|
|
config,
|
|
...
|
|
}:
|
|
let
|
|
enabled = config.mod.transmission.enable;
|
|
in
|
|
{
|
|
options = {
|
|
mod.transmission = {
|
|
enable = lib.mkEnableOption "enable transmission module";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf enabled {
|
|
mod.homepage.services = [{
|
|
name = "Transmission";
|
|
port = 9091;
|
|
description = "Torrent client";
|
|
}];
|
|
|
|
services = {
|
|
transmission = {
|
|
enable = true;
|
|
package = pkgs.transmission_4;
|
|
|
|
openFirewall = true;
|
|
|
|
user = "storage";
|
|
group = "storage";
|
|
|
|
home = "/mnt/media/public/.ts-home";
|
|
downloadDirPermissions = "775";
|
|
|
|
settings = {
|
|
incomplete-dir-enabled = false;
|
|
download-dir = "/mnt/media/public/downloads";
|
|
|
|
rpc-bind-address = "0.0.0.0";
|
|
|
|
# Required to have empty user/pass to satisfy transmissionA
|
|
# https://github.com/transmission/transmission/discussions/1941#discussioncomment-1472352
|
|
rpc-whitelist-enabled = false;
|
|
rpc-authentication-required = true;
|
|
rpc-username = "";
|
|
rpc-password = "";
|
|
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|