move sites to their own modules
This commit is contained in:
parent
e83f4ded85
commit
5be0c2ab5b
18 changed files with 707 additions and 654 deletions
41
modules/nixos/sites/search/default.nix
Normal file
41
modules/nixos/sites/search/default.nix
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
lib,
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.custom; let
|
||||
cfg = config.sites.search;
|
||||
in {
|
||||
options.sites.search = with types; {
|
||||
enable = mkBoolOpt false "Enable Search (Searxng)";
|
||||
|
||||
domain = mkStringOpt "search.zackmyers.io" "The domain of the search instance";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.searx = {
|
||||
enable = true;
|
||||
package = pkgs.searxng;
|
||||
runInUwsgi = true;
|
||||
settings = {
|
||||
# server.port = 8080;
|
||||
# server.bind_addres = "0.0.0.0";
|
||||
server.secret_key = "6f6bf40218f239718cacbc2cd837792be828e840b48ac72a8e0a9d0ddb9d0b00"; # you can know this i don't care
|
||||
server.base_url = "https://${cfg.domain}/searx/";
|
||||
};
|
||||
uwsgiConfig = {
|
||||
http = ":8080";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts.${cfg.domain} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/searx/" = {
|
||||
proxyPass = "http://localhost:8080";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue