diff --git a/hosts/cube/grafana.nix b/hosts/cube/grafana.nix index 382cf63..5b472d4 100644 --- a/hosts/cube/grafana.nix +++ b/hosts/cube/grafana.nix @@ -35,7 +35,7 @@ in serverSystemConfiguration { server.domain = fqdn; server.http_addr = "::"; - server.port = 8999; + server.http_port = 8999; users.default_theme = "system"; }; @@ -69,7 +69,7 @@ in serverSystemConfiguration { useACMEHost = domain; locations."/" = { - proxyPass = "http://[::]:${toString config.services.grafana.settings.server.port}"; + proxyPass = "http://[::]:${toString config.services.grafana.settings.server.http_port}"; proxyWebsockets = true; }; }; diff --git a/rebuild.nu b/rebuild.nu index 752f6d0..e4eaa7b 100755 --- a/rebuild.nu +++ b/rebuild.nu @@ -14,5 +14,19 @@ def main --wrapped [ "--log-format internal-json" ] | append $arguments - sudo sh -c $"nixos-rebuild switch ($flags | str join ' ') |& nom --json" + if host == (hostname) { + sudo sh -c $"nixos-rebuild switch ($flags | str join ' ') |& nom --json" + } else { + git ls-files | tar -cf - --files-from - | zstd -c3 | save --force /tmp/config.tar.zst + scp -q /tmp/config.tar.zst ($host + ':/tmp/') + + ssh -q $host $" + rm -rf /tmp/config + mkdir /tmp/config + cd /tmp/config + tar -xf /tmp/config.tar.zst + + sh -c 'sudo nixos-rebuild switch ($flags | str join ' ') |& nom --json' + " + } }