From 33b6731c595c3fa198e96d0c38e925390774bab5 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 10 Sep 2023 10:55:46 +0200 Subject: [PATCH] hosts/hydra-1: Migrate from nix-serve to harmonia --- hosts/hydra-1/configuration.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/hosts/hydra-1/configuration.nix b/hosts/hydra-1/configuration.nix index 56369e5..46626f5 100644 --- a/hosts/hydra-1/configuration.nix +++ b/hosts/hydra-1/configuration.nix @@ -77,15 +77,10 @@ ''; }; - services.nix-serve = { + services.harmonia = { enable = true; - port = 5005; - bindAddress = "127.0.0.1"; - secretKeyFile = config.age.secrets.nix-cache-key.path; - # Workaround https://github.com/NixOS/nix/issues/7704#issuecomment-1409480909 - package = pkgs.nix-serve-ng.override { - nix = pkgs.nixVersions.nix_2_12; - }; + settings.bind = "[::1]:5005"; + signKeyPath = config.age.secrets.nix-cache-key.path; }; services.nginx.enable = true; @@ -109,7 +104,13 @@ ''; }; locations."/" = { - proxyPass = "http://127.0.0.1:5005"; + proxyPass = "http://[::1]:5005"; + extraConfig = '' + proxy_redirect http:// https://; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection $connection_upgrade; + ''; }; }; };