From b5d73083bd7b6ff893cca89f89c63ea77fa2ae12 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Thu, 18 Jul 2024 22:05:29 +0530 Subject: [PATCH] all: use shared caddy and frp config --- hosts/layne/services/caddy.nix | 7 ------- hosts/layne/services/default.nix | 8 +++++++- hosts/rico0/services/caddy.nix | 14 -------------- hosts/rico0/services/default.nix | 17 +++++++++++++---- hosts/rico2/services/default.nix | 2 ++ hosts/wynne/services/default.nix | 7 ++++++- 6 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 hosts/layne/services/caddy.nix delete mode 100644 hosts/rico0/services/caddy.nix diff --git a/hosts/layne/services/caddy.nix b/hosts/layne/services/caddy.nix deleted file mode 100644 index 9276aec..0000000 --- a/hosts/layne/services/caddy.nix +++ /dev/null @@ -1,7 +0,0 @@ -_: { - services.caddy = { - enable = true; - acmeCA = "https://acme-v02.api.letsencrypt.org/directory"; - email = "admin@acomputer.lol"; - }; -} diff --git a/hosts/layne/services/default.nix b/hosts/layne/services/default.nix index 88d2e66..c03bd30 100644 --- a/hosts/layne/services/default.nix +++ b/hosts/layne/services/default.nix @@ -1,3 +1,9 @@ _: { - imports = [ ./apps ./caddy.nix ./btrfs.nix ./ssh.nix ]; + imports = [ + ./apps + ./btrfs.nix + ./ssh.nix + ../../shared/caddy.nix + ../../shared/frp.nix + ]; } diff --git a/hosts/rico0/services/caddy.nix b/hosts/rico0/services/caddy.nix deleted file mode 100644 index 0bcee55..0000000 --- a/hosts/rico0/services/caddy.nix +++ /dev/null @@ -1,14 +0,0 @@ -_: { - services.caddy = { - enable = true; - acmeCA = "https://acme-v02.api.letsencrypt.org/directory"; - email = "admin@acomputer.lol"; - - virtualHosts."frp.labs.adtya.xyz" = { - extraConfig = '' - reverse_proxy 10.10.10.1:7500 - tls /persist/secrets/caddy/certs/default.crt /persist/secrets/caddy/certs/default.key - ''; - }; - }; -} diff --git a/hosts/rico0/services/default.nix b/hosts/rico0/services/default.nix index f8f22a6..1e324cd 100644 --- a/hosts/rico0/services/default.nix +++ b/hosts/rico0/services/default.nix @@ -1,9 +1,18 @@ _: { imports = [ - ./btrfs.nix - ./caddy.nix - ./ssh.nix - ./apps + ./btrfs.nix + ./ssh.nix + ../../shared/caddy.nix + ../../shared/frp.nix ]; + + services.caddy = { + virtualHosts."frp.labs.adtya.xyz" = { + extraConfig = '' + reverse_proxy 10.10.10.1:7500 + tls /persist/secrets/caddy/certs/default.crt /persist/secrets/caddy/certs/default.key + ''; + }; + }; } diff --git a/hosts/rico2/services/default.nix b/hosts/rico2/services/default.nix index fb02349..2ecb011 100644 --- a/hosts/rico2/services/default.nix +++ b/hosts/rico2/services/default.nix @@ -2,6 +2,8 @@ _: { imports = [ ./btrfs.nix ./ssh.nix + ../../shared/caddy.nix + ../../shared/frp.nix ]; } diff --git a/hosts/wynne/services/default.nix b/hosts/wynne/services/default.nix index 680b32a..34e9c6d 100644 --- a/hosts/wynne/services/default.nix +++ b/hosts/wynne/services/default.nix @@ -1,3 +1,8 @@ _: { - imports = [ ./btrfs.nix ./ssh.nix ]; + imports = [ + ./btrfs.nix + ./ssh.nix + ../../shared/caddy.nix + ../../shared/frp.nix + ]; }