mirror of
https://github.com/kmein/niveum
synced 2026-03-22 12:51:08 +01:00
Compare commits
2 Commits
ddd759a838
...
2ba3c05e4a
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ba3c05e4a | |||
| 6ab7e96894 |
@@ -12,6 +12,7 @@ in {
|
|||||||
./radio.nix
|
./radio.nix
|
||||||
./panoptikon.nix
|
./panoptikon.nix
|
||||||
./hledger.nix
|
./hledger.nix
|
||||||
|
./wallabag.nix
|
||||||
./alew.nix
|
./alew.nix
|
||||||
../../configs/monitoring.nix
|
../../configs/monitoring.nix
|
||||||
../../configs/mycelium.nix
|
../../configs/mycelium.nix
|
||||||
|
|||||||
44
systems/ful/wallabag.nix
Normal file
44
systems/ful/wallabag.nix
Normal 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" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -23,20 +23,24 @@ in {
|
|||||||
startAt = "*:50";
|
startAt = "*:50";
|
||||||
script = ''
|
script = ''
|
||||||
set -efu
|
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")"
|
export GEMINI_API_KEY="$(cat "$CREDENTIALS_DIRECTORY/gemini-api-key")"
|
||||||
|
|
||||||
WIKI_URL="https://en.wikipedia.org/wiki/Portal:Current_events"
|
EVENTS=$(
|
||||||
|
curl https://www.goodnewsnetwork.org/feed/ \
|
||||||
EVENTS=$(w3m -dump "$WIKI_URL" | sed -n "/$(date -I)/,/$(date -I -d yesterday)/p" | head -n -1)
|
| 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
|
SYSTEM_PROMPT=$(cat <<EOF
|
||||||
You are a news anchor writing a short news digest for a radio broadcast.
|
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.
|
Summarize the following news headlines into a cohesive, engaging script under 400 words.
|
||||||
Keep it professional, concise, and easy to follow.
|
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
|
EOF
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -53,8 +57,7 @@ in {
|
|||||||
{
|
{
|
||||||
"parts": [
|
"parts": [
|
||||||
{
|
{
|
||||||
"text": "Current events (from Wikipedia): $(echo "$EVENTS")"
|
"text": $(jq -Rs <<< "$EVENTS")
|
||||||
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user