2024-02-04 18:38:04 +00:00
|
|
|
{ lib, ... }:
|
|
|
|
{
|
2024-02-08 21:06:07 +00:00
|
|
|
networking.nat.forwardPorts = [
|
|
|
|
{
|
|
|
|
destination = "192.168.100.11:51506";
|
|
|
|
proto = "tcp";
|
|
|
|
sourcePort = 51506;
|
|
|
|
}
|
|
|
|
{
|
|
|
|
destination = "192.168.100.11:51506";
|
|
|
|
proto = "udp";
|
|
|
|
sourcePort = 51506;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
|
|
|
containers.seedbox_test = {
|
2024-02-04 18:38:04 +00:00
|
|
|
autoStart = true;
|
|
|
|
privateNetwork = true;
|
2024-02-06 19:33:35 +00:00
|
|
|
hostAddress = "10.175.197.82";
|
2024-02-04 18:38:04 +00:00
|
|
|
localAddress = "192.168.100.11";
|
2024-02-08 21:06:07 +00:00
|
|
|
|
|
|
|
bindMounts = {
|
|
|
|
"/home" = {
|
|
|
|
hostPath = "/mnt/zbigdata/seedbox_test";
|
|
|
|
isReadOnly = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-02-04 18:38:04 +00:00
|
|
|
config = { config, pkgs, ... }: {
|
|
|
|
system.stateVersion = "24.05";
|
|
|
|
|
|
|
|
networking = {
|
|
|
|
firewall = {
|
|
|
|
enable = true;
|
|
|
|
};
|
|
|
|
useHostResolvConf = lib.mkForce false;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.resolved.enable = true;
|
2024-02-08 21:06:07 +00:00
|
|
|
|
|
|
|
# Custom stuff
|
|
|
|
environment.systemPackages = [ pkgs.qbittorrent-nox ];
|
|
|
|
|
|
|
|
networking.firewall = {
|
|
|
|
allowedTCPPorts = [ 51506 8888 ];
|
|
|
|
allowedUDPPorts = [ 51506 ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services.qbittorrent = {
|
|
|
|
after = [ "network.target" ];
|
|
|
|
description = "qBittorrent Daemon";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
path = [ pkgs.qbittorrent-nox ];
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.qbittorrent-nox}/bin/qbittorrent-nox \
|
|
|
|
--profile=/home/test/ \
|
|
|
|
--webui-port=51506
|
|
|
|
'';
|
|
|
|
Restart = "on-success";
|
|
|
|
User = "test";
|
|
|
|
Group = "test";
|
|
|
|
UMask = "0002";
|
|
|
|
LimitNOFILE = 8192;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
users.groups.test = {};
|
|
|
|
users.users.test = {
|
|
|
|
group = "test";
|
|
|
|
isNormalUser = true;
|
|
|
|
home = "/home/test";
|
|
|
|
};
|
2024-02-04 18:38:04 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|