Compare commits

..

2 Commits

Author SHA1 Message Date
Noah Masur
fa797c81f8 add sabnzbd 2023-06-03 23:00:18 +00:00
Noah Masur
d243d68c72 merge swan hardware file into host config 2023-06-03 11:12:04 -04:00
3 changed files with 27 additions and 46 deletions

View File

@ -9,21 +9,27 @@ nixpkgs.lib.nixosSystem {
system = "x86_64-linux"; system = "x86_64-linux";
specialArgs = { }; specialArgs = { };
modules = [ modules = [
./hardware-configuration.nix
../../modules/common
../../modules/nixos
globals globals
wsl.nixosModules.wsl
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
disko.nixosModules.disko disko.nixosModules.disko
../../modules/common
../../modules/nixos
{ {
# Hardeware
server = true; server = true;
networking.hostName = "swan"; networking.hostName = "swan";
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
powerManagement.cpuFreqGovernor = "powersave";
hardware.cpu.intel.updateMicrocode = true;
# ZFS
zfs.enable = true;
# head -c 8 /etc/machine-id # head -c 8 /etc/machine-id
networking.hostId = "600279f4"; # Random ID required for ZFS networking.hostId = "600279f4"; # Random ID required for ZFS
zfs.enable = true;
disko = { disko = {
enableConfig = true; enableConfig = true;
devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; }); devices = (import ../../disks/root.nix { disk = "/dev/nvme0n1"; });

View File

@ -1,39 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
boot.initrd.availableKernelModules =
[ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
# fileSystems."/" = {
# device = "/dev/disk/by-label/nixos";
# fsType = "ext4";
# };
#
# fileSystems."/boot" = {
# device = "/dev/disk/by-label/boot";
# fsType = "vfat";
# };
swapDevices = [ ];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.enp0s31f6.useDHCP = lib.mkDefault true;
# networking.interfaces.wlp3s0.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@ -1,4 +1,4 @@
{ config, lib, ... }: { { config, pkgs, lib, ... }: {
options = { options = {
arrServer = lib.mkOption { arrServer = lib.mkOption {
@ -14,11 +14,14 @@
services.radarr.enable = true; services.radarr.enable = true;
services.bazarr.enable = true; services.bazarr.enable = true;
services.prowlarr.enable = true; services.prowlarr.enable = true;
services.sabnzbd.enable = true;
unfreePackages = [ "unrar" ]; # Required for sabnzbd
# Grant users access to destination directories # Grant users access to destination directories
users.users.sonarr.extraGroups = [ "jellyfin" ]; users.users.sonarr.extraGroups = [ "jellyfin" ];
users.users.radarr.extraGroups = [ "jellyfin" ]; users.users.radarr.extraGroups = [ "jellyfin" ];
users.users.bazarr.extraGroups = [ "jellyfin" ]; users.users.bazarr.extraGroups = [ "jellyfin" ];
users.users.sabnzbd.extraGroups = [ "jellyfin" ];
# Requires updating the base_url config value in each service # Requires updating the base_url config value in each service
# If you try to rewrite the URL, the service won't redirect properly # If you try to rewrite the URL, the service won't redirect properly
@ -67,6 +70,17 @@
upstreams = [{ dial = "localhost:6767"; }]; upstreams = [{ dial = "localhost:6767"; }];
}]; }];
} }
{
group = "download";
match = [{
host = [ config.arrServer ];
path = [ "/sabnzbd*" ];
}];
handle = [{
handler = "reverse_proxy";
upstreams = [{ dial = "localhost:8085"; }];
}];
}
]; ];
}; };