minidlna
and transmission
on rock5b
This commit is contained in:
parent
6ce4914941
commit
d72b1c1f78
5 changed files with 54 additions and 9 deletions
|
@ -12,6 +12,8 @@
|
|||
"ssh"
|
||||
"ccr"
|
||||
"wireguard-client"
|
||||
"minidlna"
|
||||
"transmission"
|
||||
]
|
||||
++ [
|
||||
./disko.nix
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
"qmk-udev"
|
||||
"ssh"
|
||||
"mosh"
|
||||
"transmission"
|
||||
# "transmission"
|
||||
"udisks2"
|
||||
"xdg"
|
||||
"nix-development"
|
||||
|
|
|
@ -44,6 +44,8 @@
|
|||
};
|
||||
|
||||
config = lib.mkIf config.ccr.enable {
|
||||
ccr.extraGroups = ["wheel" "fuse" "networkmanager" "dialout"];
|
||||
|
||||
users.users.ccr = {
|
||||
uid = 1000;
|
||||
inherit (config.ccr) hashedPassword;
|
||||
|
|
19
modules/minidlna/default.nix
Normal file
19
modules/minidlna/default.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{config, ...}: {
|
||||
services.minidlna = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
settings = {
|
||||
friendly_name = config.networking.hostName;
|
||||
inotify = "yes";
|
||||
media_dir = [
|
||||
"/mnt/raid"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /mnt/raid/film 770 minidlna minidlna"
|
||||
];
|
||||
|
||||
ccr.extraGroups = ["minidlna"];
|
||||
}
|
|
@ -1,17 +1,39 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
{config, ...}: {
|
||||
services.transmission = {
|
||||
enable = true;
|
||||
openRPCPort = true;
|
||||
openPeerPorts = true;
|
||||
settings = {
|
||||
rpc-port = 9091;
|
||||
download-dir = "/mnt/raid/torrent";
|
||||
incomplete-dir = "/mnt/raid/torrent/.incomplete";
|
||||
|
||||
rpc-bind-address = "0.0.0.0";
|
||||
peer-port = 51413; # Forward both TCP and UDP on router traffic from router
|
||||
rpc-whitelist-enabled = false;
|
||||
rpc-host-whitelist-enabled = false;
|
||||
|
||||
upload-slots-per-torrent = 1000;
|
||||
|
||||
alt-speed-up = "1000"; # 1MB/s
|
||||
alt-speed-down = "2000"; # 3MB/s
|
||||
alt-speed-time-enabled = true;
|
||||
alt-speed-time-begin = 540; # 9AM, minutes after midnight
|
||||
alt-speed-time-end = 1380; # 11PM
|
||||
alt-speed-time-day = 127; # all days, bitmap, 0111110 is weekends and 1000001 is weekdays
|
||||
|
||||
ratio-limit-enabled = true;
|
||||
ratio-limit = 2;
|
||||
};
|
||||
};
|
||||
|
||||
users.users.ccr.extraGroups = ["transmission"];
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
config.services.transmission.settings.rpc-port
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"d /mnt/raid/torrent 770 transmission transmission"
|
||||
"d /mnt/raid/torrent/.incomplete 770 transmission transmission"
|
||||
];
|
||||
|
||||
ccr.extraGroups = ["transmission"];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue