feat: initial setup media

This commit is contained in:
s-prechtl 2025-04-06 19:40:34 +02:00
parent cc3a71d755
commit 636a19debb
2 changed files with 330 additions and 4 deletions

View file

@ -1,17 +1,19 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# Edit this configuration file to define what should be installed on your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{
inputs,
config,
lib,
pkgs,
...
}: let
serverIP = "192.168.0.201";
pkgs-unstable = inputs.nixpkgs.legacyPackages.${pkgs.system};
in {
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
../../modules/nixos/qbittorrent.nix
];
# Use the systemd-boot EFI boot loader.
@ -22,6 +24,7 @@ in {
# Pick only one of the below networking options.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
networking.networkmanager.enable = true; # Easiest to use and most distros use this by default.
networking.firewall.allowedTCPPorts = [ 80 443 ];
# Set your time zone.
time.timeZone = "Europe/Vienna";
@ -71,8 +74,8 @@ in {
ports = [
"${serverIP}:53:53/tcp"
"${serverIP}:53:53/udp"
"80:80"
"443:443"
"12345:80"
"23456:443"
];
volumes = [
"/var/lib/pihole/:/etc/pihole/"
@ -90,5 +93,102 @@ in {
};
};
services.radarr = {
enable = true;
openFirewall = true;
dataDir = "/media/radarr";
group = "media";
};
services.sonarr = {
enable = true;
openFirewall = true;
dataDir = "/media/radarr";
group = "media";
};
services.readarr = {
enable = true;
openFirewall = true;
dataDir = "/media/radarr";
group = "media";
};
services.qbittorrent = {
enable = true;
openFirewall = true;
group = "media";
profileDir = "/media/qbittorrent";
serverConfig = {
LegalNotice.Accepted = true;
Preferences = {
WebUI = {
Username = "Spr3eZ";
Password_PBKDF2 = "@ByteArray(rSRSjyLjKHX4KeDHgtx8qA==:EdZC27+FdG0aFtqVtEsiuqQAA6NROdBRXVSySD6ktgBY7k9ORrq8Kgo2uIkXvAWssmMIFb+C3RZS2PMWAt/Ihw==)";
};
General.Locale = "en";
};
};
};
services.jackett = {
enable = true;
openFirewall = true;
dataDir = "/media/jackett";
package = pkgs-unstable.jackett;
};
services.jellyfin = {
enable = true;
openFirewall = true;
group = "media";
dataDir = "/media/jellyfin";
};
services.jellyseerr = {
enable = true;
openFirewall = true;
};
systemd.services.jellyseerr-restarter = {
enable = true;
description = "Restarts Jellyseerr on startup as that fixes it not loading anything and not recognizing anything for whatever reason.";
wantedBy = ["default.target"];
after = ["jellyseerr.service"];
script = ''
sleep 10
systemctl restart jellyseerr.service
'';
};
services.caddy = {
enable = true;
virtualHosts."jackett.saberofxebec".extraConfig = ''
reverse_proxy :9117
'';
virtualHosts."qbittorrent.saberofxebec".extraConfig = ''
reverse_proxy :8080
'';
virtualHosts."radarr.saberofxebec".extraConfig = ''
reverse_proxy :7878
'';
virtualHosts."sonarr.saberofxebec".extraConfig = ''
reverse_proxy :8989
'';
virtualHosts."readarr.saberofxebec".extraConfig = ''
reverse_proxy :8787
'';
virtualHosts."jellyfin.saberofxebec".extraConfig = ''
reverse_proxy :8787
'';
virtualHosts."jellyseer.saberofxebec".extraConfig = ''
reverse_proxy :8787
'';
virtualHosts."pihole.saberofxebec".extraConfig = ''
reverse_proxy :12345
'';
};
system.stateVersion = "24.11"; # Did you read the comment?
}