diff --git a/hosts/pluto/services/mirror.nix b/hosts/pluto/services/mirror.nix new file mode 100644 index 0000000..e6e27fd --- /dev/null +++ b/hosts/pluto/services/mirror.nix @@ -0,0 +1,28 @@ +{pkgs, ...}: { + systemd.timers."mirror-update" = { + wantedBy = ["timers.target"]; + timerConfig = { + OnBootSec = "5m"; + OnUnitActiveSec = "5m"; + Unit = "mirror-update.service"; + }; + }; + + systemd.services."mirror-update" = { + script = '' + ${pkgs.rsync}/bin/rsync -vPa rsync://mirrors.lug.mtu.edu/archlinux/ /var/www/mirror.zackmyers.io/ + ''; + serviceConfig = { + Type = "oneshot"; + User = "root"; + }; + }; + + services.nginx.virtualHosts."mirror.zackmyers.io" = { + forceSSL = true; + enableACME = true; + locations."/archlinux" = { + root = "/var/www/mirror.zackmyers.io"; + }; + }; +} diff --git a/hosts/pluto/services/nginx.nix b/hosts/pluto/services/nginx.nix new file mode 100644 index 0000000..68c4b7d --- /dev/null +++ b/hosts/pluto/services/nginx.nix @@ -0,0 +1,8 @@ +{pkgs, ...}: { + services.nginx = { + enable = true; + package = pkgs.nginxStable.override {openssl = pkgs.libressl;}; + virtualHosts = { + }; + }; +} diff --git a/hosts/pluto/services/searxng.nix b/hosts/pluto/services/searxng.nix index ae02c1f..e814c4e 100644 --- a/hosts/pluto/services/searxng.nix +++ b/hosts/pluto/services/searxng.nix @@ -4,12 +4,19 @@ package = pkgs.searxng; runInUwsgi = true; settings = { - # server.port = 8080; - # server.bind_addres = "0.0.0.0"; server.secret_key = "6f6bf40218f239718cacbc2cd837792be828e840b48ac72a8e0a9d0ddb9d0b00"; }; uwsgiConfig = { - http = ":8080"; + socket = "/run/searx/searx.sock"; + chmod-socket = "660"; + }; + }; + + services.nginx.virtualHosts."search.zackmyers.io" = { + forceSSL = true; + enableACME = true; + locations."/searx" = { + uwsgiPass = "unix://run/searx/searx.sock"; }; }; }