{ config, pkgs, lib, ... }: let sabnzbdPort = 8080; dataDir = "/var/lib/sabnzbd"; downloadDir = "/downloads"; mediaDir = "/media"; sabnzbdUserId = config.users.users.nix-apps.uid; sabnzbdGroupId = config.users.groups.jallen-nas.gid; package = pkgs.sabnzbd; in { containers.sabnzbd = { autoStart = true; privateNetwork = true; hostAddress = "10.0.1.18"; localAddress = "10.0.2.20"; config = { config, pkgs, lib, ... }: { # Enable sabnzbd service services.sabnzbd = { enable = true; openFirewall = true; }; networking = { # Use systemd-resolved inside the container # Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686 useHostResolvConf = lib.mkForce false; }; services.resolved.enable = true; system.stateVersion = "23.11"; }; }; networking.nat = { forwardPorts = [ { destination = "10.0.2.20:8080"; sourcePort = sabnzbdPort; } ]; }; }