From 1ffd3cf5e965b1d34cb68fb895783463c8417d9d Mon Sep 17 00:00:00 2001 From: Jimbo Date: Thu, 19 Sep 2024 23:22:58 -0400 Subject: [PATCH] Add back files from before, I'll just deactivate them going forward --- home-manager/sway/waybar.nix | 2 +- nixos/server.nix | 1 + nixos/server/adguard.nix | 14 ++++++++++++++ nixos/server/pufferpanel.nix | 31 +++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 nixos/server/adguard.nix create mode 100644 nixos/server/pufferpanel.nix diff --git a/home-manager/sway/waybar.nix b/home-manager/sway/waybar.nix index 44a633f..b5658c0 100644 --- a/home-manager/sway/waybar.nix +++ b/home-manager/sway/waybar.nix @@ -218,7 +218,7 @@ ''; in pkgs.writeScript "weatherScript" '' # Fetch weather data - fetch=$(fastfetch -c ${weatherConf}) + fetch=$(fastfetch -c ${weatherConf} | sed 's/[[:space:]]*$//') temp=$(echo "$fetch" | sed -n '2s/^\+//p') condition=$(echo "$fetch" | sed -n '3p') location=$(echo "$fetch" | sed -n '4p') diff --git a/nixos/server.nix b/nixos/server.nix index 84f7fc9..8312230 100644 --- a/nixos/server.nix +++ b/nixos/server.nix @@ -21,6 +21,7 @@ # Services ./services/openssh.nix ./server/acme.nix + ./server/adguard.nix ./server/ddclient.nix ./server/icecast.nix ./server/firewall.nix diff --git a/nixos/server/adguard.nix b/nixos/server/adguard.nix new file mode 100644 index 0000000..7712a89 --- /dev/null +++ b/nixos/server/adguard.nix @@ -0,0 +1,14 @@ +{ + services = { + adguardhome.enable = true; + nginx.virtualHosts."guard.${outputs.secrets.jimDomain}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:3000"; + proxyWebsockets = true; + }; + }; + }; + networking.firewall.allowedUDPPorts = [ 53 ]; +} diff --git a/nixos/server/pufferpanel.nix b/nixos/server/pufferpanel.nix new file mode 100644 index 0000000..b9ff0df --- /dev/null +++ b/nixos/server/pufferpanel.nix @@ -0,0 +1,31 @@ +{pkgs, outputs, lib, ...}: { + services = { + pufferpanel = { + enable = true; + environment = { + PUFFER_WEB_HOST = ":5010"; + PUFFER_PANEL_SETTINGS_MASTERURL = "https://panel.${outputs.secrets.jimDomain}"; + PUFFER_PANEL_EMAIL_PROVIDER = "smtp"; + PUFFER_PANEL_EMAIL_HOST = "mx.${outputs.secrets.jimDomain}:587"; + PUFFER_PANEL_EMAIL_FROM = "noreply@${outputs.secrets.jimDomain}"; + PUFFER_PANEL_EMAIL_USERNAME = "noreply@${outputs.secrets.jimDomain}"; + PUFFER_PANEL_EMAIL_PASSWORD = outputs.secrets.noreplyPassword; + }; + extraPackages = with pkgs; [ bash curl gawk gnutar gzip ]; + package = pkgs.buildFHSEnv { + name = "pufferpanel-fhs"; + meta.mainProgram = "pufferpanel-fhs"; + runScript = lib.getExe pkgs.pufferpanel; + targetPkgs = pkgs': with pkgs'; [ icu openssl zlib ]; + }; + }; + nginx.virtualHosts."panel.${outputs.secrets.jimDomain}" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:5010"; + proxyWebsockets = true; + }; + }; + }; +}