Set up Wallabag in a new module

This commit is contained in:
coolneng 2021-01-19 00:14:57 +01:00
parent 9c0f51c968
commit 8861a58958
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
4 changed files with 47 additions and 10 deletions

View File

@ -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*

View File

@ -107,6 +107,7 @@
./modules/monitoring.nix
./modules/periodic.nix
./modules/communication.nix
./modules/information.nix
];
}

27
modules/information.nix Normal file
View File

@ -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;
};
};
}

View File

@ -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"
];
}