update searxng

This commit is contained in:
Henry Hiles 2025-09-14 15:39:26 -04:00
commit f8153d4929
No known key found for this signature in database
3 changed files with 127 additions and 128 deletions

View file

@ -1,121 +1,121 @@
{ lib, ... }:
{ {
lib, services =
inputs, let
pkgs, socket = "/var/run/searx/socket";
... domain = "search.federated.nexus";
}: { in
services = let {
socket = "/var/run/searx/socket"; searx = {
domain = "search.federated.nexus"; enable = true;
in { settings =
searx = { let
enable = true; enginesByCategory = {
package = inputs.nixpkgs-master.legacyPackages.${pkgs.system}.searxng; general = {
settings = let google = { };
enginesByCategory = { duckduckgo = { };
general = { };
google = {};
duckduckgo = {};
};
"social media" = { "social media" = {
tootfinder = {}; tootfinder = { };
"mastodon users" = {}; "mastodon users" = { };
"lemmy communities" = {}; "lemmy communities" = { };
"lemmy comments" = {}; "lemmy comments" = { };
"lemmy users" = {}; "lemmy users" = { };
"lemmy posts" = {}; "lemmy posts" = { };
}; };
images = { images = {
"duckduckgo images".disabled = false; "duckduckgo images".disabled = false;
"google images" = {}; "google images" = { };
}; };
map.openstreetmap = {}; map.openstreetmap = { };
videos = { videos = {
peertube.disabled = false; peertube.disabled = false;
youtube = {}; youtube = { };
}; };
it = { it = {
github = {}; github = { };
askubuntu = {}; askubuntu = { };
superuser = {}; superuser = { };
stackoverflow = {}; stackoverflow = { };
codeberg.disabled = false; codeberg.disabled = false;
"gitea.com".disabled = false; "gitea.com".disabled = false;
"git.federated.nexus" = { "git.federated.nexus" = {
engine = "gitea"; engine = "gitea";
base_url = "https://git.federated.nexus"; base_url = "https://git.federated.nexus";
};
};
}; };
};
};
engines = engines = builtins.foldl' (
builtins.foldl' acc: category:
(
acc: category:
acc acc
// lib.mapAttrs' (name: val: { // lib.mapAttrs' (name: val: {
name = name; name = name;
value = val // {categories = [category];}; value = val // {
}) categories = [ category ];
enginesByCategory.${category} };
) }) enginesByCategory.${category}
{} ) { } (lib.attrNames enginesByCategory);
(lib.attrNames enginesByCategory); in
in { {
general = { general = {
instance_name = "Federated Nexus Search"; instance_name = "Federated Nexus Search";
contact_url = "mailto:henry@henryhiles.com"; contact_url = "mailto:henry@henryhiles.com";
}; };
search = { search = {
autocomplete = "duckduckgo"; autocomplete = "duckduckgo";
favicon_resolver = "google"; favicon_resolver = "google";
}; };
ui = { ui = {
query_in_title = true; query_in_title = true;
infinite_scroll = true; infinite_scroll = true;
center_alignment = true; center_alignment = true;
}; };
server = { server = {
method = "GET"; method = "GET";
base_url = "https://${domain}"; base_url = "https://${domain}";
bind_address = "unix://${socket}"; bind_address = "unix://${socket}";
secret_key = "I don't use anything that requires a secret key."; secret_key = "I don't use anything that requires a secret key.";
}; };
plugins = { plugins = {
"searx.plugins.oa_doi_rewrite.SXNGPlugin".active = true; "searx.plugins.oa_doi_rewrite.SXNGPlugin".active = true;
"searx.plugins.tracker_url_remover.SXNGPlugin".active = true; "searx.plugins.tracker_url_remover.SXNGPlugin".active = true;
}; };
categories_as_tabs = builtins.listToAttrs ( categories_as_tabs = builtins.listToAttrs (
map (category: { map (category: {
name = category; name = category;
value = {}; value = { };
}) (lib.attrNames enginesByCategory) }) (lib.attrNames enginesByCategory)
); );
use_default_settings.engines.keep_only = lib.attrNames engines; use_default_settings.engines.keep_only = lib.attrNames engines;
engines = lib.mapAttrsToList (name: value: {inherit name;} // value) engines; engines = lib.mapAttrsToList (name: value: { inherit name; } // value) engines;
};
}; };
};
caddy.authedHosts."${domain}" = "reverse_proxy unix/${socket}"; caddy.authedHosts."${domain}" = "reverse_proxy unix/${socket}";
}; };
systemd.services = let systemd.services =
commonConfig = builtins.mapAttrs (_: value: lib.mkForce value) { let
Group = "caddy"; commonConfig = builtins.mapAttrs (_: value: lib.mkForce value) {
RuntimeDirectoryMode = "0770"; Group = "caddy";
UMask = "007"; RuntimeDirectoryMode = "0770";
UMask = "007";
};
in
{
searx.serviceConfig = commonConfig // {
Restart = "always";
};
searx-init.serviceConfig = commonConfig;
}; };
in {
searx.serviceConfig = commonConfig // {Restart = "always";};
searx-init.serviceConfig = commonConfig;
};
} }

