From 3b7d181be3db14002453a6a97e06537ac2eceef6 Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Mon, 19 May 2025 11:33:51 -0500 Subject: [PATCH] i think this works --- flake.nix | 6 ++++++ modules/website.nix | 24 ++++++++++++++++++++++++ system/shen/configuration.nix | 12 ++++++------ 3 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 modules/website.nix diff --git a/flake.nix b/flake.nix index b050e88..1b71905 100644 --- a/flake.nix +++ b/flake.nix @@ -19,6 +19,10 @@ inputs.nixpkgs.follows = "nixpkgs-unstable"; url = "github:nixified-ai/flake"; }; + website = { + url = "path:/tfcconnection"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { nixpkgs, @@ -30,6 +34,7 @@ simple-nixos-mailserver, nocodb, nixified-ai, + website, self, ... }: let @@ -38,6 +43,7 @@ pkgsForSystem = import nixpkgs { inherit system; config = { allowUnfree = true; }; + overlays = [ (final: prev: { website = website.defaultPackage; }) ]; }; lib = nixpkgs.lib; diff --git a/modules/website.nix b/modules/website.nix new file mode 100644 index 0000000..46af74e --- /dev/null +++ b/modules/website.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +let + dn = "tfcconnection.org"; +in +with lib; +{ + services.nginx.virtualHosts.${dn} = { + forceSSL = true; + enableACME = true; + locations."/" = { + proxyPass = "http://127.0.0.1:4242"; + proxyWebsockets = true; + }; + }; + systemd.services = { + website = { + enable = true; + serviceConfig = { + ExecStart = "${pkgs.website}/bin/tfcapi"; + }; + }; + }; +} diff --git a/system/shen/configuration.nix b/system/shen/configuration.nix index 04488b9..ae11921 100644 --- a/system/shen/configuration.nix +++ b/system/shen/configuration.nix @@ -19,7 +19,7 @@ in ../../modules/searx.nix ../../modules/mail.nix ../../modules/vaultwarden.nix - # ../../modules/nocodb.nix + ../../modules/website.nix ../../modules/grist.nix ../../modules/keycloak.nix # ../../modules/comfyui.nix @@ -132,11 +132,11 @@ in recommendedGzipSettings = true; recommendedOptimisation = true; - virtualHosts."tfcconnection.org" = { - forceSSL = true; - enableACME = true; - locations."/".proxyPass = "http://localhost:4242"; - }; + # virtualHosts."tfcconnection.org" = { + # forceSSL = true; + # enableACME = true; + # locations."/".proxyPass = "http://localhost:4242"; + # }; }; # CADDY