2023-08-13 17:00:41 +01:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
inputs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2022-10-22 20:34:06 +01:00
|
|
|
port = 8080;
|
|
|
|
domain = "news.cyplo.dev";
|
2023-05-08 12:03:29 +01:00
|
|
|
postgresPort = 5435;
|
2022-10-22 20:34:06 +01:00
|
|
|
in {
|
2023-08-13 17:00:41 +01:00
|
|
|
imports = [../nginx.nix];
|
2022-10-22 20:34:06 +01:00
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
virtualHosts = {
|
|
|
|
"${domain}" = {
|
|
|
|
forceSSL = true;
|
|
|
|
enableACME = true;
|
2023-08-13 17:00:41 +01:00
|
|
|
locations."/" = {proxyPass = "http://127.0.0.1:" + toString port;};
|
2022-10-22 20:34:06 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
containers.rss = {
|
|
|
|
autoStart = true;
|
2023-08-13 17:00:41 +01:00
|
|
|
forwardPorts = [
|
|
|
|
{
|
|
|
|
containerPort = port;
|
|
|
|
hostPort = port;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
config = {
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
...
|
|
|
|
}: let
|
|
|
|
inherit (config.services.tt-rss) pool;
|
|
|
|
inherit (config.services.tt-rss) root;
|
|
|
|
in {
|
|
|
|
system.stateVersion = "23.05";
|
|
|
|
services.postgresql.port = postgresPort;
|
|
|
|
services.tt-rss = {
|
|
|
|
enable = true;
|
|
|
|
selfUrlPath = "https://${domain}";
|
|
|
|
virtualHost = null;
|
|
|
|
registration.enable = false;
|
|
|
|
simpleUpdateMode = true;
|
|
|
|
database.port = postgresPort;
|
|
|
|
};
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts = {
|
|
|
|
"${domain}" = {
|
|
|
|
listen = [
|
|
|
|
{
|
2022-11-08 17:06:20 +00:00
|
|
|
inherit port;
|
2022-10-22 20:34:06 +01:00
|
|
|
addr = "0.0.0.0";
|
2023-08-13 17:00:41 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
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;
|
|
|
|
'';
|
2022-10-22 20:34:06 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2023-08-13 17:00:41 +01:00
|
|
|
};
|
2022-10-22 20:34:06 +01:00
|
|
|
};
|
|
|
|
}
|