52
flake.lock generated
View file

@ -1231,11 +1231,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1757650187, "lastModified": 1757809953,
"narHash": "sha256-OrythrqccPKtuVt0mj26rr83Qo3Ljb4ZmwLdPGjzjMU=", "narHash": "sha256-29mlXbfAJhz9cWVrPP4STvVPDVZFCfCOmaIN5lFJa+Y=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "9eab59f3e71ea3a725e4817d8dcf0da0824ad19d", "rev": "17a10049486f6698fca32097d8f52c0c895542b0",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -1679,11 +1679,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1755960008, "lastModified": 1757876373,
"narHash": "sha256-kjqGfWvpJl8Kl8P8a98q1V6L1x3qO7wKqdSWcMa9RVk=", "narHash": "sha256-7FllmEOH1Dbt+BVzhFPeweG2ToK7Jy3lcUrUYkWQmFc=",
"ref": "refs/heads/main", "ref": "refs/heads/main",
"rev": "fa1d74714dd59e763794bce46e865a49b58a5840", "rev": "04a784bb954cdd4638690ea0edd779c994bb3214",
"revCount": 20, "revCount": 21,
"type": "git", "type": "git",
"url": "https://git.federated.nexus/federated-nexus/nexusbot" "url": "https://git.federated.nexus/federated-nexus/nexusbot"
}, },
@ -2317,21 +2317,6 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-master": {
"locked": {
"lastModified": 1757686808,
"narHash": "sha256-PL+Z3OrNpFNHddbsBaxeojYkWObYc2NlyhTmsmpt+hc=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "098982b6eca9b809cc2f583e733338f5a36b3ad8",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-riscv": { "nixpkgs-riscv": {
"locked": { "locked": {
"lastModified": 1752147015, "lastModified": 1752147015,
@ -2398,11 +2383,27 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1757487488, "lastModified": 1754214453,
"narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=", "narHash": "sha256-Q/I2xJn/j1wpkGhWkQnm20nShYnG7TI99foDBpXm1SY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "5b09dc45f24cf32316283e62aec81ffee3c3e376",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1757745802,
"narHash": "sha256-hLEO2TPj55KcUFUU1vgtHE9UEIOjRcH/4QbmfHNF820=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0", "rev": "c23193b943c6c689d70ee98ce3128239ed9e32d1",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -2685,7 +2686,6 @@
"nix-matrix-appservices": "nix-matrix-appservices", "nix-matrix-appservices": "nix-matrix-appservices",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"nixpkgs-lasuite": "nixpkgs-lasuite", "nixpkgs-lasuite": "nixpkgs-lasuite",
"nixpkgs-master": "nixpkgs-master",
"ooye": "ooye", "ooye": "ooye",
"run0-sudo-shim": "run0-sudo-shim", "run0-sudo-shim": "run0-sudo-shim",
"sdm845": "sdm845", "sdm845": "sdm845",

View file

@ -2,7 +2,6 @@
inputs = { inputs = {
gnome-mobile.url = "github:chuangzhu/nixpkgs-gnome-mobile"; gnome-mobile.url = "github:chuangzhu/nixpkgs-gnome-mobile";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nixpkgs-master.url = "github:nixos/nixpkgs";
nixpkgs-lasuite.url = "github:Henry-Hiles/nixpkgs/bump-lasuite"; nixpkgs-lasuite.url = "github:Henry-Hiles/nixpkgs/bump-lasuite";
wrapper-manager.url = "github:viperML/wrapper-manager"; wrapper-manager.url = "github:viperML/wrapper-manager";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";