nixos-config/mastus/ttrss.nix

96 lines
2.4 KiB
Nix
Raw Permalink Normal View History

2016-06-19 09:15:34 +02:00
{ config, pkgs, ... }:
{
containers.ttrss = {
config = {
2021-06-27 14:40:28 +02:00
users.users.ttrss = {
group = "ttrss";
isSystemUser = true;
};
users.groups.ttrss = {};
users.users.tt_rss.isSystemUser = true;
2016-06-19 09:15:34 +02:00
services.postgresql = {
enable = true;
package = pkgs.postgresql95;
initialScript = pkgs.writeText "ttrss-init.sql" ''
create database ttrss;
create user ttrss with password 'ttrss';
grant all privileges on database ttrss to ttrss;
'';
};
services.tt-rss = {
enable = true;
user = "ttrss";
pool = "ttrss";
2018-04-17 11:50:16 +02:00
virtualHost = null;
2016-06-19 09:15:34 +02:00
database = {
type = "pgsql";
host = "localhost";
name = "ttrss";
user = "ttrss";
password = "ttrss";
};
selfUrlPath = "https://reader.gebner.org/";
};
services.phpfpm = {
2019-10-31 19:36:18 +01:00
pools = {
ttrss = {
user = "ttrss";
group = "ttrss";
settings = {
listen = "9000";
pm = "dynamic";
"pm.max_children" = 75;
"pm.start_servers" = 10;
"pm.min_spare_servers" = 5;
"pm.max_spare_servers" = 20;
"pm.max_requests" = 500;
catch_workers_output = 1;
};
};
2016-06-19 09:15:34 +02:00
};
};
networking.firewall.allowedTCPPorts = [ 9000 ];
};
autoStart = true;
hostAddress = "192.168.100.10";
localAddress = "192.168.100.11";
privateNetwork = true;
};
networking.nat.enable = true;
networking.nat.internalInterfaces = ["ve-+"];
2018-03-10 16:40:04 +01:00
networking.nat.externalInterface = "ens3";
2016-06-19 09:15:34 +02:00
2020-10-30 19:06:17 +01:00
security.acme.certs."gebner.org".extraDomainNames = [ "reader.gebner.org" ];
2016-06-19 09:15:34 +02:00
2019-08-25 18:04:33 +02:00
services.nginx = {
virtualHosts."reader.gebner.org" = {
forceSSL = true;
useACMEHost = "gebner.org";
locations."/" = {
root = "/var/lib/containers/ttrss/var/lib/tt-rss";
index = "index.php";
};
locations."/cache".extraConfig = "deny all;";
locations."= /config.php".extraConfig = "deny all;";
locations."~ \\.php$".extraConfig = ''
2016-06-19 09:15:34 +02:00
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 192.168.100.11:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/lib/tt-rss/$fastcgi_script_name;
include ${pkgs.nginx}/conf/fastcgi_params;
2019-08-25 18:04:33 +02:00
'';
};
};
2016-06-19 09:15:34 +02:00
}