diff --git a/modules/nixos/web-services/scrutiny.nix b/modules/nixos/web-services/scrutiny.nix new file mode 100644 index 0000000..e0f1610 --- /dev/null +++ b/modules/nixos/web-services/scrutiny.nix @@ -0,0 +1,38 @@ +{ config, lib, ... }: +let + cfg = config.custom.web-services.scrutiny; +in +{ + options.custom.web-services.scrutiny = { + enable = lib.mkEnableOption ""; + domain = lib.mkOption { + type = lib.types.nonEmptyStr; + default = ""; + }; + port = lib.mkOption { + type = lib.types.port; + default = 8466; + }; + }; + + config = lib.mkIf cfg.enable { + services.scrutiny = { + enable = true; + settings.web.listen = { + host = "127.0.0.1"; + inherit (cfg) port; + }; + }; + + systemd.services.scrutiny.enableStrictShellChecks = false; + + custom = { + services.caddy.virtualHosts.${cfg.domain}.port = cfg.port; + + meta.sites.${cfg.domain} = { + title = "Scrutiny"; + icon = "sh:scrutiny"; + }; + }; + }; +}