configure reverse proxy for ai

This commit is contained in:
glenn 2024-07-25 10:20:17 +02:00
parent a68decebc6
commit 2cc3da022c
2 changed files with 55 additions and 26 deletions

22
ai.nix Normal file
View file

@ -0,0 +1,22 @@
{
self,
config,
lib,
pkgs,
...
}: let
domain = "ai.sondell.org";
in {
services.nginx.virtualHosts = {
${domain} = {
forceSSL = true;
enableACME = true;
locations."/" = {
proxyPass = "http://localhost:9876/";
proxyWebsockets = true;
};
# Use DNS Challenege.
# acmeRoot = null;
};
};
}

View file

@ -13,10 +13,15 @@
url = "gitlab:simple-nixos-mailserver/nixos-mailserver"; url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
}; };
outputs = { self, nixpkgs, home, nixos-mailserver, home-manager}@attrs: outputs = {
let self,
nixpkgs,
home,
nixos-mailserver,
home-manager,
} @ attrs: let
system = "x86_64-linux"; system = "x86_64-linux";
homepage = home.packages.${system}.default; homepage = home.packages.${system}.default;
mailserver = nixos-mailserver.nixosModules.default; mailserver = nixos-mailserver.nixosModules.default;
@ -32,14 +37,15 @@
home-manager.nixosModules.home-manager home-manager.nixosModules.home-manager
homeSettings homeSettings
]; ];
in in {
{
# replace 'joes-desktop' with your hostname here. # replace 'joes-desktop' with your hostname here.
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem nixosConfigurations.nixos =
nixpkgs.lib.nixosSystem
{ {
inherit system; inherit system;
specialArgs = attrs; specialArgs = attrs;
modules = [ modules =
[
./configuration.nix ./configuration.nix
./audiobooks.nix ./audiobooks.nix
./tunnel.nix ./tunnel.nix
@ -48,13 +54,14 @@
./jellyfin.nix ./jellyfin.nix
./filebrowser.nix ./filebrowser.nix
./tail.nix ./tail.nix
./ai.nix
./matrix.nix ./matrix.nix
./coturn.nix ./coturn.nix
./vaultwarden.nix ./vaultwarden.nix
(import ./mail.nix {inherit mailserver;}) (import ./mail.nix {inherit mailserver;})
(import ./homepage.nix {inherit homepage;}) (import ./homepage.nix {inherit homepage;})
] ++ homeModules; ]
++ homeModules;
}; };
}; };
} }