diff --git a/README.org b/README.org index 3c8870d..2086b17 100644 --- a/README.org +++ b/README.org @@ -13,5 +13,6 @@ - Development tools: devops.nix - Smartd: monitoring.nix - Systemd services and timers: periodic.nix + - Curated articles: information.nix All the modules are imported in *configuration.nix* diff --git a/configuration.nix b/configuration.nix index cdf032e..86b32f8 100644 --- a/configuration.nix +++ b/configuration.nix @@ -107,6 +107,7 @@ ./modules/monitoring.nix ./modules/periodic.nix ./modules/communication.nix + ./modules/information.nix ]; } diff --git a/modules/information.nix b/modules/information.nix new file mode 100644 index 0000000..dd7eca9 --- /dev/null +++ b/modules/information.nix @@ -0,0 +1,27 @@ +{ config, lib, pkgs, ... }: + +{ + # Miniflux configuration + services.miniflux = { + enable = true; + adminCredentialsFile = "/var/keys/miniflux/admin"; + config = { + BASE_URL = "https://rss.coolneng.duckdns.org"; + RUN_MIGRATIONS = "1"; + }; + }; + + # Php-fpm pool for Wallabag + services.phpfpm.pools.wallabag = { + user = "nginx"; + group = "nginx"; + settings = { + "pm" = "dynamic"; + "pm.start_servers" = 2; + "pm.max_children " = 4; + "pm.min_spare_servers " = 2; + "pm.max_spare_servers" = 4; + "pm.max_requests" = 32; + }; + }; +} diff --git a/modules/webstack.nix b/modules/webstack.nix index 012561f..662f8f2 100644 --- a/modules/webstack.nix +++ b/modules/webstack.nix @@ -3,6 +3,7 @@ environment.systemPackages = with pkgs; [ libressl ]; + # Reverse proxy configuration services.nginx = { enable = true; recommendedTlsSettings = true; @@ -118,6 +119,21 @@ }; }; }; + "wallabag.coolneng.duckdns.org" = { + root = "${pkgs.wallabag}/web"; + locations."/" = { tryFiles = "$uri /app.php$is_args$args"; }; + locations."~ ^/app.php(/|$)" = { + extraConfig = '' + include ${pkgs.nginx}/conf/fastcgi.conf; + fastcgi_pass unix:/run/phpfpm/wallabag.sock; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param WALLABAG_DATA /var/lib/wallabag/app; + fastcgi_param DOCUMENT_ROOT $realpath_root; + internal; + ''; + }; + }; }; }; @@ -134,6 +150,7 @@ "rss.coolneng.duckdns.org" "matrix.coolneng.duckdns.org" "element.coolneng.duckdns.org" + "wallabag.coolneng.duckdns.org" ]; }; }; @@ -158,16 +175,6 @@ ''; }; - # Miniflux configuration - services.miniflux = { - enable = true; - adminCredentialsFile = "/var/keys/miniflux/admin"; - config = { - BASE_URL = "https://rss.coolneng.duckdns.org"; - RUN_MIGRATIONS = "1"; - }; - }; - # Restart reverse proxy after services startup systemd.services.nginx.after = [ "gitea.service" @@ -176,5 +183,6 @@ "radicale.service" "matrix-synapse.service" "element.service" + "phpfpm-wallabag.service" ]; }