nixos/service.tt-rss: enable nginx automatically

This commit is contained in:
Jaakko Luttinen 2018-01-02 21:48:00 +02:00 committed by Robin Gloster
parent 13eaae1610
commit 68855595ce

View File

@ -466,25 +466,28 @@ let
'';
};
services.nginx.virtualHosts = mkIf (cfg.virtualHost != null) {
"${cfg.virtualHost}" = {
root = "${cfg.root}";
services.nginx = {
enable = true;
# NOTE: No configuration is done if not using virtual host
virtualHosts = mkIf (cfg.virtualHost != null) {
"${cfg.virtualHost}" = {
root = "${cfg.root}";
locations."/" = {
index = "index.php";
};
locations."/" = {
index = "index.php";
};
locations."~ \.php$" = {
extraConfig = ''
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:${phpfpmSocketName};
fastcgi_index index.php;
'';
locations."~ \.php$" = {
extraConfig = ''
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:${phpfpmSocketName};
fastcgi_index index.php;
'';
};
};
};
};
systemd.services.tt-rss = let
dbService = if cfg.database.type == "pgsql" then "postgresql.service" else "mysql.service";
in {