dotfiles/nixos/boxes/vpsfree1/rss.nix

62 lines
1.5 KiB
Nix

{ 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 = false;
};
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;
'';
};
};
};
};
};
};
}