Add a WIP ttrss solution with postgres

This commit is contained in:
Andreas Zweili 2022-11-02 21:38:40 +01:00
parent 051e4ae3d5
commit 9cf4c745f6
1 changed files with 47 additions and 0 deletions

View File

@ -0,0 +1,47 @@
{ inputs, pkgs, ... }:
let
domain = "test.2li.ch";
in
{
imports = [
(import "${inputs.self}/modules/nginx-fpm" {
dataDir = "/mnt/data/ttrss/app";
inherit domain inputs pkgs;
})
"${inputs.self}/modules/data-share"
"${inputs.self}/modules/docker"
"${inputs.self}/modules/postgresql"
];
services.postgresql = {
ensureDatabases = [ "ttrssdb" ];
initialScript = pkgs.writeText "postgresql-initScript" ''
CREATE ROLE ttrss WITH LOGIN PASSWORD 'ttrss' CREATEDB;
GRANT ALL PRIVILEGES ON DATABASE ttrssdb TO ttrss;
'';
};
virtualisation.oci-containers = {
backend = "docker";
containers."ttrss" = {
image = "ghcr.io/nebucatnetzer/tt-rss-aarch64/ttrss-fpm-pgsql-static";
autoStart = false;
environment = {
TZ = "Europe/Zurich";
TTRSS_DB_USER = "ttrss";
TTRSS_DB_NAME = "ttrssdb";
TTRSS_DB_PASS = "ttrss";
TTRSS_DB_HOST = "host.docker.internal";
TTRSS_SELF_URL_PATH = "https://test.2li.ch";
};
# environmentFiles = "";
ports = [
"8080:80"
];
volumes = [
"/home/andreas/ttrss/config:/config"
];
extraOptions = [ "--add-host=host.docker.internal:host-gateway" ];
};
};
}