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

6 Commits

Author SHA1 Message Date
github-actions[bot]
cc90b1bac4 flake.lock: Update
Flake lock file updates:

• Updated input 'home-manager':
    'github:nix-community/home-manager/684e85d01d333be91c4875baebb05b93c7d2ffaa' (2022-06-01)
  → 'github:nix-community/home-manager/70824bb5c790b820b189f62f643f795b1d2ade2e' (2022-06-07)
• Added input 'home-manager/flake-compat':
    'github:edolstra/flake-compat/b4a34015c698c7793d592d66adbab377907a2be8' (2022-04-19)
• Added input 'home-manager/nmd':
    'gitlab:rycee/nmd/9e7a20e6ee3f6751f699f79c0b299390f81f7bcd' (2022-05-23)
• Added input 'home-manager/nmt':
    'gitlab:rycee/nmt/d83601002c99b78c89ea80e5e6ba21addcfe12ae' (2022-03-23)
• Added input 'home-manager/utils':
    'github:numtide/flake-utils/1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1' (2022-05-30)
• Updated input 'nixos-stable':
    'github:NixOS/nixpkgs/7a20c208aacf4964c19186dcad51f89165dc7ed0' (2022-06-03)
  → 'github:NixOS/nixpkgs/dab6df51387c3878cdea09f43589a15729cae9f4' (2022-06-11)
• Updated input 'nixos-unstable':
    'github:NixOS/nixpkgs/236cc2971ac72acd90f0ae3a797f9f83098b17ec' (2022-06-03)
  → 'github:NixOS/nixpkgs/e0169d7a9d324afebf5679551407756c77af8930' (2022-06-08)
• Updated input 'retiolum':
    'github:krebs/retiolum/ac9e1d5b02c5667ba12aa6d6ab077cc071ffc2f4' (2022-05-30)
  → 'github:krebs/retiolum/8c41abaeed7f862b02dddd31eae204e262799c4b' (2022-06-06)
• Updated input 'stockholm':
    'git+https://cgit.lassul.us/stockholm?ref=refs%2fheads%2fmaster&rev=4a9f93e8933d87ce8f04965b2772564527f1e2fd' (2022-05-29)
  → 'git+https://cgit.lassul.us/stockholm?ref=refs%2fheads%2fmaster&rev=18ea4967c1a708a70c0c807c4ba2f602bc72570c' (2022-06-10)
2022-06-12 00:54:37 +00:00
28949a1072 feat(neovim): dim 2022-06-08 09:52:54 +02:00
0a6b5300b0 fix: pin nixpkgs for telegram bots 2022-06-08 09:52:08 +02:00
b9c34994c2 feat(radio-news): send stockholm history on time 2022-06-07 11:02:46 +02:00
95f5ee330b feat(radio-news): local time 2022-06-06 17:12:50 +02:00
eb9e7f534d Merge pull request #17 from kmein/update_flake_lock_action
flake.lock: Update
2022-06-05 18:00:12 +02:00
6 changed files with 121 additions and 37 deletions

View File

