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