diff --git a/hosts/cyper-node-2/configuration.nix b/hosts/cyper-node-2/configuration.nix index 307ce61..b42e89a 100644 --- a/hosts/cyper-node-2/configuration.nix +++ b/hosts/cyper-node-2/configuration.nix @@ -1,7 +1,7 @@ { imports = [ ./hardware-configuration.nix - ../../nixos/roles/vaultwarden.nix + ../../nixos/roles/searxng.nix ]; networking = { diff --git a/nixos/roles/searxng.nix b/nixos/roles/searxng.nix new file mode 100644 index 0000000..0b9aef9 --- /dev/null +++ b/nixos/roles/searxng.nix @@ -0,0 +1,48 @@ +{ + config, + pkgs, + lib, + ... +}: + +let + address = config.systemd.network.networks."10-ethernet".networkConfig.Address; + ip = builtins.elemAt (lib.splitString "/" address) 0; + port = 11080; +in +{ + services.searx = { + enable = true; + package = pkgs.searxng; + redisCreateLocally = true; + + settings = { + general = { + instance_name = "SearXNG"; + debug = false; + }; + + server = { + inherit port; + bind_address = "0.0.0.0"; + base_url = "http://${ip}:${toString port}"; + secret_key = "@SEARX_SECRET_KEY@"; + }; + + ui = { + default_theme = "simple"; + default_locale = "en"; + center_alignment = true; + infinite_scroll = true; + theme_args.simple_style = "dark"; + }; + + search = { + safe_search = 0; + autocomplete = "duckduckgo"; + }; + }; + }; + + networking.firewall.allowedTCPPorts = [ port ]; +}