From 4c7e8d85763d4fed24f2a66143cd013c16186ce4 Mon Sep 17 00:00:00 2001 From: baritone Date: Thu, 13 Mar 2025 12:04:41 +0100 Subject: [PATCH] added zed --- configuration.nix | 2 ++ services/homepage.nix | 44 ++++++++++++++++++++++++++++++++++++++++ services/vaultwarden.nix | 6 ++++++ services/zed.nix | 20 ++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 services/homepage.nix create mode 100644 services/zed.nix diff --git a/configuration.nix b/configuration.nix index 67b95fb..b23e929 100755 --- a/configuration.nix +++ b/configuration.nix @@ -15,6 +15,8 @@ ./services/mailserver.nix ./services/fail2ban.nix + ./services/zed.nix # IMPORTANTE + ./services/auto-torrent.nix ./services/misc.nix diff --git a/services/homepage.nix b/services/homepage.nix new file mode 100644 index 0000000..f53e402 --- /dev/null +++ b/services/homepage.nix @@ -0,0 +1,44 @@ +{...}: let + host = "127.0.0.1"; + port = 8082; +in { + services.homepage-dashboard = { + enable = true; + listenPort = port; + openFirewall = false; + widgets = [ + { + resources = { + cpu = true; + disk = "/"; + memory = true; + }; + } + ]; + + services = [ + { + "WebUI" = [ + { + "Jellyfin" = { + description = "Jellyfin"; + href = "https://media.spoodythe.one"; + }; + } + ]; + } + ]; + }; + + services.nginx.virtualHosts."dashboard.spoodythe.one" = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://${host}:${toString port}"; + }; + }; + + # Open port 80 and 443 for reverse proxy + networking.firewall.allowedTCPPorts = [80 443]; + networking.firewall.allowedUDPPorts = [80 443]; +} diff --git a/services/vaultwarden.nix b/services/vaultwarden.nix index a9f2202..d10279f 100755 --- a/services/vaultwarden.nix +++ b/services/vaultwarden.nix @@ -32,6 +32,12 @@ in { forceSSL = true; locations."/" = { proxyPass = "http://${host}:${toString port}"; + + extraConfig = '' + # Websocket support + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $http_connection; + ''; }; }; } diff --git a/services/zed.nix b/services/zed.nix new file mode 100644 index 0000000..c127d11 --- /dev/null +++ b/services/zed.nix @@ -0,0 +1,20 @@ +{...}: { + services.zfs.zed = { + enable = true; + settings = { + ZED_DEBUG_LOG = "/tmp/zed.debug.log"; + ZED_EMAIL_ADDR = "snorre@altschul.dk"; + ZED_EMAIL_PROG = "sendmail"; + ZED_EMAIL_OPTS = "-s '@SUBJECT@' @ADDRESS@"; + + ZED_LOCKDIR = "/var/lock"; + ZED_NOTIFY_INTERVAL_SECS = 3600; + + ZED_NOTIFY_VERBOSE = 0; + + ZED_USE_ENCLOSURE_LEDS = 1; + ZED_SYSLOG_PRIORITY = "daemon.notice"; + ZED_SYSLOG_TAG = "zed"; + }; + }; +}