From 1b1893b26729ae6510193081a98139adc4edc1bc Mon Sep 17 00:00:00 2001 From: xqtc161 Date: Sun, 31 Mar 2024 01:29:35 +0100 Subject: [PATCH] nginx shenanigans --- common/default.nix | 3 +++ hosts/x86_64-linux/seraphim/default.nix | 6 ++++-- hosts/x86_64-linux/seraphim/jellyfin.nix | 14 ++++++++++++++ hosts/x86_64-linux/seraphim/monitoring.nix | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 hosts/x86_64-linux/seraphim/jellyfin.nix diff --git a/common/default.nix b/common/default.nix index 790ed7f..ccdfac3 100644 --- a/common/default.nix +++ b/common/default.nix @@ -6,6 +6,9 @@ ... }: { #nixpkgs.config.permittedInsecurePackages = ["electron-25.9.0" "electron-24.8.6"]; + networking.hosts = { + "192.168.178.35" = [ "jellyfin.fritz.box" "grafana.fritz.box" ]; + }; environment.systemPackages = with pkgs; [ xdg-desktop-portal-hyprland xdg-desktop-portal diff --git a/hosts/x86_64-linux/seraphim/default.nix b/hosts/x86_64-linux/seraphim/default.nix index 7c8ec82..cf25cb9 100644 --- a/hosts/x86_64-linux/seraphim/default.nix +++ b/hosts/x86_64-linux/seraphim/default.nix @@ -12,6 +12,7 @@ ../../../common inputs.nixos-hardware.nixosModules.common-cpu-intel ../../gc.nix + ./jellyfin.nix ./monitoring.nix ]; @@ -124,8 +125,8 @@ networking.wireguard.enable = true; - services.jellyfin.enable = true; - services.jellyfin.user = "xqtc"; + # services.jellyfin.enable = true; + # services.jellyfin.user = "xqtc"; #services.slskd = { # enable = true; @@ -146,6 +147,7 @@ enableSSHSupport = true; }; + services.nginx.enable = true; # List services that you want to enable: # Enable the OpenSSH daemon. diff --git a/hosts/x86_64-linux/seraphim/jellyfin.nix b/hosts/x86_64-linux/seraphim/jellyfin.nix new file mode 100644 index 0000000..0a491db --- /dev/null +++ b/hosts/x86_64-linux/seraphim/jellyfin.nix @@ -0,0 +1,14 @@ +{config, pkgs, lib, ...}: +{ + services.jellyfin.enable = true; + services.jellyfin.user = "xqtc"; + services.nginx.virtualHosts."jellyfin.fritz.box" = { + locations."/" = { + extraConfig = '' + proxy_set_header Host $host; + ''; + proxyPass = "http://127.0.0.1:8096"; + proxyWebsockets = true; + }; + }; +} diff --git a/hosts/x86_64-linux/seraphim/monitoring.nix b/hosts/x86_64-linux/seraphim/monitoring.nix index 295409b..3d77eaf 100644 --- a/hosts/x86_64-linux/seraphim/monitoring.nix +++ b/hosts/x86_64-linux/seraphim/monitoring.nix @@ -7,6 +7,7 @@ services.grafana = { enable = true; settings.server = { + domain = "grafana.fritz.box"; port = 2342; addr = "127.0.0.1"; }; @@ -34,7 +35,6 @@ ]; }; - services.nginx.enable = true; services.nginx.virtualHosts.${config.services.grafana.settings.server.domain} = { locations."/" = { extraConfig = ''