From 4932c2dd5e6da5966fda0ed2066ba4cd6ef73c24 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Mon, 28 Jul 2025 00:24:19 +0200 Subject: [PATCH] add eleakxir Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- flake.lock | 160 +++++++++++++++++++++++++++++---- hosts/server/configuration.nix | 1 + server-modules/eleakxir.nix | 13 ++- 3 files changed, 155 insertions(+), 19 deletions(-) diff --git a/flake.lock b/flake.lock index f43dec6..2bd3a1b 100644 --- a/flake.lock +++ b/flake.lock @@ -126,6 +126,79 @@ "type": "github" } }, + "blueprint": { + "inputs": { + "nixpkgs": [ + "eleakxir", + "bun2nix", + "nixpkgs" + ], + "systems": [ + "eleakxir", + "bun2nix", + "systems" + ] + }, + "locked": { + "lastModified": 1744632722, + "narHash": "sha256-0chvqUV1Kzf8BMQ7MsH3CeicJEb2HeCpwliS77FGyfc=", + "owner": "numtide", + "repo": "blueprint", + "rev": "49bbd5d072b577072f4a1d07d4b0621ecce768af", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "blueprint", + "type": "github" + } + }, + "bun2nix": { + "inputs": { + "blueprint": "blueprint", + "nixpkgs": [ + "eleakxir", + "nixpkgs" + ], + "systems": "systems", + "treefmt-nix": "treefmt-nix" + }, + "locked": { + "lastModified": 1750682174, + "narHash": "sha256-rUpcATQ0LiY8IYRndqTlPUhF4YGJH3lM2aMOs5vBDGM=", + "owner": "baileyluTCD", + "repo": "bun2nix", + "rev": "85d692d68a5345d868d3bb1158b953d2996d70f7", + "type": "github" + }, + "original": { + "owner": "baileyluTCD", + "repo": "bun2nix", + "type": "github" + } + }, + "eleakxir": { + "inputs": { + "bun2nix": "bun2nix", + "nixpkgs": [ + "nixpkgs" + ], + "systems": "systems_2" + }, + "locked": { + "lastModified": 1753651297, + "narHash": "sha256-/Dz8nKg5zVs8Kd8GxijfU0+hTvH5aD+V07jInrRN1mM=", + "owner": "anotherhadi", + "repo": "eleakxir-temp", + "rev": "ec4e181cf9a9e83a95a626224d3820fe27ec0387", + "type": "github" + }, + "original": { + "owner": "anotherhadi", + "repo": "eleakxir-temp", + "type": "github" + } + }, "firefox-gnome-theme": { "flake": false, "locked": { @@ -250,7 +323,7 @@ }, "flake-utils": { "inputs": { - "systems": "systems_2" + "systems": "systems_4" }, "locked": { "lastModified": 1731533236, @@ -474,7 +547,7 @@ "hyprwayland-scanner": "hyprwayland-scanner", "nixpkgs": "nixpkgs_2", "pre-commit-hooks": "pre-commit-hooks", - "systems": "systems", + "systems": "systems_3", "xdph": "xdph" }, "locked": { @@ -640,7 +713,7 @@ "hyprland": [ "hyprland" ], - "systems": "systems_3" + "systems": "systems_5" }, "locked": { "lastModified": 1752663231, @@ -1000,7 +1073,7 @@ "flake-utils": "flake-utils_2", "mnw": "mnw", "nixpkgs": "nixpkgs_7", - "systems": "systems_4" + "systems": "systems_6" }, "locked": { "lastModified": 1753181140, @@ -1054,6 +1127,7 @@ "root": { "inputs": { "apple-fonts": "apple-fonts", + "eleakxir": "eleakxir", "home-manager": "home-manager", "hyprland": "hyprland", "hyprpanel": "hyprpanel", @@ -1196,7 +1270,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_5" + "systems": "systems_7" }, "locked": { "lastModified": 1752986956, @@ -1223,7 +1297,7 @@ "gnome-shell": "gnome-shell", "nixpkgs": "nixpkgs_10", "nur": "nur", - "systems": "systems_6", + "systems": "systems_8", "tinted-foot": "tinted-foot", "tinted-kitty": "tinted-kitty", "tinted-schemes": "tinted-schemes", @@ -1246,16 +1320,16 @@ }, "systems": { "locked": { - "lastModified": 1689347949, - "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "owner": "nix-systems", - "repo": "default-linux", - "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default-linux", + "repo": "default", "type": "github" } }, @@ -1306,16 +1380,16 @@ }, "systems_5": { "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "lastModified": 1689347949, + "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "repo": "default-linux", + "rev": "31732fcf5e8fea42e59c2488ad31a0e651500f68", "type": "github" }, "original": { "owner": "nix-systems", - "repo": "default", + "repo": "default-linux", "type": "github" } }, @@ -1335,6 +1409,36 @@ } }, "systems_7": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_8": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_9": { "locked": { "lastModified": 1689347949, "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", @@ -1430,6 +1534,28 @@ "type": "github" } }, + "treefmt-nix": { + "inputs": { + "nixpkgs": [ + "eleakxir", + "bun2nix", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1748243702, + "narHash": "sha256-9YzfeN8CB6SzNPyPm2XjRRqSixDopTapaRsnTpXUEY8=", + "owner": "numtide", + "repo": "treefmt-nix", + "rev": "1f3f7b784643d488ba4bf315638b2b0a4c5fb007", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "treefmt-nix", + "type": "github" + } + }, "vpnconfinement": { "locked": { "lastModified": 1743810720, @@ -1450,7 +1576,7 @@ "nixpkgs": [ "nixpkgs" ], - "systems": "systems_7" + "systems": "systems_9" }, "locked": { "lastModified": 1753295615, diff --git a/hosts/server/configuration.nix b/hosts/server/configuration.nix index f8c31be..eac59a6 100644 --- a/hosts/server/configuration.nix +++ b/hosts/server/configuration.nix @@ -20,6 +20,7 @@ ../../server-modules/arr.nix ../../server-modules/mealie.nix ../../server-modules/search-nixos-api.nix + ../../server-modules/eleakxir.nix # You should let those lines as is ./hardware-configuration.nix diff --git a/server-modules/eleakxir.nix b/server-modules/eleakxir.nix index d858d2b..ba5c9ff 100644 --- a/server-modules/eleakxir.nix +++ b/server-modules/eleakxir.nix @@ -8,6 +8,7 @@ enable = true; port = 8080; leakPath = "/mnt/ssd/leaks"; + cachePath = "/var/lib/eleakxir-backend"; }; services.nginx = { @@ -16,13 +17,21 @@ forceSSL = true; root = "${ - inputs.socme.packages.${pkgs.system}.eleakxir-frontend + inputs.eleakxir.packages.${pkgs.system}.frontend }/eleakxir-frontend"; locations."/api/" = { proxyPass = "http://127.0.0.1:${toString config.services.eleakxir-backend.port}/"; - recommendedProxySettings = true; extraConfig = '' + # Crucial for SSE: Disable buffering + proxy_buffering off; + proxy_cache off; + proxy_http_version 1.1; + proxy_set_header Connection ""; # Required for HTTP/1.1 persistent connections + proxy_read_timeout 36000s; # Long timeout, adjust as needed. SSE connections are long-lived. + proxy_send_timeout 36000s; # Also important for sending data + + # Your existing rewrite rule (make sure this doesn't cause issues with SSE paths specifically) rewrite ^/api/(.*) /$1 break; ''; };