2022-03-10 21:52:12 +01:00
|
|
|
{
|
|
|
|
|
pkgs,
|
|
|
|
|
lib,
|
|
|
|
|
...
|
|
|
|
|
}: let
|
2022-02-22 20:34:53 +01:00
|
|
|
inherit (import <niveum/lib>) serveHtml;
|
2022-02-22 21:52:17 +01:00
|
|
|
remote = "https://cgit.lassul.us/stockholm";
|
2022-03-10 21:52:12 +01:00
|
|
|
in {
|
2022-02-22 20:34:53 +01:00
|
|
|
services.nginx.virtualHosts."redaktion.r".locations."/".extraConfig = serveHtml <niveum/lib/radio-news.html> pkgs;
|
2022-02-22 21:52:17 +01:00
|
|
|
|
2022-05-22 11:47:59 +02:00
|
|
|
niveum.passport.services = [
|
|
|
|
|
{
|
|
|
|
|
title = "Retiolum Radio News";
|
|
|
|
|
link = "http://redaktion.r";
|
|
|
|
|
description = "supplies git history news to radio lassulus and lets you enter your own.";
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
|
2022-02-22 21:52:17 +01:00
|
|
|
systemd.services.stockholm-history = {
|
|
|
|
|
startAt = "hourly";
|
|
|
|
|
script = ''
|
|
|
|
|
stockholm=$(mktemp -d)
|
|
|
|
|
trap clean EXIT
|
|
|
|
|
clean() {
|
|
|
|
|
rm -rf "$stockholm"
|
|
|
|
|
}
|
|
|
|
|
${pkgs.git}/bin/git clone ${remote} "$stockholm"
|
2022-05-24 11:10:59 +02:00
|
|
|
${pkgs.git}/bin/git --git-dir "$stockholm"/.git log --pretty='"%s" by %an, %ar.' --since "$(${pkgs.coreutils}/bin/date -I -d "yesterday")" \
|
2022-02-22 21:52:17 +01:00
|
|
|
| ${pkgs.jq}/bin/jq -R '{text: ., from: now | todateiso8601, to: (now + (60 * 60)) | todateiso8601}' \
|
2022-05-25 17:05:19 +02:00
|
|
|
| ${pkgs.curl}/bin/curl -Ssfd @- http://radio-news.r/
|
2022-02-22 21:52:17 +01:00
|
|
|
'';
|
|
|
|
|
};
|
2022-02-22 20:34:53 +01:00
|
|
|
}
|