From f65babd85ab93fb73abe0dcf83baa8d03e71974e Mon Sep 17 00:00:00 2001 From: Michael Thomas Date: Wed, 8 May 2024 14:41:21 +0000 Subject: [PATCH] feat(oracle): update configuration.nix --- machines/oracle/configuration.nix | 36 ++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/machines/oracle/configuration.nix b/machines/oracle/configuration.nix index 7258b2d..e4c5199 100644 --- a/machines/oracle/configuration.nix +++ b/machines/oracle/configuration.nix @@ -1,4 +1,4 @@ -{ pkgs, config, ... }: { +{ pkgs, config, lib, ... }: { imports = [ ./hardware-configuration.nix ]; @@ -63,6 +63,40 @@ # Services services.caddy = { enable = true; + package = + let + caddyWithPlugins = builtins.fetchurl { + url = "https://raw.githubusercontent.com/jpds/nixpkgs/a33b02fa9d664f31dadc8a874eb1a5dbaa9f4ecf/pkgs/servers/caddy/default.nix"; + sha256 = "sha256:1x1g6qyhmclz2jyc5nmfjsri3xx4pw5rd15n2xjkxlgdcvywcv5f"; + }; + in + (pkgs.callPackage "${caddyWithPlugins}" { + externalPlugins = [ + { + name = "greenpau/caddy-security"; + repo = "github.com/greenpau/caddy-security"; + version = "v1.1.23"; + } + ]; + vendorHash = "sha256-rGNyeHZZBxVM8GMUQMV/JzkK9S/l8tefaQde/d4x9LA="; + }); + globalConfig = '' + email michaelhthomas@outlook.com + ''; + virtualHosts = { + "s.michaelt.xyx".extraConfig = '' + respond "Coming soon!" + ''; + "auth.s.michaelt.xyz".extraConfig = '' + reverse_proxy http://10.0.10.2:7654 + ''; + "traggo.s.michaelt.xyz".extraConfig = '' + reverse_proxy http://10.0.10.2:3030 + ''; + "git.s.michaelt.xyz".extraConfig = '' + reverse_proxy http://10.0.10.2:3000 + ''; + }; }; networking.firewall.allowedTCPPorts = [ 80 443 ];