From e183e8310c71510b37a427cc19d80ad4c7772100 Mon Sep 17 00:00:00 2001 From: k Date: Sun, 10 May 2026 15:50:22 -0400 Subject: [PATCH] formating --- hosts/server/configuration.nix | 4 +- hosts/server/service.nix | 78 ++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index c52495e..96fd2f8 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -34,8 +34,8 @@ users = { rodant = { isNormalUser = true; - description = "llm user"; - packages = with pkgs; [git python3 nodejs cargo ripgrep curl wget ffmpeg imagemagick texliveFull ]; + description = "llm user"; + packages = with pkgs; [git python3 nodejs cargo ripgrep curl wget ffmpeg imagemagick texliveFull]; }; k = { isNormalUser = true; diff --git a/hosts/server/service.nix b/hosts/server/service.nix index 2c5d18f..e31c994 100644 --- a/hosts/server/service.nix +++ b/hosts/server/service.nix @@ -102,34 +102,40 @@ secretKeyFile = "/var/cache-priv-key.pem"; }; -prometheus = { - enable = true; - scrapeConfigs = [{ - job_name = "ratchat-server"; - static_configs = [{ - targets = [ "127.0.0.1:9011" ]; - }]; - }]; -}; - -grafana = { - enable = true; - settings = { - server = { - http_addr = "127.0.0.1"; - http_port = 3000; + prometheus = { + enable = true; + scrapeConfigs = [ + { + job_name = "ratchat-server"; + static_configs = [ + { + targets = ["127.0.0.1:9011"]; + } + ]; + } + ]; }; - }; - provision = { - enable = true; - datasources.settings.datasources = [{ - name = "Prometheus"; - type = "prometheus"; - url = "http://localhost:9090"; - }]; - }; -}; + grafana = { + enable = true; + settings = { + server = { + http_addr = "127.0.0.1"; + http_port = 3000; + }; + }; + + provision = { + enable = true; + datasources.settings.datasources = [ + { + name = "Prometheus"; + type = "prometheus"; + url = "http://localhost:9090"; + } + ]; + }; + }; ollama = { enable = true; @@ -224,13 +230,13 @@ grafana = { nginx = { enable = true; -commonHttpConfig = '' - map $http_authorization $is_allowed_user { - default 0; - "Bearer ratToken" 1; - "Bearer notRatToken" 1; - } - ''; + commonHttpConfig = '' + map $http_authorization $is_allowed_user { + default 0; + "Bearer ratToken" 1; + "Bearer notRatToken" 1; + } + ''; recommendedProxySettings = true; recommendedTlsSettings = true; clientMaxBodySize = "4g"; @@ -265,9 +271,9 @@ commonHttpConfig = '' enableACME = true; locations."/" = { proxyPass = "http://127.0.0.1:9011"; -extraConfig = '' - if ($is_allowed_user = 0) { return 401; } - ''; + extraConfig = '' + if ($is_allowed_user = 0) { return 401; } + ''; }; };