gergle/module.nix
2025-01-10 22:38:30 +01:00

34 lines
772 B
Nix

{ pkgs, lib, config, ... }:
let
cfg = config.services.gergle;
in
{
options.services.gergle = {
enable = lib.mkEnableOption "Enable the gergle service";
package = lib.mkPackageOption pkgs "gergle-web-wasm" {
example = "gergle-web-debug";
};
virtualHost = lib.mkOption {
type = lib.types.str;
example = "gergle.example.com";
description = "Virtual host to serve gergle on";
};
location = lib.mkOption {
type = lib.types.str;
default = "/";
description = "Location to serve gergle on";
};
};
config = lib.mkIf cfg.enable {
services.nginx = {
enable = true;
virtualHosts."${cfg.virtualHost}" = {
locations.${cfg.location}.root = "${cfg.package}/";
};
};
};
}