9 cfg = config.services.whoogle-search;
13 services.whoogle-search = {
14 enable = lib.mkEnableOption "Whoogle, a metasearch engine";
17 type = lib.types.port;
19 description = "Port to listen on.";
22 listenAddress = lib.mkOption {
24 default = "127.0.0.1";
25 description = "Address to listen on for the web interface.";
28 extraEnv = lib.mkOption {
29 type = with lib.types; attrsOf str;
32 Extra environment variables to pass to Whoogle, see
33 https://github.com/benbusby/whoogle-search?tab=readme-ov-file#environment-variables
39 config = lib.mkIf cfg.enable {
41 systemd.services.whoogle-search = {
42 description = "Whoogle Search";
43 wantedBy = [ "multi-user.target" ];
44 path = [ pkgs.whoogle-search ];
47 CONFIG_VOLUME = "/var/lib/whoogle-search";
53 "${lib.getExe pkgs.whoogle-search}"
54 + " --host '${cfg.listenAddress}'"
55 + " --port '${builtins.toString cfg.port}'";
56 ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
57 StateDirectory = "whoogle-search";
58 StateDirectoryMode = "0750";
63 Restart = "on-failure";
68 meta.maintainers = with lib.maintainers; [ malte-v ];