add searx and fix caddy cloudflare stuff
This commit is contained in:
parent
72303fd21c
commit
f8ac4c667d
8 changed files with 85 additions and 7 deletions
|
@ -29,11 +29,12 @@ in
|
|||
(common) {
|
||||
encode zstd gzip
|
||||
header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload"
|
||||
tls {
|
||||
dns cloudflare {$CLOUDFLARE_KEY}
|
||||
resolvers 1.1.1.1 8.8.8.8
|
||||
}
|
||||
}
|
||||
'';
|
||||
globalConfig = ''
|
||||
acme_dns cloudflare {$CLOUDFLARE_KEY}
|
||||
'';
|
||||
environmentFile = config.sops.secrets."caddy/env".path;
|
||||
};
|
||||
};
|
||||
|
|
|
@ -7,5 +7,6 @@
|
|||
./zipline.nix
|
||||
./containerization.nix
|
||||
./vaultwarden.nix
|
||||
./searx.nix
|
||||
];
|
||||
}
|
||||
|
|
35
modules/searx.nix
Normal file
35
modules/searx.nix
Normal file
|
@ -0,0 +1,35 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.my.searx;
|
||||
sockPath = "/run/searx/searx.sock";
|
||||
in
|
||||
{
|
||||
options.my.searx = {
|
||||
enable = lib.mkEnableOption "searx";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services.searx = {
|
||||
enable = true;
|
||||
runInUwsgi = true;
|
||||
uwsgiConfig = {
|
||||
disable-logging = true;
|
||||
http = "127.0.0.1:8090";
|
||||
};
|
||||
settings = {
|
||||
# get secret from env
|
||||
server.secret_key = "@SEARX_SECRET_KEY@";
|
||||
};
|
||||
environmentFile = config.sops.secrets."searx/env".path;
|
||||
};
|
||||
|
||||
services.caddy.virtualHosts."x.cy7.sh".extraConfig = ''
|
||||
import common
|
||||
reverse_proxy 127.0.0.1:8090
|
||||
'';
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue