Rewrite the ttrss module to match the current setup

This commit is contained in:
Andreas Zweili 2022-11-02 21:44:24 +01:00
parent 9cf4c745f6
commit 17a033cd4f
2 changed files with 15 additions and 28 deletions

View File

@ -1,47 +1,32 @@
{ inputs, pkgs, ... }:
let
domain = "test.2li.ch";
in
{ inputs, domain, config, ... }:
{
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;
'';
};
age.secrets.ttrssEnv.file = "${inputs.self}/scrts/ttrss_env.age";
virtualisation.oci-containers = {
backend = "docker";
containers."ttrss" = {
image = "ghcr.io/nebucatnetzer/tt-rss-aarch64/ttrss-fpm-pgsql-static";
autoStart = false;
image = "registry.gitlab.com/lunik1/docker-tt-rss";
autoStart = true;
environment = {
PUID = "1000";
PGID = "1000";
TZ = "Europe/Zurich";
TTRSS_DB_TYPE = "mysql";
TTRSS_DB_USER = "ttrss";
TTRSS_DB_NAME = "ttrssdb";
TTRSS_DB_PASS = "ttrss";
TTRSS_DB_PORT = "3306";
TTRSS_DB_HOST = "host.docker.internal";
TTRSS_SELF_URL_PATH = "https://test.2li.ch";
TTRSS_SELF_URL_PATH = "${domain}";
};
# environmentFiles = "";
environmentFiles = [ config.age.secrets.ttrssEnv.path ];
ports = [
"8080:80"
];
volumes = [
"/home/andreas/ttrss/config:/config"
"/home/andreas/docker_systems/ttrss/config:/config"
];
extraOptions = [ "--add-host=host.docker.internal:host-gateway" ];
};
};
}

View File

@ -1,4 +1,4 @@
{ custom, hostname, inputs, pkgs, ... }:
{ config, custom, hostname, inputs, pkgs, ... }:
let
domain = "ttrss.2li.ch";
in
@ -14,7 +14,9 @@ in
(import "${inputs.self}/modules/restic-server-mysql-client" {
time = "23:00"; inherit custom hostname inputs pkgs;
})
"${inputs.self}/modules/docker"
(import "${inputs.self}/modules/ttrss" {
inherit config domain inputs;
})
"${inputs.self}/modules/mariadb"
];
}