mirror of
https://github.com/kmein/niveum
synced 2026-03-22 04:41:07 +01:00
Compare commits
11 Commits
new-krops
...
f7b9008ed0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7b9008ed0 | ||
| 81706489b5 | |||
| 817f57ad09 | |||
| eafb1ce0c3 | |||
| 0c72a89760 | |||
| a7db357e54 | |||
| 1ad6c63a2f | |||
| 502ab93585 | |||
|
|
fe6bda3cf2 | ||
| c64e681ada | |||
| af813cc876 |
26
flake.lock
generated
26
flake.lock
generated
@@ -109,11 +109,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1644837400,
|
"lastModified": 1645652565,
|
||||||
"narHash": "sha256-treFS89w/xKzeTjJSJdYp/Ceddv6oqq7bL9mZMQDPi0=",
|
"narHash": "sha256-yVQN2Wi8xSSpuj6JTck/6IOJ40hNvmoReMvFY86xd9w=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "a03ae0e6d078cfdbb8404c3bff3622bd4e2f1c57",
|
"rev": "4275a321beab5a71872fb7a5fe5da511bb2bec73",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -125,11 +125,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs-unstable": {
|
"nixpkgs-unstable": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1644951967,
|
"lastModified": 1645917420,
|
||||||
"narHash": "sha256-j+l8bt++dsYTJSGABuqeBEom5aNpD4n0BsOTdewFYuU=",
|
"narHash": "sha256-y/F63lVqvxlBt5brDCV/QUdcnP7acvtR6Mf0Phrr13Q=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "05e1f8a2c7797b0d9f9e07ab2aaeccecdcf9b7da",
|
"rev": "6f21ff94fc44af21973c6fdae6e03323382b7909",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -158,11 +158,11 @@
|
|||||||
"retiolum": {
|
"retiolum": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1644849126,
|
"lastModified": 1645558430,
|
||||||
"narHash": "sha256-iaRNvfQrUD+ZownDWWNdDwhVPgSsU5ojvVdswVq1IpY=",
|
"narHash": "sha256-Q8URzBIbh6vHf5QHKWHEMUDbRHeyVSFpqB8i4PmnX6M=",
|
||||||
"owner": "krebs",
|
"owner": "krebs",
|
||||||
"repo": "retiolum",
|
"repo": "retiolum",
|
||||||
"rev": "6de359ef848dc1f38fb76731c35e712ee885fd88",
|
"rev": "5e69ac7782c7d384a4b6cad4619dd83aa952426f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -210,11 +210,11 @@
|
|||||||
"stockholm": {
|
"stockholm": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1644865613,
|
"lastModified": 1645880762,
|
||||||
"narHash": "sha256-z7hPtMYxoQuWyLujUs5vbdZOGbjFosh+/IX3GpCDlkc=",
|
"narHash": "sha256-SPSnMKtPzBNzxHxMi3jnoeoaQ14Ddua9rM/P/1mwMYs=",
|
||||||
"ref": "master",
|
"ref": "master",
|
||||||
"rev": "e3785b22b2c6cb173a58fd066c4eda80a67fb872",
|
"rev": "a67ded588b45c09ca58a3b4007a8d32e42323613",
|
||||||
"revCount": 10404,
|
"revCount": 10414,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://cgit.lassul.us/stockholm"
|
"url": "https://cgit.lassul.us/stockholm"
|
||||||
},
|
},
|
||||||
|
|||||||
143
lib/radio-news.html
Normal file
143
lib/radio-news.html
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>lassulus radio news</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
main {
|
||||||
|
max-width: 800px;
|
||||||
|
margin: 0 auto;
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 2fr 1fr;
|
||||||
|
grid-gap: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#news-list ul {
|
||||||
|
list-style: none;
|
||||||
|
padding-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#news-list li {
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#news-list time {
|
||||||
|
display: block;
|
||||||
|
color: grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
form label {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
form input,
|
||||||
|
form textarea {
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 768px) {
|
||||||
|
main {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script>
|
||||||
|
const newsEndpoint = "http://prism.r:7999";
|
||||||
|
|
||||||
|
function isoString(date) {
|
||||||
|
return date.toISOString().slice(0, -5) + "Z";
|
||||||
|
}
|
||||||
|
|
||||||
|
function setNextNews() {
|
||||||
|
document.getElementById("next-news").innerHTML = (
|
||||||
|
60 - new Date().getUTCMinutes()
|
||||||
|
).toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
setInterval(setNextNews, 6000);
|
||||||
|
|
||||||
|
function fetchNews() {
|
||||||
|
fetch(newsEndpoint).then((response) => {
|
||||||
|
response.json().then((news) => {
|
||||||
|
const newsList = document.getElementById("news-list");
|
||||||
|
newsList.innerHTML = "";
|
||||||
|
const ul = document.createElement("ul");
|
||||||
|
for (const newsItem of news) {
|
||||||
|
const start = new Date(newsItem.from);
|
||||||
|
const end = new Date(newsItem.to);
|
||||||
|
|
||||||
|
const li = document.createElement("li");
|
||||||
|
|
||||||
|
const startDate = document.createElement("time");
|
||||||
|
startDate.className = "start";
|
||||||
|
startDate.title = start.toString();
|
||||||
|
startDate.setAttribute("datetime", isoString(start));
|
||||||
|
startDate.appendChild(document.createTextNode(isoString(start)));
|
||||||
|
|
||||||
|
const endDate = document.createElement("time");
|
||||||
|
endDate.className = "end";
|
||||||
|
endDate.title = end.toString();
|
||||||
|
endDate.setAttribute("datetime", isoString(end));
|
||||||
|
endDate.appendChild(document.createTextNode(isoString(end)));
|
||||||
|
|
||||||
|
li.appendChild(document.createTextNode(newsItem.text));
|
||||||
|
li.appendChild(startDate);
|
||||||
|
li.appendChild(endDate);
|
||||||
|
ul.appendChild(li);
|
||||||
|
}
|
||||||
|
newsList.appendChild(ul);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function sendNews(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
const formData = new FormData(event.target);
|
||||||
|
|
||||||
|
const request = new XMLHttpRequest();
|
||||||
|
request.open("POST", newsEndpoint, false); // synchronous
|
||||||
|
request.send(
|
||||||
|
JSON.stringify({
|
||||||
|
from: isoString(new Date(formData.get("from"))),
|
||||||
|
to: isoString(new Date(formData.get("to"))),
|
||||||
|
text: formData.get("text"),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
window.onload = () => {
|
||||||
|
setNextNews();
|
||||||
|
fetchNews();
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main>
|
||||||
|
<section>
|
||||||
|
<h1>Submit news</h1>
|
||||||
|
<form onsubmit="sendNews(event)">
|
||||||
|
<label>Start date</label>
|
||||||
|
<input type="datetime-local" name="from" required />
|
||||||
|
<label>End date</label>
|
||||||
|
<input type="datetime-local" name="to" required />
|
||||||
|
<label>News text</label>
|
||||||
|
<textarea name="text" rows="10" required></textarea>
|
||||||
|
<input type="submit" />
|
||||||
|
</form>
|
||||||
|
Next news report should start in <span id="next-news"></span> minutes.
|
||||||
|
</section>
|
||||||
|
<aside>
|
||||||
|
<h1>Planned news</h1>
|
||||||
|
<div id="news-list">
|
||||||
|
<em>No news planned yet.</em>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -44,7 +44,7 @@ let
|
|||||||
caster-fm = subdomain: port: "http://${subdomain}.caster.fm:${toString port}/listen.mp3?authn0b0236758bd0e178156d0787327a055d";
|
caster-fm = subdomain: port: "http://${subdomain}.caster.fm:${toString port}/listen.mp3?authn0b0236758bd0e178156d0787327a055d";
|
||||||
in [
|
in [
|
||||||
{
|
{
|
||||||
stream = "https://radio.lassul.us/radio.ogg";
|
stream = "http://lassul.us:8000/radio.ogg";
|
||||||
station = "Radio lassulus";
|
station = "Radio lassulus";
|
||||||
logo = "http://lassul.us/art/portraits/selbstportrait.jpg";
|
logo = "http://lassul.us/art/portraits/selbstportrait.jpg";
|
||||||
desc = "Diminutive from lassus (“weary, faint, tired”). A programming human. Doing superior professional art.";
|
desc = "Diminutive from lassus (“weary, faint, tired”). A programming human. Doing superior professional art.";
|
||||||
|
|||||||
@@ -10,11 +10,12 @@ in
|
|||||||
./matterbridge.nix
|
./matterbridge.nix
|
||||||
./menstruation.nix
|
./menstruation.nix
|
||||||
./moinbot.nix
|
./moinbot.nix
|
||||||
./horoscopy.nix
|
# ./horoscopy.nix
|
||||||
./monitoring
|
./monitoring
|
||||||
./moodle-dl-borsfaye.nix
|
./moodle-dl-borsfaye.nix
|
||||||
./names.nix
|
./names.nix
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
|
./radio-news.nix
|
||||||
./radio.nix
|
./radio.nix
|
||||||
./retiolum-map.nix
|
./retiolum-map.nix
|
||||||
./tarot.nix
|
./tarot.nix
|
||||||
|
|||||||
@@ -1,16 +1,5 @@
|
|||||||
{ pkgs, lib, ... }:
|
{ pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
nixpkgs.overlays = [
|
|
||||||
(self: super: {
|
|
||||||
matterbridge = (import (super.fetchFromGitHub {
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nixpkgs";
|
|
||||||
rev = "e45d91ee65db293a172ec506759d1248e40c35f5";
|
|
||||||
sha256 = "03cjs5xcx09lw0djyrx2kfakw7gkg4iqmy9w25azai62im39l30k";
|
|
||||||
}) {}).matterbridge;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
services.matterbridge = {
|
services.matterbridge = {
|
||||||
enable = true;
|
enable = true;
|
||||||
configPath =
|
configPath =
|
||||||
|
|||||||
23
systems/makanek/radio-news.nix
Normal file
23
systems/makanek/radio-news.nix
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (import <niveum/lib>) serveHtml;
|
||||||
|
remote = "https://cgit.lassul.us/stockholm";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts."redaktion.r".locations."/".extraConfig = serveHtml <niveum/lib/radio-news.html> pkgs;
|
||||||
|
|
||||||
|
systemd.services.stockholm-history = {
|
||||||
|
startAt = "hourly";
|
||||||
|
script = ''
|
||||||
|
stockholm=$(mktemp -d)
|
||||||
|
trap clean EXIT
|
||||||
|
clean() {
|
||||||
|
rm -rf "$stockholm"
|
||||||
|
}
|
||||||
|
${pkgs.git}/bin/git clone ${remote} "$stockholm"
|
||||||
|
${pkgs.git}/bin/git --git-dir "$stockholm"/.git log --pretty='"%s" by %an, %ar' --since "$(${pkgs.coreutils}/bin/date -I -d "yesterday")" \
|
||||||
|
| ${pkgs.jq}/bin/jq -R '{text: ., from: now | todateiso8601, to: (now + (60 * 60)) | todateiso8601}' \
|
||||||
|
| ${pkgs.curl}/bin/curl -Ssfd @- http://prism.r:7999/
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -45,6 +45,36 @@ let
|
|||||||
url = "http://www.zeno.org/Lesesaal/M/E-Books";
|
url = "http://www.zeno.org/Lesesaal/M/E-Books";
|
||||||
filter = [ { element-by-class = "zenoCOMain"; } "html2text" "strip" ];
|
filter = [ { element-by-class = "zenoCOMain"; } "html2text" "strip" ];
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
name = "Arnshaugk Neuerscheinungen";
|
||||||
|
url = "http://www.arnshaugk.de/index.php";
|
||||||
|
filter = [ "html2text" "strip" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "Carolina Welslau";
|
||||||
|
url = "https://carolinawelslau.de/";
|
||||||
|
filter = [ { element-by-id = "main"; } "html2text" "strip" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "WarpGrid: Idiomarium";
|
||||||
|
url = "https://warpgrid.de/idiomarium/";
|
||||||
|
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "WarpGrid: Futurism";
|
||||||
|
url = "https://warpgrid.de/futurism/";
|
||||||
|
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "WarpGrid: Imagiary";
|
||||||
|
url = "https://warpgrid.de/imagiary/";
|
||||||
|
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "WarpGrid: Cook";
|
||||||
|
url = "https://warpgrid.de/alchemy/";
|
||||||
|
filter = [ { element-by-id = "site-content"; } "html2text" "strip" ];
|
||||||
|
}
|
||||||
{
|
{
|
||||||
name = "Indogermanische Forschungen";
|
name = "Indogermanische Forschungen";
|
||||||
url = "https://www.degruyter.com/journal/key/INDO/html";
|
url = "https://www.degruyter.com/journal/key/INDO/html";
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ in {
|
|||||||
address = "irc.hackint.org/6697";
|
address = "irc.hackint.org/6697";
|
||||||
ipv6 = true;
|
ipv6 = true;
|
||||||
ssl = true;
|
ssl = true;
|
||||||
autojoin = [ "#krebs" "#nixos" "#the_playlist" ];
|
autojoin = [ "#krebs" "#hsmr" "#nixos" "#the_playlist" ];
|
||||||
sasl_mechanism = "plain";
|
sasl_mechanism = "plain";
|
||||||
sasl_username = nick;
|
sasl_username = nick;
|
||||||
sasl_password = lib.strings.fileContents <system-secrets/irc/hackint>;
|
sasl_password = lib.strings.fileContents <system-secrets/irc/hackint>;
|
||||||
@@ -75,7 +75,7 @@ in {
|
|||||||
"/msg nickserv identify ${lib.strings.fileContents <system-secrets/irc/oftc>}"
|
"/msg nickserv identify ${lib.strings.fileContents <system-secrets/irc/oftc>}"
|
||||||
"/msg nickserv set cloak on"
|
"/msg nickserv set cloak on"
|
||||||
];
|
];
|
||||||
autojoin = [ "#osm" "#osm-de" "#home-manager" ];
|
autojoin = [ "#home-manager" ];
|
||||||
};
|
};
|
||||||
retiolum = {
|
retiolum = {
|
||||||
autoconnect = true;
|
autoconnect = true;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ in
|
|||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.writers.writeDashBin "restic-niveum" ''
|
(pkgs.writers.writeDashBin "restic-niveum" ''
|
||||||
exec ${pkgs.util-linux}/bin/runuser -u restic -g restic ${pkgs.restic}/bin/restic -r ${toString dataDir} -p ${<secrets/restic/password>} "$@"
|
exec ${pkgs.util-linux}/bin/runuser -u restic -g restic -- ${pkgs.restic}/bin/restic -r ${toString dataDir} -p ${<secrets/restic/password>} "$@"
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user