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";
inputs.nixpkgs.follows = "nixpkgs";
};
};
};
outputs = { self, nixpkgs, home, nixos-mailserver, home-manager}@attrs:
let
outputs = {
self,
nixpkgs,
home,
nixos-mailserver,
home-manager,
} @ attrs: let
system = "x86_64-linux";
homepage = home.packages.${system}.default;
mailserver = nixos-mailserver.nixosModules.default;
@ -32,29 +37,31 @@
home-manager.nixosModules.home-manager
homeSettings
];
in
{
in {
# replace 'joes-desktop' with your hostname here.
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem
{
inherit system;
specialArgs = attrs;
modules = [
./configuration.nix
./audiobooks.nix
./tunnel.nix
./forgejo.nix
./nextcloud.nix
./jellyfin.nix
./filebrowser.nix
./tail.nix
./matrix.nix
./coturn.nix
./vaultwarden.nix
(import ./mail.nix {inherit mailserver;})
(import ./homepage.nix {inherit homepage;})
] ++ homeModules;
};
nixosConfigurations.nixos =
nixpkgs.lib.nixosSystem
{
inherit system;
specialArgs = attrs;
modules =
[
./configuration.nix
./audiobooks.nix
./tunnel.nix
./forgejo.nix
./nextcloud.nix
./jellyfin.nix
./filebrowser.nix
./tail.nix
./ai.nix
./matrix.nix
./coturn.nix
./vaultwarden.nix
(import ./mail.nix {inherit mailserver;})
(import ./homepage.nix {inherit homepage;})
]
++ homeModules;
};
};
}