Skip to content

Instantly share code, notes, and snippets.

@zohl
Last active June 11, 2016 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zohl/05c1e5830dc0c898a8808204fedbf76b to your computer and use it in GitHub Desktop.
Save zohl/05c1e5830dc0c898a8808204fedbf76b to your computer and use it in GitHub Desktop.
A complete example of tt-rss configuration
fileSystems."/srv/http/www/tt-rss" = {
device = "/var/lib/tt-rss";
options = ["bind"];
};
services.nginx = {
enable = true;
config = ''
events {
worker_connections 1024;
}
http {
include ${pkgs.nginx}/conf/mime.types;
server {
listen 80 default_server;
access_log /var/log/nginx-access.log;
error_log /var/log/nginx-error.log;
location / {
root /srv/http/www;
index index.php;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/phpfpm/mypool.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /srv/http/www/$fastcgi_script_name;
include ${pkgs.nginx}/conf/fastcgi_params;
}
}
}
'';
};
services.phpfpm = {
extraConfig = ''
error_log = /var/log/phpfpm.log
log_level = notice
'';
poolConfigs = {
mypool = ''
listen = /var/run/phpfpm/mypool.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0600
user = nginx
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
'';
};
};
services.tt-rss = {
enable = true;
user = "nginx";
database = {
type = "pgsql"; # or "mysql"
host = "localhost";
user = "tt_rss";
name = "tt_rss";
password = "TT_RSS";
};
selfUrlPath = "http://localhost/tt-rss/";
};
services.postgresql = {
enable = true;
package = pkgs.postgresql95;
dataDir = "/var/db/postgresql";
initialScript = /etc/nixos/pgsql_init.sql;
};
# pgsql_init.sql
#
# create database tt_rss;
# create user tt_rss with password 'TT_RSS';
# grant all privileges on database tt_rss to tt_rss;
services.mysql = {
enable = true;
package = pkgs.mysql;
dataDir = "/var/db/mysql";
initialScript = /etc/nixos/mysql_init.sql;
};
# mysql_init.sql
#
# create user tt_rss@localhost identified by 'TT_RSS';
# create database tt_rss;
# grant all privileges on tt_rss.* to tt_rss@localhost;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment