From 03c6aff8fb6a98ba739e43a1ef3e8e20f1fe8884 Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Sat, 28 Oct 2023 05:12:08 +0530 Subject: [PATCH] refactor proofs --- hosts/rico2/services/caddy.nix | 9 --------- hosts/rico2/services/frpc.nix | 12 ------------ hosts/rico2/services/proofs.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 21 deletions(-) create mode 100644 hosts/rico2/services/proofs.nix diff --git a/hosts/rico2/services/caddy.nix b/hosts/rico2/services/caddy.nix index cfaed5b..97331f3 100644 --- a/hosts/rico2/services/caddy.nix +++ b/hosts/rico2/services/caddy.nix @@ -1,19 +1,10 @@ { config, secrets, - if3, ... }: { services.caddy = { enable = true; inherit (secrets.caddy_config) email; - - virtualHosts = { - "proofs.adtya.xyz" = { - extraConfig = '' - redir https://keyoxide.org/hkp/${secrets.users.primary.pgpFingerprint} - ''; - }; - }; }; } diff --git a/hosts/rico2/services/frpc.nix b/hosts/rico2/services/frpc.nix index c4c019e..2108b2e 100644 --- a/hosts/rico2/services/frpc.nix +++ b/hosts/rico2/services/frpc.nix @@ -46,18 +46,6 @@ in { local_port = 443; }; - "http.proofs.adtya.xyz" = { - type = "http"; - custom_domains = "proofs.adtya.xyz"; - local_port = 80; - }; - - "https.proofs.adtya.xyz" = { - type = "https"; - custom_domains = "proofs.adtya.xyz"; - local_port = 443; - }; - "http.if3.adtya.xyz" = { type = "http"; custom_domains = "if3.adtya.xyz"; diff --git a/hosts/rico2/services/proofs.nix b/hosts/rico2/services/proofs.nix new file mode 100644 index 0000000..14742bd --- /dev/null +++ b/hosts/rico2/services/proofs.nix @@ -0,0 +1,29 @@ +{ + config, + secrets, + ... +}: { + services = { + caddy.virtualHosts = { + "proofs.adtya.xyz" = { + extraConfig = '' + redir https://keyoxide.org/hkp/${secrets.users.primary.pgpFingerprint} + ''; + }; + }; + + frp.settings = { + "http.proofs.adtya.xyz" = { + type = "http"; + custom_domains = "proofs.adtya.xyz"; + local_port = 80; + }; + + "https.proofs.adtya.xyz" = { + type = "https"; + custom_domains = "proofs.adtya.xyz"; + local_port = 443; + }; + }; + }; +}