diff options
Diffstat (limited to 'system/settings')
-rw-r--r-- | system/settings/dev.nix | 62 | ||||
-rw-r--r-- | system/settings/services/git-server.nix | 2 |
2 files changed, 63 insertions, 1 deletions
diff --git a/system/settings/dev.nix b/system/settings/dev.nix new file mode 100644 index 00000000..7d2e6193 --- /dev/null +++ b/system/settings/dev.nix @@ -0,0 +1,62 @@ +{ ... }: { + services.caddy = { + enable = true; + globalConfig = '' + auto_https disable_redirects + ''; + virtualHosts = + let + local_tls = '' + tls { + issuer internal { + ca local + } + } + ''; + in + { + "localhost" = { + logFormat = "output discard"; + extraConfig = '' + ${local_tls} + acme_server { + allow { + domains *.test *.localhost + } + } + ''; + }; + # need to test forwarding behaviour + "https://alanpearce.localhost" = { + logFormat = "output discard"; + serverAliases = [ + "http://alanpearce.localhost" + + # remember to update /etc/hosts + "https://alanpearce.test" + "http://alanpearce.test" + ]; + extraConfig = '' + ${local_tls} + reverse_proxy http://alanpearce.test:8080 { + transport http { + dial_timeout 1s + compression off + } + } + ''; + }; + "searchix.localhost" = { + logFormat = "output discard"; + extraConfig = '' + reverse_proxy http://localhost:7331 { + transport http { + dial_timeout 1s + compression off + } + } + ''; + }; + }; + }; +} diff --git a/system/settings/services/git-server.nix b/system/settings/services/git-server.nix index 54e8560c..e8fe6360 100644 --- a/system/settings/services/git-server.nix +++ b/system/settings/services/git-server.nix @@ -4,7 +4,7 @@ , ... }: let - inherit (lib) pipe flatten concatMapAttrs mergeAttrsList mapAttrsToList; + inherit (lib) pipe flatten concatMapAttrs mapAttrsToList; inherit (import ../../../lib/caddy.nix { inherit lib; }) security-headers; repos = "${config.services.gitolite.dataDir}/repositories"; |