@@ -44,6 +44,15 @@
vim-repeat
vim-sensible
vim-surround
(pkgs.vimUtils.buildVimPlugin {
name = "vim-dim-1.1.0";
src = pkgs.fetchFromGitHub {
owner = "jeffkreeftmeijer";
repo = "vim-dim";
rev = "1.1.0";
sha256 = "sha256-lyTZUgqUEEJRrzGo1FD8/t8KBioPrtB3MmGvPeEVI/g=";
};
})
];
opt = [
csv

View File

@@ -4,7 +4,8 @@
lib,
...
}: let
telebots = pkgs.callPackage <telebots> {};
nixpkgs-21-11 = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-21.11.tar.gz") {};
telebots = nixpkgs-21-11.callPackage <telebots> {};
reverseDirectory = "/run/telegram-reverse";
proverbDirectory = "/run/telegram-proverb";
inherit (import <niveum/lib>) tmpfilesConfig;
@@ -49,7 +50,7 @@ in {
description = "Telegram reverse bot";
path = [pkgs.ffmpeg];
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/reverse.token>;
enable = false;
enable = true;
script = "${telebots}/bin/telegram-reverse";
serviceConfig.Restart = "always";
serviceConfig.WorkingDirectory = reverseDirectory;
@@ -59,7 +60,7 @@ in {
wantedBy = ["multi-user.target"];
description = "Telegram beta code bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/betacode.token>;
enable = false;
enable = true;
script = "${telebots}/bin/telegram-betacode";
serviceConfig.Restart = "always";
};
@@ -68,7 +69,7 @@ in {
wantedBy = ["multi-user.target"];
description = "Telegram proverb bot";
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/proverb.token>;
enable = false;
enable = true;
script = "${telebots}/bin/telegram-proverb";
serviceConfig.Restart = "always";
serviceConfig.WorkingDirectory = proverbDirectory;

101
flake.lock generated
View File

@@ -1,5 +1,21 @@
{
"nodes": {
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1650374568,
"narHash": "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "b4a34015c698c7793d592d66adbab377907a2be8",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1653893745,
@@ -17,16 +33,20 @@
},
"home-manager": {
"inputs": {
"flake-compat": "flake-compat",
"nixpkgs": [
"nixos-unstable"
]
],
"nmd": "nmd",
"nmt": "nmt",
"utils": "utils"
},
"locked": {
"lastModified": 1654113406,
"narHash": "sha256-70esZvhal+FsyU89mJRcAb+cDGHKt0sgZ6MlRr9Cplg=",
"lastModified": 1654628474,
"narHash": "sha256-Llm9X8Af15uC9IMStxqjCfO15WgYTqTnsQq8wMcpp5Q=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "684e85d01d333be91c4875baebb05b93c7d2ffaa",
"rev": "70824bb5c790b820b189f62f643f795b1d2ade2e",
"type": "github"
},
"original": {
@@ -109,11 +129,11 @@
},
"nixos-stable": {
"locked": {
"lastModified": 1654275867,
"narHash": "sha256-pt14ZE4jVPGvfB2NynGsl34pgXfOqum5YJNpDK4+b9E=",
"lastModified": 1654936503,
"narHash": "sha256-soKzdhI4jTHv/rSbh89RdlcJmrPgH8oMb/PLqiqIYVQ=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "7a20c208aacf4964c19186dcad51f89165dc7ed0",
"rev": "dab6df51387c3878cdea09f43589a15729cae9f4",
"type": "github"
},
"original": {
@@ -125,11 +145,11 @@
},
"nixos-unstable": {
"locked": {
"lastModified": 1654230545,
"narHash": "sha256-8Vlwf0x8ow6pPOK2a04bT+pxIeRnM1+O0Xv9/CuDzRs=",
"lastModified": 1654682581,
"narHash": "sha256-Jb1PQCwKgwdNAp907eR5zPzuxV+kRroA3UIxUxCMJ9s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "236cc2971ac72acd90f0ae3a797f9f83098b17ec",
"rev": "e0169d7a9d324afebf5679551407756c77af8930",
"type": "github"
},
"original": {
@@ -139,6 +159,38 @@
"type": "github"
}
},
"nmd": {
"flake": false,
"locked": {
"lastModified": 1653339422,
"narHash": "sha256-8nc7lcYOgih3YEmRMlBwZaLLJYpLPYKBlewqHqx8ieg=",
"owner": "rycee",
"repo": "nmd",
"rev": "9e7a20e6ee3f6751f699f79c0b299390f81f7bcd",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmd",
"type": "gitlab"
}
},
"nmt": {
"flake": false,
"locked": {
"lastModified": 1648075362,
"narHash": "sha256-u36WgzoA84dMVsGXzml4wZ5ckGgfnvS0ryzo/3zn/Pc=",
"owner": "rycee",
"repo": "nmt",
"rev": "d83601002c99b78c89ea80e5e6ba21addcfe12ae",
"type": "gitlab"
},
"original": {
"owner": "rycee",
"repo": "nmt",
"type": "gitlab"
}
},
"recht": {
"flake": false,
"locked": {
@@ -158,11 +210,11 @@
"retiolum": {
"flake": false,
"locked": {
"lastModified": 1653896694,
"narHash": "sha256-c37fCbsOydJQoiE4l81hltJLF9BkKowrlhEjVc8e3iQ=",
"lastModified": 1654544575,
"narHash": "sha256-6ZrUcFhiCeOwS2qjFEhj/TA5Hx2D7mZ4fojzdAz5p4c=",
"owner": "krebs",
"repo": "retiolum",
"rev": "ac9e1d5b02c5667ba12aa6d6ab077cc071ffc2f4",
"rev": "8c41abaeed7f862b02dddd31eae204e262799c4b",
"type": "github"
},
"original": {
@@ -210,11 +262,11 @@
"stockholm": {
"flake": false,
"locked": {
"lastModified": 1653851789,
"narHash": "sha256-KMw9DS40WKHdQti0nwHQguKgIQJ+yexT2wBAfYskCps=",
"lastModified": 1654854399,
"narHash": "sha256-iL2raUfqt+myKjDrmA/TZ7bCaaDmbzqZljHgRyZ7dX0=",
"ref": "refs/heads/master",
"rev": "4a9f93e8933d87ce8f04965b2772564527f1e2fd",
"revCount": 10604,
"rev": "18ea4967c1a708a70c0c807c4ba2f602bc72570c",
"revCount": 10677,
"type": "git",
"url": "https://cgit.lassul.us/stockholm"
},
@@ -286,6 +338,21 @@
"repo": "tuna",
"type": "github"
}
},
"utils": {
"locked": {
"lastModified": 1653893745,
"narHash": "sha256-0jntwV3Z8//YwuOjzhV2sgJJPt+HY6KhU7VZUL0fKZQ=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "1ed9fb1935d260de5fe1c2f7ee0ebaae17ed2fa1",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
}
},
"root": "root",

View File

@@ -75,15 +75,19 @@
const startDate = document.createElement("time");
startDate.className = "start";
startDate.title = start.toString();
startDate.title = isoString(start);
startDate.setAttribute("datetime", isoString(start));
startDate.appendChild(document.createTextNode(isoString(start)));
startDate.appendChild(
document.createTextNode(start.toLocaleString())
);
const endDate = document.createElement("time");
endDate.className = "end";
endDate.title = end.toString();
endDate.title = isoString(end);
endDate.setAttribute("datetime", isoString(end));
endDate.appendChild(document.createTextNode(isoString(end)));
endDate.appendChild(
document.createTextNode(end.toLocaleString())
);
li.appendChild(document.createTextNode(newsItem.text));
li.appendChild(startDate);
@@ -103,24 +107,27 @@
request.open("POST", newsEndpoint, false); // synchronous
request.send(
JSON.stringify({
from: formData.get("from") + ":00Z",
to: formData.get("to") + ":00Z",
from: isoString(new Date(formData.get("from"))),
to: isoString(new Date(formData.get("to"))),
text: formData.get("text"),
})
);
location.reload();
}
const pad2 = (int) => (int < 10 ? `0${int}` : int.toString());
const localIsoString = (date) =>
`${date.getFullYear()}-${pad2(date.getMonth() + 1)}-${pad2(
date.getDate()
)}T${pad2(date.getHours())}:${pad2(date.getMinutes())}`;
function setDate() {
let now = new Date();
document.getElementById("time-from").value = now
.toISOString()
.slice(0, 16);
document.getElementById("time-from").value = localIsoString(now);
now.setHours(now.getHours() + 1);
document.getElementById("time-to").value = now
.toISOString()
.slice(0, 16);
document.getElementById("time-to").value = localIsoString(now);
}
window.onload = () => {
@@ -135,9 +142,9 @@
<section>
<h1>Submit news</h1>
<form onsubmit="sendNews(event)">
<label>Start date (UTC)</label>
<label>Start time</label>
<input type="datetime-local" id="time-from" name="from" required />
<label>End date (UTC)</label>
<label>End time</label>
<input type="datetime-local" id="time-to" name="to" required />
<label>News text</label>
<textarea name="text" rows="10" required></textarea>

View File

@@ -7,7 +7,7 @@ nnoremap <C-p> :FZF<CR>
nnoremap <C-l> :Rg<CR>
let g:fzf_layout = { 'down': '~15%' }
colorscheme paramount
colorscheme dim
" transparent background
hi Normal guibg=NONE ctermbg=NONE

View File

@@ -17,7 +17,7 @@ in {
];
systemd.services.stockholm-history = {
startAt = "hourly";
startAt = "*:58:00";
script = ''
stockholm=$(mktemp -d)
trap clean EXIT