diff --git a/nixos/boxes/vpsfree1/default.nix b/nixos/boxes/vpsfree1/default.nix index 65889105..731f52d0 100644 --- a/nixos/boxes/vpsfree1/default.nix +++ b/nixos/boxes/vpsfree1/default.nix @@ -5,21 +5,16 @@ ./vpsfree1-vpsadminos.nix ../cli.nix ../nginx.nix - ./foundryvtt.nix - ./cryptpad.nix - ./syncthing-relay.nix ./backups.nix ./blog.cyplo.net.nix - ./search.nix + ./cryptpad.nix + ./foundryvtt.nix ./matrix-front.nix + ./rss.nix + ./search.nix + ./syncthing-relay.nix ]; - services.dockerRegistry = { - enable = true; - listenAddress = "vpsfree1.raptor-carp.ts.net"; - enableGarbageCollect = true; - }; - systemd.extraConfig = '' DefaultTimeoutStartSec=900s ''; diff --git a/nixos/boxes/vpsfree1/rss.nix b/nixos/boxes/vpsfree1/rss.nix new file mode 100644 index 00000000..e799514d --- /dev/null +++ b/nixos/boxes/vpsfree1/rss.nix @@ -0,0 +1,61 @@ +{ config, pkgs, inputs, lib, ... }: +let + port = 8080; + domain = "news.cyplo.dev"; +in { + imports = [ ../nginx.nix ]; + + services.nginx = { + virtualHosts = { + "${domain}" = { + forceSSL = true; + enableACME = true; + locations."/" = { proxyPass = "http://localhost:" + toString port; }; + }; + }; + }; + + containers.rss = { + autoStart = true; + forwardPorts = [{ + containerPort = port; + hostPort = port; + }]; + config = { config, pkgs, ... }: + let + root = config.services.tt-rss.root; + pool = config.services.tt-rss.pool; + in rec { + services.tt-rss = { + enable = true; + selfUrlPath = "https://${domain}"; + virtualHost = null; + registration.enable = true; + }; + services.nginx = { + enable = true; + virtualHosts = { + "${domain}" = { + listen = [{ + addr = "0.0.0.0"; + port = port; + }]; + root = "${root}/www"; + locations."/" = { index = "index.php"; }; + locations."^~ /feed-icons" = { root = "${root}"; }; + locations."~ \\.php$" = { + extraConfig = '' + fastcgi_split_path_info ^(.+\.php)(/.+)$; + fastcgi_pass unix:${ + config.services.phpfpm.pools.${pool}.socket + }; + fastcgi_index index.php; + ''; + }; + }; + }; + }; + }; + }; + +}