feat(nixosModules/server): add nginx reverse proxy

This commit is contained in:
Mohammad Rafiq 2025-05-29 17:02:04 +08:00
parent 8e12382f60
commit 4c6097903f
No known key found for this signature in database
2 changed files with 38 additions and 1 deletions

View file

@ -0,0 +1,24 @@
{ config, lib, ... }:
let
cfg = config.server.reverse-proxy;
in
{
options.server.reverse-proxy = {
enable = lib.mkEnableOption "";
type = lib.pantheon.mkStrOption;
proxies = lib.mkOption {
type = lib.types.listOf lib.types.attrs;
default = [ ];
};
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
(lib.mkIf (cfg.type == "nginx") {
services.nginx = {
enable = true;
};
})
]
);
}

View file

@ -36,6 +36,19 @@
enableSunshine = true;
};
server.mountHelios = true;
server = {
mountHelios = true;
reverse-proxy = {
enable = true;
type = "nginx";
proxies = [
{
source = "chat.bwfiq.com";
target = "";
}
];
};
};
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}