From 4ef82e4b020ccac5ce9397c80bdcb5af5787a957 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Fri, 17 Nov 2023 19:55:35 -0700 Subject: [PATCH] [NixOS] Forward requests at cache.railbird.ai to ryzen-shine --- nixos/cache-server.nix | 17 +++-------------- nixos/machines/biskcomp.nix | 7 +++++++ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/nixos/cache-server.nix b/nixos/cache-server.nix index d6300545..91045301 100644 --- a/nixos/cache-server.nix +++ b/nixos/cache-server.nix @@ -1,4 +1,4 @@ -{ config, makeEnable, lib, ... }: +{ config, lib, ... }: with lib; let cfg = config.modules.cache-server; in @@ -8,7 +8,7 @@ in enable = mkEnableOption "nix cache server"; port = mkOption { type = types.int; - default = 8080; + default = 5050; }; host-string = mkOption { type = types.string; @@ -27,18 +27,7 @@ in services.nix-serve = { enable = true; secretKeyFile = config.age.secrets."cache-priv-key.pem".path; - port = 5050; - }; - - services.nginx = { - enable = true; - recommendedProxySettings = true; - virtualHosts = { - "${cfg.host-string}" = { - locations."${cfg.path}".proxyPass = "http://${config.services.nix-serve.bindAddress}:${toString config.services.nix-serve.port}"; - listen = [ { addr = "0.0.0.0"; port = cfg.port; } ]; - }; - }; + port = cfg.port; }; }; } diff --git a/nixos/machines/biskcomp.nix b/nixos/machines/biskcomp.nix index 71e53715..678a74da 100644 --- a/nixos/machines/biskcomp.nix +++ b/nixos/machines/biskcomp.nix @@ -53,6 +53,13 @@ in proxyPass = "http://[::1]:8222"; }; }; + "cache.railbird.ai" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://192.168.1.26:3090"; + }; + }; }; };