1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 19:11:08 +01:00

2 Commits

Author SHA1 Message Date
2ba3c05e4a radio-news: good news only 2025-05-28 09:32:26 +02:00
6ab7e96894 wallabag: init 2025-05-28 09:31:50 +02:00
3 changed files with 55 additions and 7 deletions

View File

@@ -12,6 +12,7 @@ in {
./radio.nix
./panoptikon.nix
./hledger.nix
./wallabag.nix
./alew.nix
../../configs/monitoring.nix
../../configs/mycelium.nix

44
systems/ful/wallabag.nix Normal file
View File

@@ -0,0 +1,44 @@
{ pkgs, config, ... }:
let
domain = "pocket.kmein.de";
port = "8088";
dataPath = "/var/lib/wallabag";
in
{
services.nginx.virtualHosts.${domain} = {
enableACME = true;
forceSSL = true;
locations."/" = {
proxyPass = "http://127.0.0.1:${port}";
proxyWebsockets = true;
};
extraConfig = ''
client_body_timeout 3000s;
client_header_timeout 3000s;
keepalive_timeout 3000s;
proxy_read_timeout 3000s;
proxy_connect_timeout 3000s;
proxy_send_timeout 3000s;
'';
};
services.restic.backups.niveum.paths = [ dataPath ];
virtualisation.oci-containers.containers."${domain}" = {
autoStart = true;
image = "wallabag/wallabag:2.6.12";
ports = [ "${port}:80" ];
volumes = [
"${dataPath}/data:/var/www/wallabag/data"
"${dataPath}/images:/var/www/wallabag/web/assets/images"
];
environment = {
SYMFONY__ENV__DOMAIN_NAME = "https://${domain}";
SYMFONY__ENV__FOSUSER_CONFIRMATION = "false";
PHP_MEMORY_LIMIT = "512M";
SYMFONY__ENV__SERVER_NAME = "Wallabag";
};
extraOptions = [ "--pull=always" ];
};
}

View File

@@ -23,20 +23,24 @@ in {
startAt = "*:50";
script = ''
set -efu
PATH=$PATH:${lib.makeBinPath [pkgs.w3m pkgs.gnused pkgs.curl pkgs.jq]}
PATH=$PATH:${lib.makeBinPath [pkgs.w3m pkgs.gnused pkgs.curl pkgs.jq pkgs.yq]}
export GEMINI_API_KEY="$(cat "$CREDENTIALS_DIRECTORY/gemini-api-key")"
WIKI_URL="https://en.wikipedia.org/wiki/Portal:Current_events"
EVENTS=$(w3m -dump "$WIKI_URL" | sed -n "/$(date -I)/,/$(date -I -d yesterday)/p" | head -n -1)
EVENTS=$(
curl https://www.goodnewsnetwork.org/feed/ \
| xq '
.rss.channel.item
| map(select((.pubDate|strptime("%a, %d %b %Y %H:%M:%S %z")) as $date | ($date | mktime) > (now - (60 * 60 * 24))) | {title, description})
'
)
SYSTEM_PROMPT=$(cat <<EOF
You are a news anchor writing a short news digest for a radio broadcast.
Summarize the following news headlines into a cohesive, engaging script under 400 words.
Keep it professional, concise, and easy to follow.
Begin the digest with: "Here's your news update for $(date -u +"%B %d, %Y")."
Begin the digest with: "Here's your good news update for $(date -u +"%B %d, %Y")."
EOF
)
@@ -53,8 +57,7 @@ in {
{
"parts": [
{
"text": "Current events (from Wikipedia): $(echo "$EVENTS")"
"text": $(jq -Rs <<< "$EVENTS")
}
]
}