mirror of
https://github.com/kmein/niveum
synced 2026-03-20 20:01:08 +01:00
Compare commits
197 Commits
3ea66b6445
...
wayland
| Author | SHA1 | Date | |
|---|---|---|---|
| b274a59a50 | |||
| b4de03bb3c | |||
| b0062abbfe | |||
| 0e9a046c5f | |||
| 72ab319e65 | |||
| f08e43067b | |||
| d0ac0af7c3 | |||
| 5febabb7fa | |||
| 44d29f90e9 | |||
| 1aaf0fe5ae | |||
| e8e165ff03 | |||
| 5175bd5f4a | |||
| 874c502094 | |||
| 4490c0a97c | |||
|
|
8e76899b40 | ||
| 8617c8e982 | |||
| 0025d82cd8 | |||
| 03c0e49572 | |||
| 7c3c13abb8 | |||
| f954e867dc | |||
| 67f682aa88 | |||
| 0ceecf4c14 | |||
| 6fdac40832 | |||
| 2ba3c05e4a | |||
| 6ab7e96894 | |||
| ddd759a838 | |||
| 5244ae3850 | |||
| b90aa5ef07 | |||
| d52c10bc84 | |||
| a6bc317141 | |||
| d4ee3cf692 | |||
| c96ac804df | |||
| 4af218f7ad | |||
| b08576c972 | |||
| 44cb0bf8a5 | |||
| 4c9305c89d | |||
| 8c838966f2 | |||
| 6ffb80322b | |||
| 6e1bbb878a | |||
| 4a1abf06f6 | |||
| e9a6a482ee | |||
| 3bdf539540 | |||
| f053f6292d | |||
| e350eac5c7 | |||
| 046f2ca75d | |||
| 6fcba6dc75 | |||
| 3750b6c131 | |||
| 4046339f5b | |||
| da224a0e4b | |||
| 60a73a81be | |||
| 889eb1d5c2 | |||
|
|
e34b3e02b3 | ||
| d7f01e0a5e | |||
| 6ea3629f77 | |||
| b010f7e7cc | |||
| 0b60f953b7 | |||
| d64ce2036a | |||
| ebe3997beb | |||
| 1b23814dc3 | |||
| df35d1d935 | |||
| b01c289a26 | |||
| dafa3229bb | |||
| dee784472f | |||
| 295f8257e3 | |||
| 5adc8309f2 | |||
| cd58ea209e | |||
| 0ae493a0f5 | |||
| c0f6fc1121 | |||
| dc519dc055 | |||
| 4d178f7bb8 | |||
| c0ba0e605a | |||
| 4620390411 | |||
| a18e295a9e | |||
| f3ae88c6d1 | |||
| d08ed06bc5 | |||
| b648661e60 | |||
| b26b48034c | |||
| 6acfa2927c | |||
| 914a464e4f | |||
| 505031d103 | |||
| b5927a5217 | |||
| 5c87fd6cd4 | |||
| dbb5fe131e | |||
| 89cd81b2f4 | |||
| 2c58405314 | |||
| ffe9f90b4e | |||
| f8c3a9dbef | |||
| 2c6007d404 | |||
| 3253a217d7 | |||
| 7c67964ea8 | |||
| b42ea3d7b6 | |||
| eb2179c0ad | |||
| 61ec35a29b | |||
| 56e44e94e0 | |||
| ee24ef7340 | |||
| a1a0a517a2 | |||
| 265a697136 | |||
| 6e53b32f5d | |||
| af6553abf6 | |||
| d22682519b | |||
| b2065c4155 | |||
| 63f5db1c58 | |||
| f3a5e0a54c | |||
| 136000540b | |||
| 762d766db5 | |||
| 812c795723 | |||
| cf72c1df1f | |||
| 05b35bd9f0 | |||
| 4eb7c46286 | |||
| b42945ac7d | |||
| ea4d334d10 | |||
| dd1bc890bd | |||
| f9fe700f68 | |||
| a0b7362fc5 | |||
| e7a77fbfb5 | |||
| 7d38f3a718 | |||
| 70dde17e88 | |||
| 5f11a95d32 | |||
| d78e738f51 | |||
| c9770d065a | |||
| f42d1ebf28 | |||
| f6621a5bb9 | |||
| 136d4e699f | |||
| a28fca11a7 | |||
| e26b8408f6 | |||
| 69d1fd44f8 | |||
| 677aefbe73 | |||
| e2f784ed3b | |||
| ac3758e027 | |||
| f43e4ff664 | |||
| c15e9812c4 | |||
| a2390d52c5 | |||
| 7ee17cb5b8 | |||
| f535ba7b2a | |||
| 48d10b25ee | |||
| ccd8d63d8d | |||
| 519a1079bc | |||
| 84fa3ee4b6 | |||
| 4774a0ec0f | |||
| 5ba3dfc451 | |||
| 729f1180b7 | |||
| 1e74d0470c | |||
| c1b58f7038 | |||
| 904cc4401e | |||
| 7e033412bd | |||
| 3bdf71425b | |||
| 2067944151 | |||
| c34708b989 | |||
| a07b871bbb | |||
| 9b0b4ca08c | |||
| 09c631b4e5 | |||
| c246310cab | |||
| fef3a1fbff | |||
| dacf34ebc0 | |||
| 4b96e82d25 | |||
| 967c5f32c7 | |||
| 18c5a087f3 | |||
| f40ce68ced | |||
| bfa2b1e9b1 | |||
| 6908b75571 | |||
| ce7fd6074b | |||
| 297b3aba37 | |||
| 228d93f399 | |||
| 6364aa446a | |||
| b5c5be02db | |||
| 0bfabd8226 | |||
| c70e877b42 | |||
| 4f1fc0bea5 | |||
| a664bfbe1b | |||
| a744ed593b | |||
| c9a83021a9 | |||
| bea8f8c150 | |||
| c1bdb5e422 | |||
| 6e82ef3b5a | |||
| 6d16b93530 | |||
| 9f6d1c3dc6 | |||
| aca55b4045 | |||
| c23935afe6 | |||
| 88af7bdcc0 | |||
| 838a61c698 | |||
| 5a9dc34ee8 | |||
| b21c6adccc | |||
| 73ef0aafdc | |||
| 9026d6d281 | |||
| 7c193ba043 | |||
| b72a387b97 | |||
| 7e56757597 | |||
| e0c52b06fd | |||
| e94371887b | |||
| b0bb5047b1 | |||
| 48419a1106 | |||
| b74dda987e | |||
| 1ffae8e5c9 | |||
| b8bf6b2b71 | |||
| 9a42b8e125 | |||
| c7f6257539 | |||
| 008d33265b |
21
.bin/fix-sd.sh
Executable file
21
.bin/fix-sd.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
set -xfu
|
||||
|
||||
drive="$1"
|
||||
mountpoint="/media/sd-card-$(date +%s)"
|
||||
backup_directory="$(pwd)"
|
||||
|
||||
trap clean EXIT
|
||||
clean() {
|
||||
umount "$mountpoint"
|
||||
rmdir "$mountpoint"
|
||||
fsck.exfat "$drive"
|
||||
}
|
||||
|
||||
filenames="$(fsck.exfat "$drive" 2>&1 | sed -nE "s/.* file '(.*?)' is not allocated.*/\1/p")"
|
||||
mkdir "$mountpoint"
|
||||
mount "$drive" "$mountpoint"
|
||||
|
||||
echo "$filenames" | while read -r filename; do
|
||||
find "$mountpoint" -type f -name "$filename" -exec mv {} "$backup_directory" \;
|
||||
done
|
||||
4
.github/workflows/niveum.yml
vendored
4
.github/workflows/niveum.yml
vendored
@@ -11,7 +11,9 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install QEMU (ARM)
|
||||
run: sudo apt-get install -y qemu-user-static
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y qemu-user-static
|
||||
if: ${{ matrix.system == 'ful' }}
|
||||
- name: Install Nix (ARM)
|
||||
uses: cachix/install-nix-action@v16
|
||||
|
||||
@@ -15,6 +15,7 @@ in {
|
||||
pkgs.unzip
|
||||
pkgs.unrar
|
||||
pkgs.p7zip
|
||||
pkgs.sshuttle
|
||||
pkgs.zip
|
||||
# MONITORS
|
||||
pkgs.iftop # interface bandwidth monitor
|
||||
@@ -52,6 +53,22 @@ in {
|
||||
pkgs.psmisc # for killall, pstree
|
||||
];
|
||||
|
||||
|
||||
security.wrappers = {
|
||||
pmount = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.pmount}/bin/pmount";
|
||||
};
|
||||
pumount = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.pmount}/bin/pumount";
|
||||
};
|
||||
};
|
||||
|
||||
environment.shellAliases = let
|
||||
take = pkgs.writers.writeDash "take" ''
|
||||
mkdir "$1" && cd "$1"
|
||||
|
||||
@@ -14,6 +14,12 @@ in {
|
||||
group = config.users.users.me.group;
|
||||
mode = "400";
|
||||
};
|
||||
email-password-letos = {
|
||||
file = ../secrets/email-password-letos.age;
|
||||
owner = config.users.users.me.name;
|
||||
group = config.users.users.me.group;
|
||||
mode = "400";
|
||||
};
|
||||
email-password-posteo = {
|
||||
file = ../secrets/email-password-posteo.age;
|
||||
owner = config.users.users.me.name;
|
||||
@@ -79,9 +85,24 @@ in {
|
||||
address = "2210@cock.li";
|
||||
userName = address;
|
||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-cock.path}";
|
||||
realName = "";
|
||||
realName = "2210";
|
||||
imap.host = "mail.cock.li";
|
||||
imap.port = 993;
|
||||
smtp.host = imap.host;
|
||||
smtp.port = 25;
|
||||
smtp.tls.useStartTls = true;
|
||||
};
|
||||
letos =
|
||||
lib.recursiveUpdate defaults
|
||||
{
|
||||
userName = "slfletos";
|
||||
address = "letos.sprachlit@hu-berlin.de";
|
||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-letos.path}";
|
||||
imap.host = "mailbox.cms.hu-berlin.de";
|
||||
imap.port = 993;
|
||||
smtp.host = "mailhost.cms.hu-berlin.de";
|
||||
smtp.port = 25;
|
||||
smtp.tls.useStartTls = true;
|
||||
};
|
||||
posteo =
|
||||
lib.recursiveUpdate defaults
|
||||
@@ -99,8 +120,7 @@ in {
|
||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-posteo.path}";
|
||||
himalaya = {
|
||||
enable = true;
|
||||
backend = "imap";
|
||||
sender = "smtp";
|
||||
settings.backend = "imap";
|
||||
};
|
||||
aerc.extraAccounts.pgp-key-id = "9EDE82CC72A343A95266D0F444857074A3ACC8B7";
|
||||
};
|
||||
|
||||
@@ -1,58 +1,8 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
alacritty-cfg = theme:
|
||||
(pkgs.formats.yaml {}).generate "alacritty.yml" {
|
||||
bell = {
|
||||
animation = "EaseOut";
|
||||
duration = 100;
|
||||
color = "#ffffff";
|
||||
};
|
||||
font = {
|
||||
normal.family = "Monospace";
|
||||
size = 6;
|
||||
};
|
||||
live_config_reload = true;
|
||||
key_bindings = [
|
||||
{
|
||||
key = "Plus";
|
||||
mods = "Control";
|
||||
action = "IncreaseFontSize";
|
||||
}
|
||||
{
|
||||
key = "Minus";
|
||||
mods = "Control";
|
||||
action = "DecreaseFontSize";
|
||||
}
|
||||
{
|
||||
key = "Key0";
|
||||
mods = "Control";
|
||||
action = "ResetFontSize";
|
||||
}
|
||||
];
|
||||
colors = let
|
||||
colourNames = ["black" "red" "green" "yellow" "blue" "magenta" "cyan" "white"];
|
||||
colourPairs = lib.getAttrs colourNames theme;
|
||||
in {
|
||||
primary = {inherit (theme) background foreground;};
|
||||
cursor = {inherit (theme) cursor;};
|
||||
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
||||
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
||||
};
|
||||
};
|
||||
alacritty-pkg = pkgs.symlinkJoin {
|
||||
name = "alacritty";
|
||||
paths = [
|
||||
(pkgs.writers.writeDashBin "alacritty" ''
|
||||
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml msg create-window "$@" ||
|
||||
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml "$@"
|
||||
'')
|
||||
pkgs.alacritty
|
||||
];
|
||||
};
|
||||
in {
|
||||
environment.variables.TERMINAL = "alacritty";
|
||||
|
||||
@@ -60,7 +10,7 @@ in {
|
||||
programs.alacritty = {
|
||||
enable = true;
|
||||
settings = {
|
||||
key_bindings = [
|
||||
keyboard.bindings = [
|
||||
{
|
||||
key = "Plus";
|
||||
mods = "Control";
|
||||
|
||||
@@ -24,6 +24,7 @@ in {
|
||||
"/home/kfm/cloud"
|
||||
"/home/kfm/mobile"
|
||||
"/home/kfm/.gnupg"
|
||||
"/home/kfm/.electrum"
|
||||
"/home/kfm/.ssh"
|
||||
];
|
||||
};
|
||||
|
||||
@@ -6,9 +6,5 @@
|
||||
};
|
||||
};
|
||||
|
||||
services.blueman.enable = true;
|
||||
|
||||
# environment.systemPackages = [pkgs.blueman];
|
||||
|
||||
home-manager.users.me = {services.blueman-applet.enable = true;};
|
||||
environment.systemPackages = [ pkgs.bluetuith ];
|
||||
}
|
||||
|
||||
@@ -13,17 +13,18 @@
|
||||
autorenkalender =
|
||||
pkgs.python3Packages.callPackage autorenkalender-package {};
|
||||
in {
|
||||
niveum.telegramBots.autorenkalender = {
|
||||
niveum.bots.autorenkalender = {
|
||||
enable = true;
|
||||
time = "07:00";
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@autorenkalender"];
|
||||
parseMode = "Markdown";
|
||||
telegram = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@autorenkalender"];
|
||||
parseMode = "Markdown";
|
||||
};
|
||||
command = "${autorenkalender}/bin/autorenkalender";
|
||||
};
|
||||
|
||||
age.secrets.telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Autorenkalender";
|
||||
79
configs/bots/celan.nix
Normal file
79
configs/bots/celan.nix
Normal file
@@ -0,0 +1,79 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
niveum.bots.celan = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
telegram = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@PaulCelan"];
|
||||
};
|
||||
mastodon = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.mastodon-token-celan.path;
|
||||
language = "de";
|
||||
};
|
||||
command = toString (pkgs.writers.writePython3 "random-celan.py" { libraries = [pkgs.python3Packages.lxml]; } ''
|
||||
from lxml import etree
|
||||
import random
|
||||
|
||||
|
||||
def xml_text(elements):
|
||||
return "".join("".join(t.itertext()) for t in elements).strip()
|
||||
|
||||
|
||||
tree = etree.parse('${pkgs.fetchurl {
|
||||
url = "http://c.krebsco.de/celan.tei.xml";
|
||||
hash = "sha256-HgNmJYfhuwyfm+FcNtnnYWpJpIIU1ElHLeLiIFjF9mE=";
|
||||
}}')
|
||||
root = tree.getroot()
|
||||
|
||||
tei = {"tei": "http://www.tei-c.org/ns/1.0"}
|
||||
|
||||
poems = root.xpath(".//tei:lg[@type='poem']", namespaces=tei)
|
||||
|
||||
poem = random.choice(poems)
|
||||
|
||||
for stanza in poem.xpath("./tei:lg[@type='stanza']", namespaces=tei):
|
||||
for line in stanza.xpath('./tei:l', namespaces=tei):
|
||||
if line.text:
|
||||
print(line.text.strip())
|
||||
print()
|
||||
|
||||
current_element = poem
|
||||
while current_element is not None:
|
||||
if current_element.tag == "{http://www.tei-c.org/ns/1.0}text":
|
||||
text_element = current_element
|
||||
|
||||
title = xml_text(text_element.xpath("./tei:front/tei:docTitle",
|
||||
namespaces=tei))
|
||||
print(f"Aus: #{title.replace(" ", "_")}", end=" ")
|
||||
|
||||
if date := xml_text(text_element.xpath("./tei:front/tei:docDate",
|
||||
namespaces=tei)):
|
||||
print(f"({date})")
|
||||
break
|
||||
current_element = current_element.getparent()
|
||||
|
||||
print("\n\n#PaulCelan #Celan #Lyrik #poetry")
|
||||
'');
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
mastodon-token-celan.file = ../../secrets/mastodon-token-celan.age;
|
||||
};
|
||||
|
||||
systemd.timers.bot-celan.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Paul Celan Bot";
|
||||
description = "sends a random poem by Paul Celan to Telegram.";
|
||||
link = "https://t.me/PaulCelan";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -11,14 +11,15 @@
|
||||
inherit (import ../../lib) tmpfilesConfig;
|
||||
in {
|
||||
imports = [
|
||||
./literature-quote.nix
|
||||
./astrology.nix
|
||||
./logotheca.nix
|
||||
./transits.nix
|
||||
./autorenkalender.nix
|
||||
./hesychius.nix
|
||||
./smyth.nix
|
||||
./nachtischsatan.nix
|
||||
./tlg-wotd.nix
|
||||
./celan.nix
|
||||
./nietzsche.nix
|
||||
];
|
||||
|
||||
systemd.tmpfiles.rules = map (path:
|
||||
39
configs/bots/hesychius.nix
Normal file
39
configs/bots/hesychius.nix
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hesychius = inputs.scripts.outPath + "/hesychius/hesychius.txt";
|
||||
in {
|
||||
niveum.bots.hesychius = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
mastodon = {
|
||||
enable = true;
|
||||
language = "el";
|
||||
tokenFile = config.age.secrets.mastodon-token-hesychius.path;
|
||||
};
|
||||
telegram = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@HesychiosAlexandreus"];
|
||||
};
|
||||
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
|
||||
};
|
||||
|
||||
systemd.timers.bot-hesychius.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
age.secrets = {
|
||||
mastodon-token-hesychius.file = ../../secrets/mastodon-token-hesychius.age;
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Hesychius of Alexandria Bot";
|
||||
description = "sends a random word from Hesychius of Alexandria's lexicon to Telegram.";
|
||||
link = "https://t.me/HesychiosAlexandreus";
|
||||
}
|
||||
];
|
||||
}
|
||||
38
configs/bots/logotheca.nix
Normal file
38
configs/bots/logotheca.nix
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
niveumPackages,
|
||||
...
|
||||
}: {
|
||||
niveum.bots.logotheca = {
|
||||
enable = true;
|
||||
time = "08/6:00";
|
||||
telegram = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["-1001760262519"];
|
||||
parseMode = "Markdown";
|
||||
};
|
||||
matrix = {
|
||||
enable = true;
|
||||
homeserver = "matrix.4d2.org";
|
||||
tokenFile = config.age.secrets.matrix-token-lakai.path;
|
||||
chatIds = [
|
||||
"!zlwCuPiCNMSxDviFzA:4d2.org"
|
||||
];
|
||||
};
|
||||
command = "${niveumPackages.literature-quote}/bin/literature-quote";
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
matrix-token-lakai.file = ../../secrets/matrix-token-lakai.age;
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Literature quote bot";
|
||||
description = "sends me and my friends three <a href=\"https://logotheca.xn--kiern-0qa.de/\">logotheca</a> quotes a day.";
|
||||
}
|
||||
];
|
||||
}
|
||||
31
configs/bots/nietzsche.nix
Normal file
31
configs/bots/nietzsche.nix
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
niveumPackages,
|
||||
...
|
||||
}: {
|
||||
niveum.bots.nietzsche = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
mastodon = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.mastodon-token-nietzsche.path;
|
||||
language = "de";
|
||||
};
|
||||
command = toString (pkgs.writers.writeBash "random-nietzsche" ''
|
||||
set -efu
|
||||
random_number=$(( ($RANDOM % 10) + 1 ))
|
||||
if [ "$random_number" -eq 1 ]; then
|
||||
${niveumPackages.random-zeno}/bin/random-zeno "/Literatur/M/Nietzsche,+Friedrich"
|
||||
else
|
||||
${niveumPackages.random-zeno}/bin/random-zeno "/Philosophie/M/Nietzsche,+Friedrich"
|
||||
fi
|
||||
'');
|
||||
};
|
||||
|
||||
systemd.timers.bot-nietzsche.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
age.secrets = {
|
||||
mastodon-token-nietzsche.file = ../../secrets/mastodon-token-nietzsche.age;
|
||||
};
|
||||
}
|
||||
@@ -4,11 +4,19 @@
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
niveum.telegramBots.smyth = {
|
||||
niveum.bots.smyth = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@HerbertWeirSmyth"];
|
||||
mastodon = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.mastodon-token-smyth.path;
|
||||
language = "en";
|
||||
};
|
||||
telegram = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@HerbertWeirSmyth"];
|
||||
};
|
||||
command = toString (pkgs.writers.writeDash "random-smyth" ''
|
||||
set -efu
|
||||
|
||||
@@ -19,14 +27,21 @@
|
||||
| ${pkgs.gnused}/bin/sed 's/^ref="//;s/"$//'
|
||||
)
|
||||
|
||||
${pkgs.curl}/bin/curl -sSL http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION\
|
||||
url="http://www.perseus.tufts.edu/hopper/text?doc=$RANDOM_SECTION"
|
||||
${pkgs.curl}/bin/curl -sSL "$url"\
|
||||
| ${pkgs.htmlq}/bin/htmlq '#text_main' \
|
||||
| ${pkgs.gnused}/bin/sed 's/<\/\?hr>//g' \
|
||||
| ${pkgs.pandoc}/bin/pandoc -f html -t plain --wrap=none
|
||||
|
||||
printf '\n%s\n\n#AncientGreek' "$url"
|
||||
'');
|
||||
};
|
||||
|
||||
systemd.timers.telegram-bot-smyth.timerConfig.RandomizedDelaySec = "10h";
|
||||
systemd.timers.bot-smyth.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
age.secrets = {
|
||||
mastodon-token-smyth.file = ../../secrets/mastodon-token-smyth.age;
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
163
configs/bots/tlg-wotd.nix
Normal file
163
configs/bots/tlg-wotd.nix
Normal file
@@ -0,0 +1,163 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
niveumPackages,
|
||||
...
|
||||
}: let
|
||||
mastodonEndpoint = "https://social.krebsco.de";
|
||||
in {
|
||||
systemd.services.bot-tlg-wotd = {
|
||||
enable = true;
|
||||
wants = ["network-online.target"];
|
||||
startAt = "9:30";
|
||||
path = [ pkgs.jq pkgs.curl pkgs.recode pkgs.deno pkgs.imagemagick pkgs.gawk pkgs.gnugrep pkgs.coreutils ];
|
||||
environment = {
|
||||
NPM_CONFIG_CACHE = "/tmp";
|
||||
CLTK_DATA = "/tmp";
|
||||
};
|
||||
script = ''
|
||||
set -efux
|
||||
|
||||
chat_id=@tlgwotd
|
||||
|
||||
export TELEGRAM_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/telegram-token")"
|
||||
export MASTODON_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/mastodon-token")"
|
||||
|
||||
json_data=$(curl -sSL http://stephanus.tlg.uci.edu/Iris/Wotd | recode html..utf8)
|
||||
|
||||
word=$(echo "$json_data" | jq -r '.word')
|
||||
compact_word=$(echo "$word" | sed 's/,.*$//')
|
||||
definition=$(echo "$json_data" | jq -r '.definition | sub("<.*>"; "") | rtrimstr(" ")')
|
||||
first_occurrence=$(echo "$json_data" | jq -r '.firstOccurrence')
|
||||
total_occurrences=$(echo "$json_data" | jq -r '.totalOccurrences')
|
||||
telegram_caption="*$word* ‘$definition’
|
||||
|
||||
First occurrence (century): $first_occurrence
|
||||
Number of occurrences (in all Ancient Greek texts): $total_occurrences"
|
||||
mastodon_caption="$word ‘$definition’
|
||||
|
||||
First occurrence (century): $first_occurrence
|
||||
Number of occurrences (in all Ancient Greek texts): $total_occurrences"
|
||||
|
||||
#ancientgreek #classics #wotd #wordoftheday
|
||||
|
||||
transliteration=$(${pkgs.writers.makePythonWriter pkgs.python311 pkgs.python311Packages pkgs.python3Packages "translit.py" {
|
||||
# revert to pkgs.writers.writePython3 once https://github.com/NixOS/nixpkgs/pull/353367 is merged
|
||||
libraries = [ pkgs.python3Packages.cltk ];
|
||||
} ''
|
||||
import sys
|
||||
from cltk.phonology.grc.transcription import Transcriber
|
||||
|
||||
probert = Transcriber("Attic", "Probert")
|
||||
text = " ".join(sys.argv[1:])
|
||||
ipa = probert.transcribe(text)
|
||||
|
||||
print(ipa)
|
||||
''} "$compact_word")
|
||||
|
||||
|
||||
photo_path=/tmp/output.png
|
||||
|
||||
hex_to_rgb() {
|
||||
hex="$1"
|
||||
r=$(printf "%d" "0x$(echo "$hex" | cut -c2-3)")
|
||||
g=$(printf "%d" "0x$(echo "$hex" | cut -c4-5)")
|
||||
b=$(printf "%d" "0x$(echo "$hex" | cut -c6-7)")
|
||||
echo "$r $g $b"
|
||||
}
|
||||
|
||||
calculate_luminance() {
|
||||
r="$1"
|
||||
g="$2"
|
||||
b="$3"
|
||||
|
||||
r_l=$(echo "$r" | awk '{print ($1 / 255 <= 0.03928) ? $1 / 255 / 12.92 : (($1 / 255 + 0.055) / 1.055)^2.4}')
|
||||
g_l=$(echo "$g" | awk '{print ($1 / 255 <= 0.03928) ? $1 / 255 / 12.92 : (($1 / 255 + 0.055) / 1.055)^2.4}')
|
||||
b_l=$(echo "$b" | awk '{print ($1 / 255 <= 0.03928) ? $1 / 255 / 12.92 : (($1 / 255 + 0.055) / 1.055)^2.4}')
|
||||
|
||||
echo "$r_l $g_l $b_l" | awk '{print 0.2126*$1 + 0.7152*$2 + 0.0722*$3}'
|
||||
}
|
||||
|
||||
|
||||
hex_color="#$(echo "$compact_word" | md5sum | cut -c 1-6)"
|
||||
if echo "$hex_color" | grep -qE '^#[0-9A-Fa-f]{6}$'; then
|
||||
set -- $(hex_to_rgb "$hex_color")
|
||||
r="$1"
|
||||
g="$2"
|
||||
b="$3"
|
||||
fi
|
||||
|
||||
luminance=$(calculate_luminance "$r" "$g" "$b")
|
||||
|
||||
threshold="0.1"
|
||||
echo "$r $g $b"
|
||||
if [ "$(echo "$luminance" | awk -v threshold="$threshold" '{print ($1 > threshold)}')" -eq 1 ]; then
|
||||
color1="black"
|
||||
color2="#333"
|
||||
else
|
||||
color1="white"
|
||||
color2=lightgrey
|
||||
fi
|
||||
|
||||
magick -size 1400x846 \
|
||||
xc:"$hex_color" \
|
||||
-font "${pkgs.gentium}/share/fonts/truetype/GentiumBookPlus-Bold.ttf" \
|
||||
-fill "$color1" \
|
||||
-pointsize 150 -gravity west \
|
||||
-annotate +100-160 "$compact_word" \
|
||||
-font "${pkgs.gentium}/share/fonts/truetype/GentiumBookPlus-Regular.ttf" \
|
||||
-fill "$color2" \
|
||||
-pointsize 60 -gravity west \
|
||||
-annotate +100+00 "$transliteration" \
|
||||
-fill "$color1" \
|
||||
-annotate +100+120 "‘$definition’" \
|
||||
-fill "$color2" \
|
||||
-pointsize 40 -gravity southwest \
|
||||
-annotate +100+60 "attested $total_occurrences times" \
|
||||
-pointsize 40 -gravity southeast \
|
||||
-annotate +100+60 "$(date -I)" \
|
||||
"$photo_path"
|
||||
|
||||
curl -X POST "https://api.telegram.org/bot$TELEGRAM_TOKEN/sendPhoto" \
|
||||
-F "chat_id=\"$chat_id\"" \
|
||||
-F "photo=@$photo_path" \
|
||||
-F parse_mode=Markdown \
|
||||
-F caption="$telegram_caption"
|
||||
|
||||
mastodon_upload_response=$(curl -X POST "${mastodonEndpoint}/api/v2/media" \
|
||||
-H "Authorization: Bearer $MASTODON_TOKEN" \
|
||||
-F "file=@$photo_path" \
|
||||
-F "description=$word ‘$definition’")
|
||||
mastodon_image_id=$(echo $mastodon_upload_response | jq -r .id)
|
||||
curl -X POST "${mastodonEndpoint}/api/v1/statuses" \
|
||||
-H "Authorization: Bearer $MASTODON_TOKEN" \
|
||||
-d "status=$mastodon_caption" \
|
||||
-d "visibility=public" \
|
||||
-d "media_ids[]=$mastodon_image_id"
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
DynamicUser = true;
|
||||
StateDirectory = "tlgwotd";
|
||||
PrivateTmp = true;
|
||||
LoadCredential = [
|
||||
"telegram-token:${config.age.secrets.telegram-token-kmein.path}"
|
||||
"mastodon-token:${config.age.secrets.mastodon-token-tlgwotd.path}"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
|
||||
mastodon-token-tlgwotd.file = ../../secrets/mastodon-token-tlgwotd.age;
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Thesaurus Linguae Graecae Word of the Day";
|
||||
description = "sends <a href=\"https://stephanus.tlg.uci.edu/\">TLG</a>'s word of the day to Telegram.";
|
||||
link = "https://t.me/tlgwotd";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -41,18 +41,32 @@
|
||||
'
|
||||
'';
|
||||
in {
|
||||
niveum.telegramBots.transits = {
|
||||
niveum.bots.transits = {
|
||||
enable = true;
|
||||
time = "*:0/1";
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["-1001796440545"];
|
||||
mastodon = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.mastodon-token-transits.path;
|
||||
};
|
||||
telegram = {
|
||||
enable = true;
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["-1001796440545"];
|
||||
};
|
||||
command = toString (pkgs.writers.writeDash "common-transits" ''
|
||||
set -efu
|
||||
|
||||
now=$(${pkgs.coreutils}/bin/date +%_H:%M | ${pkgs.gnused}/bin/sed 's/^\s*//')
|
||||
date=$(${pkgs.coreutils}/bin/date +'%m %d %Y')
|
||||
{
|
||||
${pkgs.astrolog}/bin/astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node" -A 2
|
||||
${pkgs.astrolog}/bin/astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
|
||||
} | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n | ${pkgs.gnugrep}/bin/grep "^$now" || :
|
||||
(
|
||||
cd ${pkgs.astrolog}/bin
|
||||
# ./astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
|
||||
./astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node" -A 2
|
||||
) | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n | ${pkgs.gnugrep}/bin/grep "^$now" || :
|
||||
'');
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
mastodon-token-transits.file = ../../secrets/mastodon-token-transits.age;
|
||||
};
|
||||
}
|
||||
@@ -1,20 +1,14 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
pkgs,
|
||||
niveumPackages,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../lib) tmpfilesConfig;
|
||||
in {
|
||||
}: {
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "cro" ''
|
||||
${pkgs.chromium}/bin/chromium \
|
||||
--disable-sync \
|
||||
--no-default-browser-check \
|
||||
--no-first-run \
|
||||
--user-data-dir="$(mktemp -d)" \
|
||||
--incognito \
|
||||
"$@"
|
||||
'')
|
||||
niveumPackages.cro
|
||||
pkgs.tor-browser-bundle-bin
|
||||
pkgs.firefox
|
||||
pkgs.brave
|
||||
];
|
||||
|
||||
home-manager.users.me = {
|
||||
|
||||
@@ -6,6 +6,16 @@
|
||||
}: let
|
||||
inherit (import ../lib) tmpfilesConfig;
|
||||
in {
|
||||
systemd.user.services.systemd-tmpfiles-clean = {
|
||||
enable = true;
|
||||
wantedBy = [ "default.target" ];
|
||||
startAt = "daily";
|
||||
script = "systemd-tmpfiles --user --clean";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.tmpfiles.users.me.rules = map tmpfilesConfig [
|
||||
{
|
||||
type = "d";
|
||||
|
||||
@@ -3,25 +3,28 @@
|
||||
lib,
|
||||
config,
|
||||
niveumPackages,
|
||||
unstablePackages,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
inherit (lib.strings) makeBinPath;
|
||||
inherit (import ../lib) localAddresses kieran remoteDir;
|
||||
defaultApplications = (import ../lib).defaultApplications {inherit pkgs;};
|
||||
in {
|
||||
defaultApplications = (import ../lib).defaultApplications { inherit pkgs; };
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
inputs.self.nixosModules.system-dependent
|
||||
inputs.self.nixosModules.power-action
|
||||
{
|
||||
boot.supportedFilesystems = ["ntfs"];
|
||||
boot.supportedFilesystems = [ "ntfs" ];
|
||||
}
|
||||
{
|
||||
nixpkgs = {
|
||||
config = {
|
||||
allowUnfree = true;
|
||||
packageOverrides = pkgs: {
|
||||
dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
|
||||
dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.wofi}/bin/wofi -dmenu "$@"'';
|
||||
};
|
||||
permittedInsecurePackages = [
|
||||
"qtwebkit-5.212.0-alpha4"
|
||||
@@ -62,19 +65,6 @@ in {
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
environment.systemPackages = [
|
||||
pkgs.capitaine-cursors
|
||||
];
|
||||
|
||||
home-manager.users.me = {
|
||||
home.pointerCursor = {
|
||||
name = "capitaine-cursors-white";
|
||||
package = pkgs.capitaine-cursors;
|
||||
size = 12;
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
users.mutableUsers = false;
|
||||
|
||||
@@ -86,9 +76,14 @@ in {
|
||||
hashedPasswordFile = config.age.secrets.kfm-password.path;
|
||||
isNormalUser = true;
|
||||
uid = 1000;
|
||||
extraGroups = ["pipewire" "audio"];
|
||||
extraGroups = [
|
||||
"pipewire"
|
||||
"audio"
|
||||
];
|
||||
};
|
||||
|
||||
nix.settings.trusted-users = [ config.users.users.me.name ];
|
||||
|
||||
age.secrets = {
|
||||
kfm-password.file = ../secrets/kfm-password.age;
|
||||
};
|
||||
@@ -97,75 +92,73 @@ in {
|
||||
}
|
||||
{
|
||||
environment.interactiveShellInit = "export PATH=$PATH";
|
||||
environment.shellAliases = let
|
||||
swallow = command: "${niveumPackages.swallow}/bin/swallow ${command}";
|
||||
in {
|
||||
o = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
ns = "nix-shell --run zsh";
|
||||
pbcopy = "${pkgs.xclip}/bin/xclip -selection clipboard -in";
|
||||
pbpaste = "${pkgs.xclip}/bin/xclip -selection clipboard -out";
|
||||
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||
sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
|
||||
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
||||
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
|
||||
yt = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -ic"; # Download video link
|
||||
yta = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -xic"; # Download with audio
|
||||
};
|
||||
environment.shellAliases =
|
||||
let
|
||||
swallow = command: "${niveumPackages.swallow}/bin/swallow ${command}";
|
||||
in
|
||||
{
|
||||
o = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
ns = "nix-shell --run zsh";
|
||||
pbcopy = "${pkgs.wl-clipboard}/bin/wl-copy";
|
||||
pbpaste = "${pkgs.wl-clipboard}/bin/wl-paste";
|
||||
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||
sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
|
||||
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
||||
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
|
||||
yt = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -ic"; # Download video link
|
||||
yta = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata --audio-format opus --audio-quality 0 -xic"; # Download with audio
|
||||
};
|
||||
}
|
||||
{
|
||||
i18n = {
|
||||
defaultLocale = "en_DK.UTF-8";
|
||||
supportedLocales = ["all"];
|
||||
supportedLocales = [ "all" ];
|
||||
};
|
||||
}
|
||||
{
|
||||
services.displayManager = {
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = config.users.users.me.name;
|
||||
};
|
||||
};
|
||||
services.xserver = {
|
||||
enable = true;
|
||||
displayManager = {
|
||||
autoLogin = {
|
||||
enable = true;
|
||||
user = config.users.users.me.name;
|
||||
};
|
||||
lightdm = {
|
||||
enable = true;
|
||||
greeters.gtk = {
|
||||
enable = true;
|
||||
indicators = ["~spacer" "~host" "~spacer" "~session" "~power"];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
{
|
||||
security.wrappers = {
|
||||
pmount = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.pmount}/bin/pmount";
|
||||
};
|
||||
pumount = {
|
||||
setuid = true;
|
||||
owner = "root";
|
||||
group = "root";
|
||||
source = "${pkgs.pmount}/bin/pumount";
|
||||
};
|
||||
};
|
||||
}
|
||||
{programs.command-not-found.enable = true;}
|
||||
{
|
||||
home-manager.users.me = {
|
||||
services.gpg-agent = rec {
|
||||
displayManager.lightdm = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
defaultCacheTtl = 2 * 60 * 60;
|
||||
maxCacheTtl = 4 * defaultCacheTtl;
|
||||
greeters.gtk = {
|
||||
enable = true;
|
||||
indicators = [
|
||||
"~spacer"
|
||||
"~host"
|
||||
"~spacer"
|
||||
"~session"
|
||||
"~power"
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
{ programs.command-not-found.enable = true; }
|
||||
{
|
||||
programs.gnupg = {
|
||||
agent = {
|
||||
enable = true;
|
||||
pinentryPackage = pkgs.pinentry-qt;
|
||||
settings = rec {
|
||||
default-cache-ttl = 2 * 60 * 60;
|
||||
max-cache-ttl = 4 * default-cache-ttl;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.gnupg
|
||||
(pkgs.pass.withExtensions (e: [e.pass-otp e.pass-import e.pass-genphrase]))
|
||||
(pkgs.pass.withExtensions (e: [
|
||||
e.pass-otp
|
||||
e.pass-import
|
||||
e.pass-genphrase
|
||||
]))
|
||||
];
|
||||
}
|
||||
{
|
||||
@@ -178,21 +171,20 @@ in {
|
||||
};
|
||||
}
|
||||
{
|
||||
networking.hosts =
|
||||
lib.mapAttrs' (name: address: {
|
||||
name = address;
|
||||
value = ["${name}.local"];
|
||||
})
|
||||
localAddresses;
|
||||
networking.hosts = lib.mapAttrs' (name: address: {
|
||||
name = address;
|
||||
value = [ "${name}.local" ];
|
||||
}) localAddresses;
|
||||
}
|
||||
{
|
||||
home-manager.users.me.home.stateVersion = "22.05";
|
||||
home-manager.backupFileExtension = "bak";
|
||||
}
|
||||
{
|
||||
systemd.user.services.udiskie = {
|
||||
after = ["udisks2.service"];
|
||||
wants = ["udisks2.service"];
|
||||
wantedBy = ["graphical-session.target"];
|
||||
after = [ "udisks2.service" ];
|
||||
wants = [ "udisks2.service" ];
|
||||
wantedBy = [ "graphical-session.target" ];
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.udiskie}/bin/udiskie --verbose --no-config --notify";
|
||||
};
|
||||
@@ -229,14 +221,15 @@ in {
|
||||
./git.nix
|
||||
./hledger.nix
|
||||
./htop.nix
|
||||
./hu-berlin.nix
|
||||
./fu-berlin.nix
|
||||
./fysi.nix
|
||||
./i3.nix
|
||||
./niri.nix
|
||||
./i3status-rust.nix
|
||||
./keyboard.nix
|
||||
./mycelium.nix
|
||||
./kdeconnect.nix
|
||||
{home-manager.users.me.home.file.".XCompose".source = ../lib/keyboards/XCompose;}
|
||||
{ home-manager.users.me.home.file.".XCompose".source = ../lib/keyboards/XCompose; }
|
||||
{ services.upower.enable = true; }
|
||||
./lb.nix
|
||||
./mpv.nix
|
||||
./mime.nix
|
||||
@@ -244,6 +237,7 @@ in {
|
||||
./nix.nix
|
||||
./newsboat.nix
|
||||
./flameshot.nix
|
||||
./fritzbox.nix
|
||||
./packages.nix
|
||||
./picom.nix
|
||||
./stardict.nix
|
||||
@@ -263,6 +257,11 @@ in {
|
||||
./watson.nix
|
||||
./wallpaper.nix
|
||||
./zsh.nix
|
||||
{
|
||||
home-manager.users.me.home.file.".zshrc".text = ''
|
||||
# nothing to see here
|
||||
'';
|
||||
}
|
||||
./tor.nix
|
||||
./stw-berlin.nix
|
||||
./mastodon-bot.nix
|
||||
@@ -294,7 +293,7 @@ in {
|
||||
download = "${config.users.users.me.home}/sync/Downloads";
|
||||
music = "${config.users.users.me.home}/mobile/audio";
|
||||
pictures = "${config.users.users.me.home}/cloud/nextcloud/Bilder";
|
||||
publicShare = "${config.users.users.me.home}/cloud/nextcloud/tmp";
|
||||
publicShare = "${config.users.users.me.home}/cloud/nextcloud/tmp";
|
||||
videos = pictures;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
}: {
|
||||
home-manager.users.me = {
|
||||
services.flameshot = {
|
||||
package = pkgs.flameshot.override { enableWlrSupport = true; };
|
||||
enable = true;
|
||||
settings.General = {
|
||||
autoCloseIdleDaemon = true;
|
||||
drawColor = "#ff0000";
|
||||
drawThickness = 2;
|
||||
checkForUpdates = false;
|
||||
showDesktopNotification = true;
|
||||
disabledTrayIcon = true;
|
||||
showHelp = false;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
niveumPackages,
|
||||
...
|
||||
}: let
|
||||
@@ -22,7 +23,7 @@
|
||||
|
||||
egyptianHiero = zip-font "EgyptianHiero" {
|
||||
url = "https://github.com/MKilani/Djehuty/archive/master.zip";
|
||||
sha256 = "sha256-KbY4vedm757NWfDlgmNhslbZd+2Vs+o5PjtMMGDt61Y=";
|
||||
sha256 = "sha256-S3vZxdeBj57KJsF+zaZw7sQw8T+z1aVC2CnpnZ0/x2c=";
|
||||
};
|
||||
antinoou = zip-font "Antinoou" {
|
||||
url = "https://www.evertype.com/fonts/coptic/AntinoouFont.zip";
|
||||
@@ -34,10 +35,6 @@
|
||||
hash = "sha256-nP0y4ILt+0mlkDRdCNSeO2Gequ8wyix/qQdmujTNw3Y=";
|
||||
stripRoot = false;
|
||||
};
|
||||
junicode2 = zip-font "JunicodeTwo" {
|
||||
url = "https://github.com/psb1558/Junicode-font/archive/48bf476db278c844c67542b04d1e0e4c71f139d2.zip";
|
||||
sha256 = "1ryicc155vkvgv3315ddliigwa01afwyb4c4f6pnqcns03af001i";
|
||||
};
|
||||
newAthenaUnicode = zip-font "NewAthenaUnicode" {
|
||||
url = "https://classicalstudies.org/sites/default/files/userfiles/files/NAU5_005.zip";
|
||||
sha256 = "1g7qk9gl4nq2dz41bvck1nzilhin44j8691cxax3dlp77bbn9bxr";
|
||||
@@ -89,8 +86,9 @@ in {
|
||||
font-awesome_6
|
||||
etBook
|
||||
newGardiner
|
||||
junicode2
|
||||
junicode
|
||||
koineGreek
|
||||
# brill
|
||||
ezra-sil
|
||||
fira
|
||||
font-awesome
|
||||
@@ -108,8 +106,9 @@ in {
|
||||
roboto
|
||||
roboto-mono
|
||||
noto-fonts
|
||||
noto-fonts-cjk
|
||||
noto-fonts-cjk-sans
|
||||
noto-fonts-emoji
|
||||
nerd-fonts.blex-mono
|
||||
roboto-slab
|
||||
scheherazade-new
|
||||
source-code-pro
|
||||
@@ -122,10 +121,10 @@ in {
|
||||
zilla-slab
|
||||
]; # google-fonts league-of-moveable-type
|
||||
fontconfig.defaultFonts = rec {
|
||||
monospace = ["Noto Sans Mono"] ++ emoji;
|
||||
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
|
||||
sansSerif = ["Noto Sans Display" "Noto Naskh Arabic" "Noto Sans Hebrew" "Noto Sans Devanagari" "Noto Sans CJK JP" "Noto Sans Coptic"];
|
||||
emoji = ["Noto Color Emoji"];
|
||||
monospace = [config.stylix.fonts.monospace.name] ++ emoji;
|
||||
serif = [config.stylix.fonts.serif.name "Scheherazade New" "Ezra SIL" "Antinoou" "Noto Serif Devanagari"];
|
||||
sansSerif = [config.stylix.fonts.sansSerif.name "Noto Sans Display" "Noto Naskh Arabic" "Noto Sans Hebrew" "Noto Sans Devanagari" "Noto Sans CJK JP" "Noto Sans Coptic" "Noto Sans Syriac Western"];
|
||||
emoji = [config.stylix.fonts.emoji.name];
|
||||
};
|
||||
# xelatex fails with woff files
|
||||
# ref https://tex.stackexchange.com/questions/392144/xelatex-and-fontspec-crash-trying-to-find-woff-file-for-some-fonts-but-not-other
|
||||
|
||||
19
configs/fritzbox.nix
Normal file
19
configs/fritzbox.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ config, ... }:
|
||||
{
|
||||
networking.firewall.allowedUDPPorts = [ 51820 ];
|
||||
networking.wg-quick.interfaces.aether = {
|
||||
autostart = false;
|
||||
dns = ["192.168.178.1" "fritz.box"];
|
||||
listenPort = 51820;
|
||||
privateKeyFile = config.age.secrets.wireguard-aether-key.path;
|
||||
peers = [
|
||||
{
|
||||
allowedIPs = ["192.168.178.0/24" "0.0.0.0/0"];
|
||||
endpoint = "lng5gx2rmssv8ge1.myfritz.net:58997";
|
||||
persistentKeepalive = 25;
|
||||
presharedKeyFile = config.age.secrets.wireguard-aether-psk.path;
|
||||
publicKey = "8Rr7BueC0CGmycBQFS7YM7VF7Adkdc1ZcLFy8YXyOQk=";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
@@ -55,8 +55,7 @@ in {
|
||||
};
|
||||
himalaya = {
|
||||
enable = true;
|
||||
backend = "imap";
|
||||
sender = "smtp";
|
||||
settings.backend = "imap";
|
||||
};
|
||||
});
|
||||
};
|
||||
@@ -128,8 +127,20 @@ in {
|
||||
cifs-credentials-zodiac.file = ../secrets/cifs-credentials-zodiac.age;
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "fu-vpn" ''
|
||||
if ${pkgs.wirelesstools}/bin/iwgetid | ${pkgs.gnugrep}/bin/grep --invert-match eduroam
|
||||
then
|
||||
# root firefox will not open login window unless root owns Xauthority
|
||||
sudo cp $XAUTHORITY /root/.Xauthority
|
||||
sudo chown root: /root/.Xauthority
|
||||
XAUTHORITY=/root/.Xauthority sudo ${pkgs.openconnect}/bin/openconnect vpn.fu-berlin.de --useragent=AnyConnect
|
||||
fi
|
||||
'')
|
||||
];
|
||||
|
||||
systemd.services.fu-vpn = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
wants = ["network-online.target"];
|
||||
serviceConfig.LoadCredential = "password:${config.age.secrets.email-password-meinhak99.path}";
|
||||
script = ''
|
||||
|
||||
@@ -1,150 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../lib/email.nix) defaults pronouns;
|
||||
inherit (import ../lib) remoteDir;
|
||||
hu-defaults = {
|
||||
imap.host = "mailbox.cms.hu-berlin.de";
|
||||
imap.port = 993;
|
||||
smtp.host = "mailhost.cms.hu-berlin.de";
|
||||
smtp.port = 25;
|
||||
smtp.tls.useStartTls = true;
|
||||
};
|
||||
hu-berlin-cifs-options = [
|
||||
"uid=${toString config.users.users.me.uid}"
|
||||
"gid=${toString config.users.groups.users.gid}"
|
||||
"sec=ntlmv2"
|
||||
"workgroup=german"
|
||||
"credentials=${config.age.secrets.cifs-credentials-hu-berlin.path}"
|
||||
"noauto"
|
||||
"x-systemd.automount"
|
||||
"x-systemd.device-timeout=1"
|
||||
"x-systemd.idle-timeout=1min"
|
||||
];
|
||||
in {
|
||||
fileSystems."${remoteDir}/hu/germpro2" = {
|
||||
device = "//hugerm31c.user.hu-berlin.de/germpro2/ling";
|
||||
fsType = "cifs";
|
||||
options = hu-berlin-cifs-options;
|
||||
};
|
||||
|
||||
fileSystems."${remoteDir}/hu/meinhaki/home" = {
|
||||
device = "//hugerm31c.user.hu-berlin.de/germhome/ling/meinhaki";
|
||||
fsType = "cifs";
|
||||
options = hu-berlin-cifs-options;
|
||||
};
|
||||
|
||||
age.secrets = {
|
||||
cifs-credentials-hu-berlin.file = ../secrets/cifs-credentials-hu-berlin.age;
|
||||
email-password-meinhaki = {
|
||||
file = ../secrets/email-password-meinhaki.age;
|
||||
owner = config.users.users.me.name;
|
||||
group = config.users.users.me.group;
|
||||
mode = "400";
|
||||
};
|
||||
email-password-dslalewa = {
|
||||
file = ../secrets/email-password-dslalewa.age;
|
||||
owner = config.users.users.me.name;
|
||||
group = config.users.users.me.group;
|
||||
mode = "400";
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.me = {
|
||||
programs.ssh = {
|
||||
matchBlocks = {
|
||||
"alew.hu-berlin.de" = {
|
||||
user = "centos";
|
||||
hostname = "141.20.187.219";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
accounts.email.accounts = rec {
|
||||
hu-employee =
|
||||
lib.recursiveUpdate defaults
|
||||
(lib.recursiveUpdate hu-defaults
|
||||
rec {
|
||||
userName = "meinhaki";
|
||||
address = "kieran.meinhardt@hu-berlin.de";
|
||||
aliases = ["${userName}@hu-berlin.de"];
|
||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhaki.path}";
|
||||
aerc.extraAccounts.signature-file = toString (pkgs.writeText "signature" signature.text);
|
||||
himalaya = {
|
||||
enable = true;
|
||||
backend = "imap";
|
||||
sender = "smtp";
|
||||
};
|
||||
signature = {
|
||||
showSignature = "append";
|
||||
text = ''
|
||||
${defaults.realName}
|
||||
${pronouns}
|
||||
Studentische Hilfskraft / Administrator ALEW
|
||||
Humboldt-Universität zu Berlin
|
||||
|
||||
Telefon: +49 (0)30 2093 9634
|
||||
Raum 3.212, Dorotheenstraße 24, 10117 Berlin-Mitte
|
||||
https://alew.hu-berlin.de
|
||||
'';
|
||||
};
|
||||
});
|
||||
hu-admin =
|
||||
lib.recursiveUpdate defaults
|
||||
(lib.recursiveUpdate hu-defaults
|
||||
rec {
|
||||
userName = "dslalewa";
|
||||
address = "admin.alew.vglsprwi@hu-berlin.de";
|
||||
himalaya = {
|
||||
enable = true;
|
||||
backend = "imap";
|
||||
sender = "smtp";
|
||||
};
|
||||
aliases = ["${userName}@hu-berlin.de"];
|
||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-dslalewa.path}";
|
||||
inherit (hu-employee) signature;
|
||||
aerc.extraAccounts.signature-file = toString (pkgs.writeText "signature" signature.text);
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "hu-ip" ''
|
||||
${pkgs.w3m}/bin/w3m -dump meineip.hu-berlin.de | head --lines=-4 | tail --lines=+3
|
||||
'')
|
||||
(
|
||||
pkgs.writers.writePython3Bin "hu-eduroam-install"
|
||||
{
|
||||
libraries = with pkgs.python3Packages; [distro pyopenssl dbus-python];
|
||||
flakeIgnore = ["E501" "E123" "W504" "E722" "F821" "E226" "E126" "E265" "W291"];
|
||||
}
|
||||
(builtins.readFile (builtins.fetchurl {
|
||||
url = "https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/linux-installer/eduroam-linux-hub.py";
|
||||
sha256 = "19x2kvwxx13265b2hj5fjf53g0liw6dw7xf9j9cav67cswmz60kf";
|
||||
}))
|
||||
)
|
||||
];
|
||||
|
||||
# ref https://github.com/NixOS/nixpkgs/issues/231038#issuecomment-1591888919
|
||||
environment.etc."ppp/options".text = "ipcp-accept-remote";
|
||||
|
||||
systemd.services.hu-vpn = {
|
||||
enable = true;
|
||||
wants = ["network-online.target"];
|
||||
serviceConfig.LoadCredential = "password:${config.age.secrets.email-password-meinhaki.path}";
|
||||
script = ''
|
||||
${pkgs.openfortivpn}/bin/openfortivpn \
|
||||
--password="$(cat "$CREDENTIALS_DIRECTORY/password")" \
|
||||
--config=${
|
||||
pkgs.writeText "hu-berlin.config" ''
|
||||
host = forti-ssl.vpn.hu-berlin.de
|
||||
port = 443
|
||||
username = meinhaki
|
||||
''
|
||||
}
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -6,37 +6,36 @@
|
||||
...
|
||||
}: let
|
||||
dashboard = pkgs.writers.writeDashBin "dashboard" ''
|
||||
${pkgs.alacritty}/bin/alacritty --class wtf --command ${pkgs.writers.writeDash "dashboard-inner" ''
|
||||
export WTF_OWM_API_KEY="$(cat ${config.age.secrets.openweathermap-api-key.path})"
|
||||
export WTF_MINIFLUX_API_KEY="$(cat ${config.age.secrets.miniflux-api-token.path})"
|
||||
exec ${niveumPackages.dashboard}/bin/dashboard
|
||||
${pkgs.alacritty}/bin/alacritty --option font.size=4 --class dashboard --command ${pkgs.writers.writeDash "dashboard-inner" ''
|
||||
exec ${pkgs.procps}/bin/watch -c -n 10 ${niveumPackages.q}/bin/q
|
||||
''}
|
||||
'';
|
||||
inherit (import ../lib) defaultApplications;
|
||||
klem = niveumPackages.klem.override {
|
||||
config.dmenu = "${pkgs.dmenu}/bin/dmenu -i -p klem";
|
||||
config.scripts = {
|
||||
"p.r" = pkgs.writers.writeDash "p.r" ''
|
||||
"p.r paste" = pkgs.writers.writeDash "p.r" ''
|
||||
${pkgs.curl}/bin/curl -fSs http://p.r --data-binary @- \
|
||||
| ${pkgs.coreutils}/bin/tail --lines=1 \
|
||||
| ${pkgs.gnused}/bin/sed 's/\\<r\\>/krebsco.de/'
|
||||
'';
|
||||
# "envs.sh host" = pkgs.writers.writeDash "envs-host" ''
|
||||
# ${pkgs.curl}/bin/curl -F "file=$(${pkgs.coreutils}/bin/cat)" https://envs.sh
|
||||
# '';
|
||||
"envs.sh mirror" = pkgs.writers.writeDash "envs-mirror" ''
|
||||
${pkgs.curl}/bin/curl -F "url=$(${pkgs.coreutils}/bin/cat)" https://envs.sh
|
||||
"envs.sh paste" = pkgs.writers.writeDash "envs-host" ''
|
||||
${pkgs.curl}/bin/curl -F "file=@-" https://envs.sh
|
||||
'';
|
||||
# this segfaults
|
||||
# "envs.sh mirror" = pkgs.writers.writeDash "envs-mirror" ''
|
||||
# ${pkgs.curl}/bin/curl -F "url=$(${pkgs.coreutils}/bin/cat)" https://envs.sh
|
||||
# '';
|
||||
"envs.sh shorten" = pkgs.writers.writeDash "envs-shorten" ''
|
||||
${pkgs.curl}/bin/curl -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://envs.sh
|
||||
'';
|
||||
"ix.io" = pkgs.writers.writeDash "ix.io" ''
|
||||
${pkgs.curl}/bin/curl -fSs -F 'f:1=<-' ix.io
|
||||
'';
|
||||
"go.r" = pkgs.writers.writeDash "go.r" ''
|
||||
"go.r shorten" = pkgs.writers.writeDash "go.r" ''
|
||||
${pkgs.curl}/bin/curl -fSs http://go.r -F "uri=$(${pkgs.coreutils}/bin/cat)"
|
||||
'';
|
||||
"0x0.st" = pkgs.writers.writeDash "0x0.st" ''
|
||||
"4d2.org paste" = pkgs.writers.writeDash "4d2-paste" ''
|
||||
${pkgs.curl}/bin/curl -F "file=@-" https://depot.4d2.org/
|
||||
'';
|
||||
"0x0.st shorten" = pkgs.writers.writeDash "0x0.st" ''
|
||||
${pkgs.curl}/bin/curl -fSs https://0x0.st -F "shorten=$(${pkgs.coreutils}/bin/cat)"
|
||||
'';
|
||||
"rot13" = pkgs.writers.writeDash "rot13" ''
|
||||
@@ -91,8 +90,8 @@ in {
|
||||
|
||||
environment.systemPackages = [dashboard];
|
||||
|
||||
services.displayManager.defaultSession = "none+i3";
|
||||
services.xserver = {
|
||||
displayManager.defaultSession = "none+i3";
|
||||
windowManager.i3 = {
|
||||
enable = true;
|
||||
package = pkgs.i3-gaps;
|
||||
@@ -234,6 +233,7 @@ in {
|
||||
"${modifier}+p" = "exec rofi-pass";
|
||||
"${modifier}+Shift+p" = "exec rofi-pass --insert";
|
||||
"${modifier}+u" = "exec ${niveumPackages.unicodmenu}/bin/unicodmenu";
|
||||
"${modifier}+Shift+u" = "exec ${pkgs.writers.writeDash "last-unicode" ''${pkgs.xdotool}/bin/xdotool type --delay 1000 "$(${pkgs.gawk}/bin/awk 'END{print $1}' ~/.cache/unicodmenu)"''}";
|
||||
|
||||
"${modifier}+F7" = "exec ${pkgs.writers.writeDash "showkeys-toggle" ''
|
||||
if ${pkgs.procps}/bin/pgrep screenkey; then
|
||||
@@ -308,7 +308,7 @@ in {
|
||||
exec "${pkgs.writers.writeDash "irc" "exec ${pkgs.alacritty}/bin/alacritty --class message -e ssh weechat@makanek -t tmux attach-session -t IM"}"
|
||||
exec "${pkgs.writers.writeDash "email" "exec ${pkgs.alacritty}/bin/alacritty --class message -e aerc"}"
|
||||
|
||||
assign [class="wtf"] ${infoWorkspace}
|
||||
assign [class="dashboard"] ${infoWorkspace}
|
||||
exec ${dashboard}/bin/dashboard
|
||||
'';
|
||||
config = lib.mkMerge [
|
||||
|
||||
@@ -55,7 +55,9 @@
|
||||
}
|
||||
{
|
||||
block = "battery";
|
||||
device = config.niveum.batteryName;
|
||||
format = "$icon $percentage $time";
|
||||
device = "DisplayDevice";
|
||||
driver = "upower";
|
||||
}
|
||||
{
|
||||
block = "sound";
|
||||
|
||||
@@ -3,53 +3,57 @@
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
|
||||
commaSep = builtins.concatStringsSep ",";
|
||||
xkbOptions = ["compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle"];
|
||||
languages = {
|
||||
de = "T3";
|
||||
gr = "polytonic";
|
||||
ru = "phonetic";
|
||||
arabic = "";
|
||||
coptic = "";
|
||||
avestan = "";
|
||||
gothic = "";
|
||||
"in" = "san-kagapa";
|
||||
il = "phonetic";
|
||||
arabic = { code = "ara"; variant = "buckwalter"; }; # ../lib/keyboards/arabic;
|
||||
avestan = ../lib/keyboards/avestan;
|
||||
coptic = ../lib/keyboards/coptic;
|
||||
deutsch = { code = "de"; variant = "T3"; };
|
||||
farsi = { code = "ir"; variant = "qwerty"; };
|
||||
gothic = ../lib/keyboards/gothic;
|
||||
greek = { code = "gr"; variant = "polytonic"; };
|
||||
gujarati = {code = "in"; variant = "guj-kagapa"; };
|
||||
hebrew = {code = "il"; variant = "phonetic";};
|
||||
russian = { code = "ru"; variant = "phonetic"; };
|
||||
sanskrit = { code = "in"; variant = "san-kagapa"; };
|
||||
syriac = { code = "sy"; variant = "syc_phonetic"; };
|
||||
urdu = {code = "in"; variant = "urd-phonetic"; };
|
||||
};
|
||||
defaultLanguage = "de";
|
||||
defaultLanguage = languages.deutsch;
|
||||
in {
|
||||
services.libinput.enable = true;
|
||||
|
||||
# man 7 xkeyboard-config
|
||||
services.xserver = {
|
||||
exportConfiguration = true; # link /usr/share/X11 properly
|
||||
layout = "de";
|
||||
# exportConfiguration = true; # link /usr/share/X11 properly
|
||||
xkb.layout = defaultLanguage.code;
|
||||
# T3: https://upload.wikimedia.org/wikipedia/commons/a/a9/German-Keyboard-Layout-T3-Version1-large.png
|
||||
# buckwalter: http://www.qamus.org/transliteration.htm
|
||||
xkbVariant = "T3";
|
||||
xkbOptions = commaSep xkbOptions;
|
||||
libinput.enable = true;
|
||||
xkbDir = pkgs.symlinkJoin {
|
||||
name = "x-keyboard-directory";
|
||||
paths = [
|
||||
"${pkgs.xkeyboard_config}/etc/X11/xkb"
|
||||
(pkgs.linkFarm "custom-x-keyboards" [
|
||||
{
|
||||
name = "symbols/arabic";
|
||||
path = ../lib/keyboards/arabic;
|
||||
}
|
||||
{
|
||||
name = "symbols/coptic";
|
||||
path = ../lib/keyboards/coptic;
|
||||
}
|
||||
{
|
||||
name = "symbols/gothic";
|
||||
path = ../lib/keyboards/gothic;
|
||||
}
|
||||
{
|
||||
name = "symbols/avestan";
|
||||
path = ../lib/keyboards/avestan;
|
||||
}
|
||||
])
|
||||
];
|
||||
xkb.variant = defaultLanguage.variant;
|
||||
xkb.options = commaSep xkbOptions;
|
||||
xkb.extraLayouts = {
|
||||
"coptic" = {
|
||||
languages = ["cop"];
|
||||
description = "Coptic";
|
||||
symbolsFile = ../lib/keyboards/coptic;
|
||||
};
|
||||
"gothic" = {
|
||||
languages = ["got"];
|
||||
description = "Gothic";
|
||||
symbolsFile = ../lib/keyboards/gothic;
|
||||
};
|
||||
"avestan" = {
|
||||
languages = ["ave"];
|
||||
description = "Avestan";
|
||||
symbolsFile = ../lib/keyboards/avestan;
|
||||
};
|
||||
"farsi-good" = {
|
||||
languages = ["fas"];
|
||||
description = "Farsi, but good";
|
||||
symbolsFile = ../lib/keyboards/farsi;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -59,11 +63,24 @@ in {
|
||||
|
||||
environment.systemPackages =
|
||||
lib.mapAttrsToList
|
||||
(language: variant:
|
||||
(language: settings:
|
||||
let
|
||||
code = if settings ? "code" then settings.code else language;
|
||||
variant = if settings ? "variant" then settings.variant else "";
|
||||
in
|
||||
pkgs.writers.writeDashBin "kb-${language}" ''
|
||||
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage},${language} ${languages.${defaultLanguage}},${variant} ${toString (map (option: "-option ${option}") xkbOptions)}
|
||||
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage.code},${code} ${defaultLanguage.variant},${variant} ${toString (map (option: "-option ${option}") xkbOptions)}
|
||||
'')
|
||||
languages;
|
||||
languages ++
|
||||
lib.mapAttrsToList
|
||||
(language: settings:
|
||||
let
|
||||
code = if settings ? "code" then settings.code else language;
|
||||
variant = if settings ? "variant" then settings.variant else "";
|
||||
in
|
||||
pkgs.writers.writeDashBin "kb-niri-${language}" ''
|
||||
${pkgs.gnused}/bin/sed -i 's/^\(\s*layout\) ".*"$/\1 "${defaultLanguage.code},${code}"/;s/^\(\s*variant\) ".*"$/\1 "${defaultLanguage.variant},${variant}"/' ~/.config/niri/config.kdl
|
||||
'') languages;
|
||||
|
||||
# improve held key rate
|
||||
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
|
||||
|
||||
@@ -36,7 +36,7 @@ in {
|
||||
"Alt+j" = "add video-pan-y -0.05";
|
||||
};
|
||||
scripts = [
|
||||
pkgs.mpvScripts.quality-menu
|
||||
# pkgs.mpvScripts.quality-menu
|
||||
niveumPackages.mpv-visualizer
|
||||
];
|
||||
};
|
||||
|
||||
15
configs/mycelium.nix
Normal file
15
configs/mycelium.nix
Normal file
@@ -0,0 +1,15 @@
|
||||
{ lib, ... }:
|
||||
let
|
||||
myceliumAddresses = import ../lib/mycelium-network.nix;
|
||||
in
|
||||
{
|
||||
services.mycelium = {
|
||||
enable = true;
|
||||
openFirewall = true;
|
||||
};
|
||||
|
||||
networking.hosts = lib.mapAttrs' (name: address: {
|
||||
name = address;
|
||||
value = [ "${name}.m" ];
|
||||
}) myceliumAddresses;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
niveumPackages,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
environment.variables.EDITOR = pkgs.lib.mkForce "nvim";
|
||||
@@ -35,6 +36,23 @@
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
|
||||
niveumPackages.vim
|
||||
(niveumPackages.vim.override {
|
||||
stylixColors = config.lib.stylix.colors;
|
||||
# colorscheme = "base16-gruvbox-light-medium";
|
||||
})
|
||||
|
||||
# language servers
|
||||
pkgs.pyright
|
||||
pkgs.haskellPackages.haskell-language-server
|
||||
pkgs.texlab
|
||||
pkgs.nil
|
||||
pkgs.nixfmt-rfc-style
|
||||
pkgs.rust-analyzer
|
||||
pkgs.nodePackages.typescript-language-server
|
||||
pkgs.lua-language-server
|
||||
pkgs.nodePackages.vscode-langservers-extracted
|
||||
pkgs.lemminx
|
||||
niveumPackages.jq-lsp
|
||||
pkgs.dhall-lsp-server
|
||||
];
|
||||
}
|
||||
|
||||
46
configs/neovim.sync-conflict-20250130-092404-AJVBWR2.nix
Normal file
46
configs/neovim.sync-conflict-20250130-092404-AJVBWR2.nix
Normal file
@@ -0,0 +1,46 @@
|
||||
{ pkgs, niveumPackages, config, ... }: {
|
||||
environment.variables.EDITOR = pkgs.lib.mkForce "nvim";
|
||||
environment.shellAliases.vi = "nvim";
|
||||
environment.shellAliases.vim = "nvim";
|
||||
environment.shellAliases.view = "nvim -R";
|
||||
|
||||
home-manager.users.me = {
|
||||
editorconfig = {
|
||||
enable = true;
|
||||
settings = {
|
||||
"*" = {
|
||||
charset = "utf-8";
|
||||
end_of_line = "lf";
|
||||
trim_trailing_whitespace = true;
|
||||
insert_final_newline = true;
|
||||
indent_style = "space";
|
||||
indent_size = 2;
|
||||
};
|
||||
"*.py" = { indent_size = 4; };
|
||||
Makefile = { indent_style = "tab"; };
|
||||
"*.md" = { trim_trailing_whitespace = false; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
|
||||
(niveumPackages.vim.override {
|
||||
stylixColors = config.lib.stylix.colors;
|
||||
# colorscheme = "base16-gruvbox-dark-medium";
|
||||
})
|
||||
|
||||
# language servers
|
||||
pkgs.pyright
|
||||
pkgs.haskellPackages.haskell-language-server
|
||||
pkgs.texlab
|
||||
pkgs.nil
|
||||
pkgs.rust-analyzer
|
||||
pkgs.nodePackages.typescript-language-server
|
||||
pkgs.lua-language-server
|
||||
pkgs.nodePackages.vscode-langservers-extracted
|
||||
pkgs.lemminx
|
||||
niveumPackages.jq-lsp
|
||||
pkgs.dhall-lsp-server
|
||||
];
|
||||
}
|
||||
@@ -1,47 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
profile = name: custom:
|
||||
lib.recursiveUpdate {
|
||||
connection.id = name;
|
||||
connection.type = "wifi";
|
||||
connection.interface-name = "wlp3s0";
|
||||
connection.permissions = "";
|
||||
wifi.mac-address-blacklist = "";
|
||||
wifi.ssid = name;
|
||||
wifi.mode = "infrastructure";
|
||||
ipv4.dns-search = "";
|
||||
ipv4.method = "auto";
|
||||
ipv6.addr-gen-mode = "stable-privacy";
|
||||
ipv6.dns-search = "";
|
||||
ipv6.method = "auto";
|
||||
proxy = {};
|
||||
}
|
||||
custom;
|
||||
eduroamProfile = {
|
||||
connection.uuid = "eae9fee6-a7d2-4120-a609-440b457d6fcf";
|
||||
wifi-security = {
|
||||
group = "ccmp;tkip;";
|
||||
key-mgmt = "wpa-eap";
|
||||
pairwise = "ccmp;";
|
||||
proto = "rsn;";
|
||||
};
|
||||
"802-1x" = {
|
||||
altsubject-matches = "DNS:srv1-radius.cms.hu-berlin.de;DNS:srv2-radius.cms.hu-berlin.de;";
|
||||
anonymous-identity = "anonymous@wlan.hu-berlin.de";
|
||||
ca-cert = pkgs.fetchurl {
|
||||
url = "https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/t-telesec_globalroot_class_2.pem";
|
||||
sha256 = "0if8aqd06sid7a0vw009zpa087wxcgdd2x6z2zs4pis5kvyqj2dk";
|
||||
};
|
||||
eap = "ttls;";
|
||||
identity = lib.strings.fileContents <secrets/eduroam/identity>;
|
||||
password = lib.strings.fileContents <secrets/eduroam/password>;
|
||||
phase2-auth = "pap";
|
||||
};
|
||||
};
|
||||
in {
|
||||
}: {
|
||||
programs.nm-applet.enable = true;
|
||||
|
||||
networking.networkmanager = {
|
||||
|
||||
@@ -1,118 +1,17 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
ytdl-format = "'bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best'";
|
||||
|
||||
youtube-download = "${pkgs.ts}/bin/ts ${pkgs.yt-dlp}/bin/yt-dlp -f ${ytdl-format} --add-metadata";
|
||||
|
||||
newsboat-home = "${config.users.users.me.home}/cloud/Seafile/Documents/newsboat";
|
||||
linkhandler = pkgs.writers.writeDash "linkhandler" ''
|
||||
# Feed script a url or file location.
|
||||
# If an image, it will view in sxiv,
|
||||
# if a video or gif, it will view in mpv
|
||||
# if a music file or pdf, it will download,
|
||||
# otherwise it opens link in browser.
|
||||
|
||||
# If no url given. Opens browser. For using script as $BROWSER.
|
||||
[ -z "$1" ] && { "$BROWSER"; exit; }
|
||||
|
||||
case "$1" in
|
||||
*mkv|*webm|*mp4|*youtube.com/watch*|*youtube.com/playlist*|*youtu.be*|*bitchute.com*|*videos.lukesmith.xyz*|*odysee.com*)
|
||||
setsid -f ${pkgs.mpv}/bin/mpv -quiet "$1" >/dev/null 2>&1 ;;
|
||||
*png|*jpg|*jpe|*jpeg|*gif)
|
||||
curl -sL "$1" > "/tmp/$(echo "$1" | sed "s/.*\///")" && sxiv -a "/tmp/$(echo "$1" | sed "s/.*\///")" >/dev/null 2>&1 & ;;
|
||||
*mp3|*flac|*opus|*mp3?source*)
|
||||
setsid -f tsp curl -LO "$1" >/dev/null 2>&1 ;;
|
||||
*)
|
||||
if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR" "$1"
|
||||
else setsid -f "$BROWSER" "$1" >/dev/null 2>&1; fi ;;
|
||||
esac
|
||||
'';
|
||||
|
||||
newsboat-config = pkgs.writeText "config" ''
|
||||
auto-reload no
|
||||
reload-threads 8
|
||||
prepopulate-query-feeds yes
|
||||
|
||||
# dont keep a search history
|
||||
history-limit 0
|
||||
|
||||
datetime-format %F
|
||||
|
||||
text-width 85
|
||||
|
||||
external-url-viewer "${pkgs.urlscan}/bin/urlscan -dc -r '${linkhandler} {}'"
|
||||
browser ${linkhandler}
|
||||
macro , open-in-browser
|
||||
macro c set browser "${pkgs.xsel}/bin/xsel -b <<<" ; open-in-browser ; set browser ${linkhandler}
|
||||
macro v set browser "${pkgs.util-linux}/bin/setsid -f ${pkgs.mpv}/bin/mpv" ; open-in-browser ; set browser ${linkhandler}
|
||||
macro y set browser "${youtube-download}" ; open-in-browser ; set browser ${linkhandler}
|
||||
|
||||
bind-key j down
|
||||
bind-key k up
|
||||
bind-key j next articlelist
|
||||
bind-key k prev articlelist
|
||||
bind-key J next-feed articlelist
|
||||
bind-key K prev-feed articlelist
|
||||
bind-key G end
|
||||
bind-key g home
|
||||
bind-key d pagedown
|
||||
bind-key u pageup
|
||||
bind-key l open
|
||||
bind-key h quit
|
||||
bind-key a toggle-article-read
|
||||
bind-key n next-unread
|
||||
bind-key N prev-unread
|
||||
bind-key D pb-download
|
||||
bind-key U show-urls
|
||||
bind-key x pb-delete
|
||||
|
||||
save-path ${newsboat-home}/saved/
|
||||
|
||||
highlight all "---.*---" yellow default
|
||||
# highlight feedlist ".*(0/0))" default default
|
||||
highlight article "^Title:.*" yellow default bold
|
||||
highlight article "^Author:.*" yellow default
|
||||
highlight article "^Flags:.*" red default
|
||||
highlight article "\\[[0-9][0-9]*\\]" color66 default bold
|
||||
highlight article "\\[image [0-9][0-9]*\\]" color109 default bold
|
||||
highlight article "\\[embedded flash: [0-9][0-9]*\\]" color66 default bold
|
||||
|
||||
color listfocus blue default
|
||||
color listfocus_unread blue default bold
|
||||
color info red default bold
|
||||
|
||||
urls-source "miniflux"
|
||||
miniflux-url "https://feed.kmein.de"
|
||||
miniflux-login "kfm"
|
||||
miniflux-password "${lib.strings.fileContents <secrets/miniflux/password>}"
|
||||
'';
|
||||
|
||||
newsboat-sql = "${pkgs.sqlite}/bin/sqlite3 ${newsboat-home}/cache.db";
|
||||
in {
|
||||
}: {
|
||||
environment.systemPackages = [
|
||||
pkgs.newsboat
|
||||
(pkgs.writers.writeDashBin "newsboat-unread-count" ''
|
||||
if [ -f ${newsboat-home}/cache.db.lock ]; then
|
||||
${pkgs.jq}/bin/jq -n '{state: "Info", text: "↻", icon: "rss"}'
|
||||
else
|
||||
|
||||
${pkgs.jq}/bin/jq -n \
|
||||
--argjson unread "$(${newsboat-sql} "SELECT COUNT(DISTINCT id) FROM rss_item WHERE unread=1")" \
|
||||
--argjson watchLater "$(${newsboat-sql} "SELECT COUNT(DISTINCT id) FROM rss_item WHERE flags='e' AND deleted=0")" \
|
||||
'{
|
||||
state: (if $unread > 0 then "Good" else "Idle" end),
|
||||
text: (if $unread > 0 then "\($unread)" else "[\($watchLater)]" end),
|
||||
icon: "rss"
|
||||
}'
|
||||
fi
|
||||
'')
|
||||
(pkgs.writers.writeDashBin "mpv-watch-later" ''
|
||||
${newsboat-sql} "SELECT url FROM rss_item WHERE flags='e' AND deleted=0 ORDER BY pubDate DESC" \
|
||||
| ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv
|
||||
(pkgs.writers.writeDashBin "miniflux-watch-later" ''
|
||||
miniflux_api_token=$(cat ${config.age.secrets.miniflux-api-token.path})
|
||||
random_feed_item=$(
|
||||
${pkgs.curl}/bin/curl -u "$miniflux_api_token" --basic -s 'https://feed.kmein.de/v1/entries?starred=true&limit=0' \
|
||||
| ${pkgs.jq}/bin/jq -r '.entries[].id' \
|
||||
| ${pkgs.coreutils}/bin/shuf -n1
|
||||
)
|
||||
${pkgs.xdg-utils}/bin/xdg-open "https://feed.kmein.de/starred/entry/$random_feed_item"
|
||||
'')
|
||||
];
|
||||
}
|
||||
|
||||
445
configs/niri.nix
Normal file
445
configs/niri.nix
Normal file
@@ -0,0 +1,445 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
niveumPackages,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (import ../lib) defaultApplications;
|
||||
niriConfig =
|
||||
let
|
||||
klem = niveumPackages.klem.override {
|
||||
config.dmenu = "${pkgs.dmenu}/bin/dmenu -i -p klem";
|
||||
config.scripts = {
|
||||
"p.r paste" = pkgs.writers.writeDash "p.r" ''
|
||||
${pkgs.curl}/bin/curl -fSs http://p.r --data-binary @- \
|
||||
| ${pkgs.coreutils}/bin/tail --lines=1 \
|
||||
| ${pkgs.gnused}/bin/sed 's/\\<r\\>/krebsco.de/'
|
||||
'';
|
||||
"envs.sh paste" = pkgs.writers.writeDash "envs-host" ''
|
||||
${pkgs.curl}/bin/curl -F "file=@-" https://envs.sh
|
||||
'';
|
||||
"envs.sh shorten" = pkgs.writers.writeDash "envs-shorten" ''
|
||||
${pkgs.curl}/bin/curl -F "shorten=$(${pkgs.coreutils}/bin/cat)" https://envs.sh
|
||||
'';
|
||||
"go.r shorten" = pkgs.writers.writeDash "go.r" ''
|
||||
${pkgs.curl}/bin/curl -fSs http://go.r -F "uri=$(${pkgs.coreutils}/bin/cat)"
|
||||
'';
|
||||
"4d2.org paste" = pkgs.writers.writeDash "4d2-paste" ''
|
||||
${pkgs.curl}/bin/curl -F "file=@-" https://depot.4d2.org/
|
||||
'';
|
||||
"0x0.st shorten" = pkgs.writers.writeDash "0x0.st" ''
|
||||
${pkgs.curl}/bin/curl -fSs https://0x0.st -F "shorten=$(${pkgs.coreutils}/bin/cat)"
|
||||
'';
|
||||
"rot13" = pkgs.writers.writeDash "rot13" ''
|
||||
${pkgs.coreutils}/bin/tr '[A-Za-z]' '[N-ZA-Mn-za-m]'
|
||||
'';
|
||||
"ipa" = pkgs.writers.writeDash "ipa" ''
|
||||
${niveumPackages.ipa}/bin/ipa
|
||||
'';
|
||||
"betacode" = pkgs.writers.writeDash "betacode" ''
|
||||
${niveumPackages.betacode}/bin/betacode
|
||||
'';
|
||||
"curl" = pkgs.writers.writeDash "curl" ''
|
||||
${pkgs.curl}/bin/curl -fSs "$(${pkgs.coreutils}/bin/cat)"
|
||||
'';
|
||||
ocr = pkgs.writers.writeDash "ocr" ''
|
||||
${pkgs.tesseract4}/bin/tesseract -l eng+deu - stdout
|
||||
'';
|
||||
emojai = pkgs.writers.writeDash "emojai" ''
|
||||
${pkgs.curl}/bin/curl https://www.emojai.app/api/generate -X POST -H 'Content-Type: application/json' --data-raw "$(${pkgs.jq}/bin/jq -sR '{emoji:.}')" | ${pkgs.jq}/bin/jq -r .result
|
||||
'';
|
||||
"gpt-3.5" = pkgs.writers.writeDash "gpt" ''
|
||||
${niveumPackages.gpt35}/bin/gpt
|
||||
'';
|
||||
gpt-4 = pkgs.writers.writeDash "gpt" ''
|
||||
${niveumPackages.gpt4}/bin/gpt
|
||||
'';
|
||||
};
|
||||
};
|
||||
in
|
||||
''
|
||||
spawn-at-startup "${pkgs.ironbar}/bin/ironbar"
|
||||
spawn-at-startup "${pkgs.xwayland-satellite}/bin/xwayland-satellite"
|
||||
|
||||
environment {
|
||||
DISPLAY ":0"
|
||||
ANKI_WAYLAND "1"
|
||||
}
|
||||
|
||||
input {
|
||||
warp-mouse-to-focus
|
||||
focus-follows-mouse max-scroll-amount="0%"
|
||||
|
||||
keyboard {
|
||||
repeat-rate 35
|
||||
repeat-delay 350
|
||||
track-layout "global"
|
||||
|
||||
xkb {
|
||||
layout "de"
|
||||
variant "T3"
|
||||
options "ctrl:nocaps,compose:caps,grp:ctrls_toggle"
|
||||
}
|
||||
}
|
||||
touchpad {
|
||||
click-method "clickfinger"
|
||||
tap
|
||||
dwt
|
||||
dwtp
|
||||
}
|
||||
}
|
||||
|
||||
prefer-no-csd
|
||||
|
||||
hotkey-overlay {
|
||||
skip-at-startup
|
||||
}
|
||||
|
||||
layout {
|
||||
gaps 5
|
||||
|
||||
default-column-width {
|
||||
proportion 0.5
|
||||
}
|
||||
|
||||
preset-column-widths {
|
||||
proportion 0.33333
|
||||
proportion 0.5
|
||||
proportion 0.66667
|
||||
}
|
||||
|
||||
focus-ring {
|
||||
width 2
|
||||
}
|
||||
|
||||
shadow {
|
||||
// on
|
||||
softness 30
|
||||
spread 5
|
||||
offset x=0 y=5
|
||||
draw-behind-window true
|
||||
color "#00000070"
|
||||
// inactive-color "#00000054"
|
||||
}
|
||||
|
||||
tab-indicator {
|
||||
// off
|
||||
hide-when-single-tab
|
||||
place-within-column
|
||||
gap 5
|
||||
width 4
|
||||
length total-proportion=1.0
|
||||
position "right"
|
||||
gaps-between-tabs 2
|
||||
corner-radius 8
|
||||
active-color "red"
|
||||
inactive-color "gray"
|
||||
urgent-color "blue"
|
||||
// active-gradient from="#80c8ff" to="#bbddff" angle=45
|
||||
// inactive-gradient from="#505050" to="#808080" angle=45 relative-to="workspace-view"
|
||||
// urgent-gradient from="#800" to="#a33" angle=45
|
||||
}
|
||||
|
||||
border {
|
||||
off
|
||||
}
|
||||
}
|
||||
|
||||
animations {
|
||||
// off
|
||||
workspace-switch {
|
||||
spring damping-ratio=1.0 stiffness=1000 epsilon=0.0001
|
||||
}
|
||||
|
||||
window-open {
|
||||
duration-ms 150
|
||||
curve "ease-out-expo"
|
||||
}
|
||||
|
||||
window-close {
|
||||
duration-ms 150
|
||||
curve "ease-out-quad"
|
||||
}
|
||||
|
||||
horizontal-view-movement {
|
||||
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
|
||||
}
|
||||
|
||||
window-movement {
|
||||
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
|
||||
}
|
||||
|
||||
window-resize {
|
||||
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
|
||||
}
|
||||
|
||||
config-notification-open-close {
|
||||
spring damping-ratio=0.6 stiffness=1000 epsilon=0.001
|
||||
}
|
||||
|
||||
screenshot-ui-open {
|
||||
duration-ms 200
|
||||
curve "ease-out-quad"
|
||||
}
|
||||
|
||||
overview-open-close {
|
||||
spring damping-ratio=1.0 stiffness=800 epsilon=0.0001
|
||||
}
|
||||
}
|
||||
|
||||
window-rule {
|
||||
geometry-corner-radius 0
|
||||
clip-to-geometry true
|
||||
}
|
||||
|
||||
window-rule {
|
||||
match app-id="mpv"
|
||||
open-floating true
|
||||
}
|
||||
window-rule {
|
||||
match app-id="rofi"
|
||||
open-floating true
|
||||
}
|
||||
window-rule {
|
||||
match app-id=r#"firefox$"# title="^Picture-in-Picture$"
|
||||
open-floating true
|
||||
default-floating-position x=32 y=32 relative-to="bottom-left"
|
||||
}
|
||||
|
||||
window-rule {
|
||||
match is-window-cast-target=true
|
||||
|
||||
border {
|
||||
on
|
||||
width 3
|
||||
active-color "#f38ba8"
|
||||
inactive-color "#7d0d2d"
|
||||
}
|
||||
}
|
||||
|
||||
binds {
|
||||
Mod+Shift+Slash { show-hotkey-overlay; }
|
||||
Mod+Return { spawn "${(defaultApplications pkgs).terminal}"; }
|
||||
Mod+D { spawn "${pkgs.wofi}/bin/wofi" "--show" "run"; }
|
||||
Mod+Shift+D { spawn "${niveumPackages.notemenu}/bin/notemenu"; }
|
||||
Mod+T { spawn "${(defaultApplications pkgs).fileManager}"; }
|
||||
Mod+Y { spawn "${(defaultApplications pkgs).browser}"; }
|
||||
Mod+P { spawn "${niveumPackages.passmenu}/bin/passmenu"; }
|
||||
Mod+U { spawn "${niveumPackages.unicodmenu}/bin/unicodmenu"; }
|
||||
Mod+Shift+Z { toggle-window-floating; }
|
||||
|
||||
Mod+B { spawn "${pkgs.ironbar}/bin/ironbar" "bar" "bar-1337" "toggle-visible"; }
|
||||
Mod+F12 { spawn "${klem}/bin/klem"; }
|
||||
|
||||
Mod+Shift+Q { close-window; }
|
||||
|
||||
XF86AudioRaiseVolume allow-when-locked=true { spawn "${pkgs.pamixer}/bin/pamixer -i 5"; }
|
||||
XF86AudioLowerVolume allow-when-locked=true { spawn "${pkgs.pamixer}/bin/pamixer -d 5"; }
|
||||
XF86AudioMute allow-when-locked=true { spawn "${pkgs.pamixer}/bin/pamixer -t"; }
|
||||
|
||||
XF86AudioPause allow-when-locked=true { spawn "${pkgs.playerctl}/bin/playerctl play-pause"; }
|
||||
XF86AudioPlay allow-when-locked=true { spawn "${pkgs.playerctl}/bin/playerctl play-pause"; }
|
||||
XF86AudioNext allow-when-locked=true { spawn "${pkgs.playerctl}/bin/playerctl next"; }
|
||||
XF86AudioPrev allow-when-locked=true { spawn "${pkgs.playerctl}/bin/playerctl previous"; }
|
||||
XF86AudioStop allow-when-locked=true { spawn "${pkgs.playerctl}/bin/playerctl stop"; }
|
||||
Print { spawn "flameshot gui"; }
|
||||
Mod+Shift+W { spawn "swaylock"; }
|
||||
|
||||
Mod+Comma { consume-or-expel-window-left; }
|
||||
Mod+Period { consume-or-expel-window-right; }
|
||||
Mod+W { toggle-column-tabbed-display; }
|
||||
Mod+A repeat=false { toggle-overview; }
|
||||
Mod+F { maximize-column; }
|
||||
Mod+C { center-column; }
|
||||
Mod+Minus { set-column-width "-25%"; }
|
||||
Mod+Plus { set-column-width "+25%"; }
|
||||
|
||||
Mod+Ctrl+0 { spawn "niri" "msg" "action" "switch-layout" "0"; }
|
||||
Mod+Ctrl+1 { spawn "niri" "msg" "action" "switch-layout" "1"; }
|
||||
Mod+Ctrl+2 { spawn "niri" "msg" "action" "switch-layout" "2"; }
|
||||
Mod+Ctrl+3 { spawn "niri" "msg" "action" "switch-layout" "3"; }
|
||||
Mod+Ctrl+4 { spawn "niri" "msg" "action" "switch-layout" "4"; }
|
||||
Mod+Ctrl+5 { spawn "niri" "msg" "action" "switch-layout" "5"; }
|
||||
Mod+Ctrl+6 { spawn "niri" "msg" "action" "switch-layout" "6"; }
|
||||
Mod+Ctrl+7 { spawn "niri" "msg" "action" "switch-layout" "7"; }
|
||||
Mod+Ctrl+8 { spawn "niri" "msg" "action" "switch-layout" "8"; }
|
||||
Mod+Ctrl+9 { spawn "niri" "msg" "action" "switch-layout" "9"; }
|
||||
|
||||
Mod+H { focus-column-or-monitor-left; }
|
||||
Mod+J { focus-window-or-workspace-down; }
|
||||
Mod+K { focus-window-or-workspace-up; }
|
||||
Mod+L { focus-column-or-monitor-right; }
|
||||
|
||||
Mod+Shift+H { move-column-left-or-to-monitor-left; }
|
||||
Mod+Shift+J { move-window-down-or-to-workspace-down; }
|
||||
Mod+Shift+K { move-window-up-or-to-workspace-up; }
|
||||
Mod+Shift+L { move-column-right-or-to-monitor-right; }
|
||||
|
||||
Mod+Ctrl+H { focus-monitor-left; }
|
||||
Mod+Ctrl+J { focus-monitor-down; }
|
||||
Mod+Ctrl+K { focus-monitor-up; }
|
||||
Mod+Ctrl+L { focus-monitor-right; }
|
||||
|
||||
Mod+Shift+Ctrl+H { move-column-to-monitor-left; }
|
||||
Mod+Shift+Ctrl+J { move-column-to-workspace-down; }
|
||||
Mod+Shift+Ctrl+K { move-column-to-workspace-up; }
|
||||
Mod+Shift+Ctrl+L { move-column-to-monitor-right; }
|
||||
|
||||
Mod+Shift+Alt+Ctrl+H { move-workspace-to-monitor-left; }
|
||||
Mod+Shift+Alt+Ctrl+J { move-workspace-down; }
|
||||
Mod+Shift+Alt+Ctrl+K { move-workspace-up; }
|
||||
Mod+Shift+Alt+Ctrl+L { move-workspace-to-monitor-right; }
|
||||
|
||||
Mod+1 { focus-workspace 1; }
|
||||
Mod+2 { focus-workspace 2; }
|
||||
Mod+3 { focus-workspace 3; }
|
||||
Mod+4 { focus-workspace 4; }
|
||||
Mod+5 { focus-workspace 5; }
|
||||
Mod+6 { focus-workspace 6; }
|
||||
Mod+7 { focus-workspace 7; }
|
||||
Mod+8 { focus-workspace 8; }
|
||||
Mod+9 { focus-workspace 9; }
|
||||
Mod+0 { focus-workspace 10; }
|
||||
|
||||
Mod+Shift+1 { move-window-to-workspace "1"; }
|
||||
Mod+Shift+2 { move-window-to-workspace "2"; }
|
||||
Mod+Shift+3 { move-window-to-workspace "3"; }
|
||||
Mod+Shift+4 { move-window-to-workspace "4"; }
|
||||
Mod+Shift+5 { move-window-to-workspace "5"; }
|
||||
Mod+Shift+6 { move-window-to-workspace "6"; }
|
||||
Mod+Shift+7 { move-window-to-workspace "7"; }
|
||||
Mod+Shift+8 { move-window-to-workspace "8"; }
|
||||
Mod+Shift+9 { move-window-to-workspace "9"; }
|
||||
Mod+Shift+0 { move-window-to-workspace "0"; }
|
||||
}
|
||||
'';
|
||||
in
|
||||
{
|
||||
system.activationScripts.niriConfig = {
|
||||
text = ''
|
||||
cp ${pkgs.writeText "config.kdl" niriConfig} ${config.users.users.me.home}/.config/niri/config.kdl
|
||||
chown ${config.users.users.me.name}:${config.users.users.me.group} ${config.users.users.me.home}/.config/niri/config.kdl
|
||||
'';
|
||||
};
|
||||
|
||||
programs.niri.enable = true;
|
||||
services.displayManager.defaultSession = lib.mkForce "niri";
|
||||
home-manager.users.me = {
|
||||
xdg.configFile."ironbar/style.css".text = ''
|
||||
* {
|
||||
font-size: 8pt;
|
||||
font-family: "Gentium Plus", "BlexMono Nerd Font";
|
||||
}
|
||||
|
||||
box, menubar, button {
|
||||
background-color: unset;
|
||||
box-shadow: none;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.clock, .upower, .volume {
|
||||
font-weight: unset;
|
||||
}
|
||||
|
||||
tooltip * {
|
||||
font-family: "BlexMono Nerd Font";
|
||||
font-size: 7pt;
|
||||
}
|
||||
'';
|
||||
xdg.configFile."ironbar/config.json".source = (pkgs.formats.json { }).generate "ironbar.json" {
|
||||
name = "bar-1337";
|
||||
height = 12;
|
||||
layer = "top";
|
||||
position = "bottom";
|
||||
start = [ ];
|
||||
center = [
|
||||
{
|
||||
type = "tray";
|
||||
icon_size = 8;
|
||||
}
|
||||
{ type = "clipboard"; }
|
||||
{ type = "notifications"; }
|
||||
];
|
||||
end = [
|
||||
{
|
||||
type = "upower";
|
||||
icon_size = 8;
|
||||
format = "{percentage}%";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
tooltip = "{{df -h --output=size,used,avail,pcent,target}}";
|
||||
label = "\t{{5000:df -h / --output=avail | tail +2}}";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
tooltip = "{{free -Lh --si | awk '{for(i=1;i<=NF;i++){printf \"%s%s\", $i, (i%2? OFS: ORS)} if(NF%2) printf ORS}'}}";
|
||||
label = "\t{{500:free -h --si | awk 'NR==2{printf $3 \"\\n\"}'}}";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
tooltip = "{{}}";
|
||||
on_click_left = "pamixer -t";
|
||||
on_scroll_up = "pamixer -i 1";
|
||||
on_scroll_down = "pamixer -d 1";
|
||||
label = "{{500:if $(pamixer --get-mute) = true; then echo ; else echo ; fi}}\t{{500:pamixer --get-volume}}%";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
tooltip = "{{uptime}}";
|
||||
label = "\t{{500:uptime | sed 's/.*load average: \\([^ ]*\\);.*/\\1/' | tr ' ' '\n'}}";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
tooltip = "{{khal list today today -d astro-test-3 }}";
|
||||
label = "";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
tooltip = "{{curl wttr.in/?0 | ${pkgs.ansifilter}/bin/ansifilter}}";
|
||||
label = "";
|
||||
}
|
||||
{
|
||||
type = "label";
|
||||
name = "cal";
|
||||
tooltip = "{{cal}}";
|
||||
label = "{{500:date +'<U+F017>\t%Y-%m-%d (%W %a) %H:%M'}}";
|
||||
}
|
||||
];
|
||||
};
|
||||
programs.alacritty.enable = true; # Super+T in the default setting (terminal)
|
||||
programs.swaylock.enable = true; # Super+Alt+L in the default setting (screen locker)
|
||||
services.swaync = {
|
||||
enable = true;
|
||||
settings = {
|
||||
notification-window-width = 300;
|
||||
control-center-width = 300;
|
||||
widgets = [
|
||||
"volume"
|
||||
"mpris"
|
||||
"title"
|
||||
"dnd"
|
||||
"notifications"
|
||||
];
|
||||
widget-config = {
|
||||
title = {
|
||||
text = "ⲡⲧⲏⲣϥ̄";
|
||||
"clear-all-button" = true;
|
||||
"button-text" = "ⲧⲁⲩⲟⲟⲩ";
|
||||
};
|
||||
dnd.text = "ⲙ̄ⲡⲣ̄ϣⲧⲣ̄ⲧⲱⲣⲧ̄";
|
||||
label.text = "ⲧⲙⲏⲧⲉ";
|
||||
};
|
||||
};
|
||||
};
|
||||
services.swayidle.enable = true; # idle management daemon
|
||||
home.packages = with pkgs; [
|
||||
xdg-desktop-portal-gnome
|
||||
swaybg
|
||||
];
|
||||
};
|
||||
services.gnome.gnome-keyring.enable = true; # secret service
|
||||
security.pam.services.swaylock = { };
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
config.allowUnfree = true;
|
||||
};
|
||||
nix = {
|
||||
package = pkgs.nixFlakes;
|
||||
package = pkgs.nixVersions.stable;
|
||||
extraOptions = "experimental-features = nix-command flakes";
|
||||
nixPath = ["nixpkgs=${inputs.nixpkgs}"];
|
||||
};
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
}: let
|
||||
worldradio = pkgs.callPackage ../packages/worldradio.nix {};
|
||||
|
||||
externalNetwork = import ../lib/external-network.nix;
|
||||
|
||||
zoteroStyle = {
|
||||
name,
|
||||
sha256,
|
||||
@@ -63,9 +65,7 @@ in {
|
||||
environment.systemPackages = with pkgs; [
|
||||
# INTERNET
|
||||
aria2
|
||||
firefox
|
||||
tdesktop
|
||||
gomuks
|
||||
whois
|
||||
dnsutils
|
||||
# FILE MANAGERS
|
||||
@@ -73,6 +73,7 @@ in {
|
||||
pcmanfm
|
||||
# MEDIA
|
||||
ffmpeg
|
||||
simplescreenrecorder
|
||||
imagemagick
|
||||
exiftool
|
||||
nsxiv
|
||||
@@ -81,45 +82,54 @@ in {
|
||||
bat # better cat
|
||||
dos2unix
|
||||
genpass # generate passwords
|
||||
(pkgs.writers.writeDashBin "genpassphrase" ''${pkgs.genpass}/bin/genpass --passphrase | ${pkgs.gnused}/bin/sed 's/ /-/g;s/\(^\|-\)\([a-z]\)/\1\U\2/g;s/$/-'$(${pkgs.coreutils}/bin/date +%Y)'/' '')
|
||||
gcc
|
||||
python3Packages.jsonschema # json validation
|
||||
pup # html toolkit
|
||||
htmlq
|
||||
xsv # csv toolkit
|
||||
xan # csv toolkit
|
||||
magic-wormhole-rs # file transfer
|
||||
man-pages
|
||||
man-pages-posix
|
||||
exfat # to mount windows drives
|
||||
# HARDWARE TOOLS
|
||||
gnome.gnome-disk-utility
|
||||
gnome-disk-utility
|
||||
arandr # xrandr for noobs
|
||||
libnotify # for notify-send
|
||||
xclip # clipboard CLI
|
||||
wl-clipboard # clipboard CLI
|
||||
xdragon # drag and drop
|
||||
xorg.xkill # kill by clicking
|
||||
portfolio # personal finance overview
|
||||
audacity
|
||||
calibre
|
||||
electrum
|
||||
inkscape
|
||||
krita
|
||||
niveumPackages.gimp
|
||||
gthumb
|
||||
astrolog
|
||||
obsidian
|
||||
lemmeknow # identify strings
|
||||
aichat # chat with llms
|
||||
anki-bin # flashcards
|
||||
jbofihe # lojbanic software
|
||||
unstablePackages.zoom-us # video conferencing
|
||||
zoom-us # video conferencing
|
||||
(pkgs.writers.writeDashBin "im" ''
|
||||
weechat_password=$(${pkgs.pass}/bin/pass weechat)
|
||||
exec ${unstablePackages.weechat}/bin/weechat -t -r '/mouse enable; /remote add makanek http://${externalNetwork.makanek}:8002 -password='"$weechat_password"'; /remote connect makanek'
|
||||
'')
|
||||
alejandra # nix formatter
|
||||
pdfgrep # search in pdf
|
||||
pdftk # pdf toolkit
|
||||
mupdf
|
||||
poppler_utils # pdf toolkit
|
||||
okular # the word is nucular
|
||||
kdePackages.okular # the word is nucular
|
||||
xournalpp # for annotating pdfs
|
||||
pdfpc # presenter console for pdf slides
|
||||
niveumPackages.hc # print files as qr codes
|
||||
# niveumPackages.hc # print files as qr codes
|
||||
yt-dlp
|
||||
espeak
|
||||
rink # unit converter
|
||||
niveumPackages.auc
|
||||
niveumPackages.noise-waves
|
||||
niveumPackages.cheat-sh
|
||||
niveumPackages.polyglot
|
||||
niveumPackages.qrpaste
|
||||
@@ -134,11 +144,10 @@ in {
|
||||
niveumPackages.pls
|
||||
niveumPackages.mpv-tv
|
||||
niveumPackages.mpv-iptv
|
||||
jellyfin-media-player
|
||||
# jellyfin-media-player
|
||||
niveumPackages.devanagari
|
||||
niveumPackages.betacode # ancient greek betacode to unicode converter
|
||||
niveumPackages.meteo
|
||||
niveumPackages.mahlzeit
|
||||
niveumPackages.jq-lsp
|
||||
niveumPackages.swallow # window swallowing
|
||||
niveumPackages.literature-quote
|
||||
@@ -155,6 +164,11 @@ in {
|
||||
(niveumPackages.mpv-radio.override {
|
||||
di-fm-key-file = config.age.secrets.di-fm-key.path;
|
||||
})
|
||||
(niveumPackages.mpv-radio.override {
|
||||
di-fm-key-file = config.age.secrets.di-fm-key.path;
|
||||
executableName = "cro-radio";
|
||||
mpvCommand = "${niveumPackages.cro}/bin/cro";
|
||||
})
|
||||
(niveumPackages.mpv-tuner.override {
|
||||
di-fm-key-file = config.age.secrets.di-fm-key.path;
|
||||
})
|
||||
@@ -167,7 +181,7 @@ in {
|
||||
niveumPackages.menu-calc
|
||||
nix-prefetch-git
|
||||
niveumPackages.nix-git
|
||||
nixfmt
|
||||
nixfmt-rfc-style
|
||||
par
|
||||
qrencode
|
||||
|
||||
@@ -197,7 +211,7 @@ in {
|
||||
|
||||
#krebs
|
||||
niveumPackages.dic
|
||||
config.nur.repos.mic92.ircsink
|
||||
pkgs.nur.repos.mic92.ircsink
|
||||
|
||||
(haskellPackages.ghcWithHoogle (hs: [
|
||||
hs.text
|
||||
@@ -217,18 +231,6 @@ in {
|
||||
]))
|
||||
# python3Packages.poetry
|
||||
|
||||
# language servers
|
||||
pyright
|
||||
haskell-language-server
|
||||
texlab
|
||||
nil
|
||||
rust-analyzer
|
||||
elmPackages.elm-language-server
|
||||
nodePackages.typescript-language-server
|
||||
lua-language-server
|
||||
nodePackages.vscode-langservers-extracted
|
||||
|
||||
dhall-lsp-server
|
||||
dhall-nix
|
||||
dhall-bash
|
||||
dhall-json
|
||||
@@ -237,13 +239,8 @@ in {
|
||||
html-tidy
|
||||
nodePackages.csslint
|
||||
nodePackages.jsonlint
|
||||
nodePackages.prettier
|
||||
nodePackages.typescript
|
||||
nodePackages.eslint
|
||||
nodePackages.yarn
|
||||
deno # better node.js
|
||||
nodejs
|
||||
texlive.combined.scheme-full
|
||||
# texlive.combined.scheme-full
|
||||
latexrun
|
||||
(aspellWithDicts (dict: [dict.de dict.en dict.en-computers]))
|
||||
# haskellPackages.pandoc-citeproc
|
||||
@@ -254,6 +251,7 @@ in {
|
||||
# gnumeric
|
||||
dia
|
||||
pandoc
|
||||
librsvg # pandoc depends on this to include SVG in documents
|
||||
# niveumPackages.man-pandoc
|
||||
typst
|
||||
# proselint
|
||||
@@ -265,6 +263,10 @@ in {
|
||||
# nightly.rust
|
||||
shellcheck
|
||||
|
||||
# photography
|
||||
gphoto2
|
||||
darktable
|
||||
|
||||
(pkgs.writers.writeDashBin "hass-cli" ''
|
||||
HASS_SERVER=http://zaatar.r:8123 HASS_TOKEN="$(cat ${config.age.secrets.home-assistant-token.path})" exec ${pkgs.home-assistant-cli}/bin/hass-cli "$@"
|
||||
'')
|
||||
|
||||
@@ -12,7 +12,7 @@ in {
|
||||
];
|
||||
|
||||
# allow connecting to .local printers
|
||||
services.avahi.nssmdns = true;
|
||||
services.avahi.nssmdns4 = true;
|
||||
|
||||
hardware.printers.ensurePrinters = [
|
||||
{
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
services.xserver.displayManager.sessionCommands = "${pkgs.seafile-client}/bin/seafile-applet &";
|
||||
|
||||
home-manager.users.me.xdg.configFile = {
|
||||
"Seafile/Seafile Client.conf".source = (pkgs.formats.ini {}).generate "Seafile Client.conf" {
|
||||
Behavior = {
|
||||
hideDockIcon = false;
|
||||
hideMainWindowWhenStarted = true;
|
||||
};
|
||||
Settings = {
|
||||
computerName = config.networking.hostName;
|
||||
lastShiburl = "https://box.hu-berlin.de";
|
||||
};
|
||||
UsedServerAddresses.main = "https://box.hu-berlin.de";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [pkgs.seafile-client];
|
||||
}
|
||||
@@ -1,6 +1,4 @@
|
||||
{pkgs, ...}: {
|
||||
sound.enable = true;
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
alsa = {
|
||||
@@ -19,14 +17,6 @@
|
||||
publish.userServices = true;
|
||||
};
|
||||
|
||||
environment.etc."pipewire/pipewire-pulse.conf.d/50-network-party.conf".text = ''
|
||||
context.exec = [
|
||||
{ path = "pactl" args = "load-module module-native-protocol-tcp" }
|
||||
{ path = "pactl" args = "load-module module-zeroconf-discover" }
|
||||
{ path = "pactl" args = "load-module module-zeroconf-publish" }
|
||||
]
|
||||
'';
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.pavucontrol
|
||||
pkgs.ncpamixer
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
externalNetwork = import ../lib/external-network.nix;
|
||||
in {
|
||||
users.users.me.openssh.authorizedKeys.keys = kieran.sshKeys;
|
||||
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
home-manager.users.me = {
|
||||
|
||||
@@ -17,5 +17,7 @@ in {
|
||||
};
|
||||
};
|
||||
|
||||
users.users.root.openssh.authorizedKeys.keys = kieran.sshKeys;
|
||||
users.users.root.openssh.authorizedKeys.keys = kieran.sshKeys ++ [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPoiRIn1dBUtpApcUyGbZKN+m5KBSgKIDQjdnQ8vU0xU kfm@kibbeh" # travel laptop
|
||||
];
|
||||
}
|
||||
|
||||
@@ -15,8 +15,18 @@
|
||||
in {
|
||||
# https://danth.github.io/stylix/tricks.html
|
||||
# stylix.image = inputs.wallpapers.outPath + "/meteora/rodrigo-soares-250630.jpg";
|
||||
stylix.enable = true;
|
||||
stylix.image = generatedWallpaper;
|
||||
|
||||
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/ayu-light.yaml";
|
||||
|
||||
stylix.cursor = {
|
||||
name = "capitaine-cursors-white";
|
||||
package = pkgs.capitaine-cursors;
|
||||
size = 12;
|
||||
};
|
||||
|
||||
|
||||
# environment.etc."stylix/wallpaper.png".source = generatedWallpaper;
|
||||
|
||||
# stylix.polarity = "either";
|
||||
@@ -42,18 +52,18 @@ in {
|
||||
|
||||
stylix.fonts = {
|
||||
serif = {
|
||||
package = pkgs.noto-fonts;
|
||||
name = "Noto Serif";
|
||||
package = pkgs.gentium;
|
||||
name = "Gentium Plus";
|
||||
};
|
||||
|
||||
sansSerif = {
|
||||
package = pkgs.noto-fonts;
|
||||
name = "Noto Sans";
|
||||
package = pkgs.gentium;
|
||||
name = "Gentium Plus";
|
||||
};
|
||||
|
||||
monospace = {
|
||||
package = pkgs.noto-fonts;
|
||||
name = "Noto Sans Mono";
|
||||
package = pkgs.nerd-fonts.blex-mono;
|
||||
name = "BlexMono Nerd Font";
|
||||
};
|
||||
|
||||
emoji = {
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
celan = pkgs.fetchzip {
|
||||
url = "http://c.krebsco.de/celan.tar.gz";
|
||||
sha256 = "sha256-nA+EwAH2vkeolsy9AoPLEMt1uGKDZe/aPrS95CZvuus=";
|
||||
};
|
||||
in {
|
||||
niveum.telegramBots.celan = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@PaulCelan"];
|
||||
command = toString (pkgs.writers.writeDash "random-celan" ''
|
||||
cd ${celan}
|
||||
poem="$(${pkgs.findutils}/bin/find . -type f | ${pkgs.coreutils}/bin/shuf -n1)"
|
||||
source="$(${pkgs.coreutils}/bin/dirname "$poem" | ${pkgs.gnused}/bin/sed 's#^\./##;s/[-_]/ /g;s!/! › !g;s/0\([0-9]\+\)/\1/g')"
|
||||
cat "$poem"
|
||||
echo
|
||||
printf "Aus: %s\n" "$source"
|
||||
'');
|
||||
};
|
||||
|
||||
systemd.timers.telegram-bot-celan.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Paul Celan Bot";
|
||||
description = "sends a random poem by Paul Celan to Telegram.";
|
||||
link = "https://t.me/PaulCelan";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
hesychius = inputs.scripts.outPath + "/hesychius/hesychius.txt";
|
||||
in {
|
||||
niveum.telegramBots.hesychius = {
|
||||
enable = true;
|
||||
time = "08:00";
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["@HesychiosAlexandreus"];
|
||||
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
|
||||
};
|
||||
|
||||
systemd.timers.telegram-bot-hesychius.timerConfig.RandomizedDelaySec = "10h";
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Hesychius of Alexandria Bot";
|
||||
description = "sends a random word from Hesychius of Alexandria's lexicon to Telegram.";
|
||||
link = "https://t.me/HesychiosAlexandreus";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
lib,
|
||||
niveumPackages,
|
||||
...
|
||||
}: {
|
||||
niveum.telegramBots.quotebot = {
|
||||
enable = true;
|
||||
time = "08/6:00";
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
chatIds = ["-1001760262519"];
|
||||
command = "${niveumPackages.literature-quote}/bin/literature-quote";
|
||||
parseMode = "Markdown";
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Literature quote bot";
|
||||
description = "sends me and my friends three <a href=\"https://logotheca.xn--kiern-0qa.de/\">logotheca</a> quotes a day.";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
niveum.telegramBots.tlg-wotd = {
|
||||
enable = true;
|
||||
time = "9:30";
|
||||
chatIds = ["@tlgwotd"];
|
||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
||||
command = toString (pkgs.writers.writeDash "tlg-wotd" ''
|
||||
${pkgs.curl}/bin/curl -sSL http://stephanus.tlg.uci.edu/Iris/Wotd \
|
||||
| ${pkgs.recode}/bin/recode html..utf8 \
|
||||
| ${pkgs.jq}/bin/jq -r '
|
||||
"*\(.word)* '\'''\(.definition | sub("<.*>"; "") | rtrimstr(" "))'\'''\n\nFirst occurrence: \(.firstOccurrence)\nNumber of occurrences: \(.totalOccurrences)"
|
||||
'
|
||||
'');
|
||||
parseMode = "Markdown";
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
{
|
||||
title = "Thesaurus Linguae Graecae Word of the Day";
|
||||
description = "sends <a href=\"https://stephanus.tlg.uci.edu/\">TLG</a>'s word of the day to Telegram.";
|
||||
link = "https://t.me/tlgwotd";
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -2,11 +2,10 @@
|
||||
config,
|
||||
pkgs,
|
||||
...
|
||||
}: {
|
||||
home-manager.users.me.home.file.".zshrc".text = ''
|
||||
# nothing to see here
|
||||
'';
|
||||
|
||||
}: let
|
||||
promptColours.success = "cyan";
|
||||
promptColours.failure = "red";
|
||||
in {
|
||||
environment.systemPackages = [pkgs.atuin];
|
||||
environment.variables.ATUIN_CONFIG_DIR = toString (pkgs.writeTextDir "/config.toml" ''
|
||||
auto_sync = true
|
||||
@@ -58,7 +57,7 @@
|
||||
|
||||
fpath=(${zsh-completions}/src $fpath)
|
||||
'';
|
||||
promptInit = with config.niveum; ''
|
||||
promptInit = ''
|
||||
autoload -Uz vcs_info
|
||||
zstyle ':vcs_info:*' enable git
|
||||
zstyle ':vcs_info:*' check-for-changes true
|
||||
|
||||
903
flake.lock
generated
903
flake.lock
generated
File diff suppressed because it is too large
Load Diff
73
flake.nix
73
flake.nix
@@ -3,22 +3,25 @@
|
||||
|
||||
inputs = {
|
||||
agenix.url = "github:ryantm/agenix";
|
||||
# alew-web.url = "git+ssh://gitea@code.kmein.de:22022/kfm/alew-web.git?ref=refs/heads/master";
|
||||
coptic-dictionary.url = "github:kmein/coptic-dictionary";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
home-manager.url = "github:nix-community/home-manager/release-23.11";
|
||||
home-manager.url = "github:nix-community/home-manager/release-25.05";
|
||||
menstruation-backend.url = "github:kmein/menstruation.rs";
|
||||
menstruation-telegram.url = "github:kmein/menstruation-telegram";
|
||||
centerpiece.url = "github:friedow/centerpiece";
|
||||
nix-on-droid.url = "github:t184256/nix-on-droid/release-23.05";
|
||||
nixinate.url = "github:matthewcroughan/nixinate";
|
||||
nixpkgs-old.url = "github:NixOS/nixpkgs/50fc86b75d2744e1ab3837ef74b53f103a9b55a0";
|
||||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/master";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
|
||||
nur.url = "github:nix-community/NUR";
|
||||
recht.url = "github:kmein/recht";
|
||||
retiolum.url = "git+https://git.thalheim.io/Mic92/retiolum";
|
||||
retiolum.url = "github:krebs/retiolum";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
scripts.url = "github:kmein/scripts";
|
||||
stylix.url = "github:danth/stylix/release-23.05";
|
||||
stockholm.url = "github:krebs/stockholm";
|
||||
stylix.url = "github:danth/stylix/release-25.05";
|
||||
telebots.url = "github:kmein/telebots";
|
||||
tinc-graph.url = "github:kmein/tinc-graph";
|
||||
voidrice.url = "github:Lukesmithxyz/voidrice";
|
||||
@@ -39,7 +42,6 @@
|
||||
nix-on-droid.inputs.nixpkgs.follows = "nixpkgs";
|
||||
recht.inputs.flake-utils.follows = "flake-utils";
|
||||
recht.inputs.nixpkgs.follows = "nixpkgs";
|
||||
rust-overlay.inputs.flake-utils.follows = "flake-utils";
|
||||
rust-overlay.inputs.nixpkgs.follows = "nixpkgs";
|
||||
scripts.inputs.flake-utils.follows = "flake-utils";
|
||||
scripts.inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -54,6 +56,11 @@
|
||||
wallpapers.flake = false;
|
||||
};
|
||||
|
||||
nixConfig = {
|
||||
extra-substituters = [ "https://kmein.cachix.org" ];
|
||||
extra-trusted-public-keys = [ "kmein.cachix.org-1:rsJ2b6++VQHJ1W6rGuDUYsK/qUkFA3bNpO6PyEyJ9Ls=" ];
|
||||
};
|
||||
|
||||
outputs = inputs @ {
|
||||
self,
|
||||
nixpkgs,
|
||||
@@ -65,6 +72,7 @@
|
||||
nixinate,
|
||||
flake-utils,
|
||||
nix-on-droid,
|
||||
centerpiece,
|
||||
stylix,
|
||||
...
|
||||
}:
|
||||
@@ -101,21 +109,31 @@
|
||||
zaatar = "root@zaatar";
|
||||
makanek = "root@makanek";
|
||||
manakish = "root@manakish";
|
||||
tahina = "root@tahina";
|
||||
tabula = "root@tabula";
|
||||
kabsa = "root@kabsa";
|
||||
fatteh = "root@fatteh";
|
||||
kibbeh = "root@kibbeh";
|
||||
};
|
||||
in
|
||||
lib.attrsets.nameValuePair "deploy-${hostname}" {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeDash "deploy-${hostname}" ''
|
||||
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --max-jobs 2 --log-format internal-json --flake .?submodules=1#${hostname} --build-host ${targets.${hostname}} --target-host ${targets.${hostname}} 2>&1 | ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
|
||||
--max-jobs 2 \
|
||||
--log-format internal-json \
|
||||
--flake .?submodules=1#${hostname} \
|
||||
--target-host ${targets.${hostname}} 2>&1 \
|
||||
| ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
'');
|
||||
}) (builtins.attrNames self.nixosConfigurations))
|
||||
// {
|
||||
deploy-ful = {
|
||||
type = "app";
|
||||
program = toString (pkgs.writers.writeDash "deploy-ful" ''
|
||||
exec ${pkgs.nix}/bin/nix run .?submodules=1#nixinate.ful --log-format internal-json 2>&1 | ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
exec ${pkgs.nix}/bin/nix run .?submodules=1#nixinate.ful \
|
||||
--log-format internal-json 2>&1 \
|
||||
| ${pkgs.nix-output-monitor}/bin/nom --json
|
||||
'');
|
||||
};
|
||||
};
|
||||
@@ -191,8 +209,11 @@
|
||||
agenix.nixosModules.default
|
||||
inputs.self.nixosModules.passport
|
||||
inputs.self.nixosModules.panoptikon
|
||||
inputs.self.nixosModules.htgen
|
||||
inputs.stockholm.nixosModules.reaktor2
|
||||
retiolum.nixosModules.retiolum
|
||||
nur.nixosModules.nur
|
||||
nur.modules.nixos.default
|
||||
{ nixpkgs.overlays = [ inputs.stockholm.overlays.default ]; }
|
||||
{
|
||||
_module.args.nixinate = {
|
||||
host = "ful";
|
||||
@@ -209,7 +230,15 @@
|
||||
specialArgs = niveumSpecialArgs system;
|
||||
modules = [
|
||||
systems/zaatar/configuration.nix
|
||||
inputs.self.nixosModules.moodle-dl
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
];
|
||||
};
|
||||
kibbeh = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = niveumSpecialArgs system;
|
||||
modules = [
|
||||
systems/kibbeh/configuration.nix
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
];
|
||||
@@ -225,19 +254,21 @@
|
||||
inputs.self.nixosModules.passport
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
nur.nixosModules.nur
|
||||
nur.modules.nixos.default
|
||||
];
|
||||
};
|
||||
tahina = nixpkgs.lib.nixosSystem {
|
||||
tahina = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = niveumSpecialArgs system;
|
||||
modules = [
|
||||
systems/tahina/configuration.nix
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
];
|
||||
};
|
||||
tabula = nixpkgs.lib.nixosSystem {
|
||||
tabula = nixpkgs.lib.nixosSystem rec {
|
||||
system = "x86_64-linux";
|
||||
specialArgs = niveumSpecialArgs system;
|
||||
modules = [
|
||||
systems/tabula/configuration.nix
|
||||
agenix.nixosModules.default
|
||||
@@ -252,7 +283,7 @@
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
home-manager.nixosModules.home-manager
|
||||
nur.nixosModules.nur
|
||||
nur.modules.nixos.default
|
||||
stylix.nixosModules.stylix
|
||||
];
|
||||
};
|
||||
@@ -264,7 +295,7 @@
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
home-manager.nixosModules.home-manager
|
||||
nur.nixosModules.nur
|
||||
nur.modules.nixos.default
|
||||
stylix.nixosModules.stylix
|
||||
];
|
||||
};
|
||||
@@ -276,7 +307,7 @@
|
||||
agenix.nixosModules.default
|
||||
retiolum.nixosModules.retiolum
|
||||
home-manager.nixosModules.home-manager
|
||||
nur.nixosModules.nur
|
||||
nur.modules.nixos.default
|
||||
stylix.nixosModules.stylix
|
||||
];
|
||||
};
|
||||
@@ -286,10 +317,10 @@
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [
|
||||
nur.overlay
|
||||
nur.overlays.default
|
||||
(self: super: {
|
||||
mpv = super.mpv.override {scripts = [inputs.self.packages.${system}.mpv-visualizer super.mpvScripts.mpris];};
|
||||
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
|
||||
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.wofi}/bin/wofi --dmenu "$@"'';
|
||||
})
|
||||
];
|
||||
};
|
||||
@@ -306,9 +337,11 @@
|
||||
packages = rec {
|
||||
auc = pkgs.callPackage packages/auc.nix {};
|
||||
betacode = pkgs.callPackage packages/betacode.nix {};
|
||||
brainmelter = pkgs.callPackage packages/brainmelter.nix {};
|
||||
brassica = pkgs.callPackage packages/brassica.nix {};
|
||||
cheat-sh = pkgs.callPackage packages/cheat-sh.nix {};
|
||||
closest = pkgs.callPackage packages/closest {};
|
||||
cro = pkgs.callPackage packages/cro.nix {};
|
||||
cyberlocker-tools = pkgs.callPackage packages/cyberlocker-tools.nix {};
|
||||
default-gateway = pkgs.callPackage packages/default-gateway.nix {};
|
||||
depp = pkgs.callPackage packages/depp.nix {};
|
||||
@@ -351,6 +384,7 @@
|
||||
manual-sort = pkgs.callPackage packages/manual-sort.nix {};
|
||||
menu-calc = pkgs.callPackage packages/menu-calc.nix {};
|
||||
meteo = pkgs.callPackage packages/meteo.nix {};
|
||||
noise-waves = pkgs.callPackage packages/noise-waves.nix {};
|
||||
mpv-radio = pkgs.callPackage packages/mpv-radio.nix {di-fm-key-file = "/dev/null";};
|
||||
mpv-tuner = pkgs.callPackage packages/mpv-tuner.nix {di-fm-key-file = "/dev/null";};
|
||||
mpv-tv = pkgs.callPackage packages/mpv-tv.nix {};
|
||||
@@ -363,13 +397,17 @@
|
||||
opustags = pkgs.callPackage packages/opustags.nix {};
|
||||
pls = pkgs.callPackage packages/pls.nix {};
|
||||
polyglot = pkgs.callPackage packages/polyglot.nix {};
|
||||
q = pkgs.callPackage packages/q.nix {};
|
||||
qrpaste = pkgs.callPackage packages/qrpaste.nix {};
|
||||
random-zeno = pkgs.callPackage packages/random-zeno.nix {};
|
||||
rfc = pkgs.callPackage packages/rfc.nix {};
|
||||
gimp = pkgs.callPackage packages/gimp.nix {};
|
||||
scanned = pkgs.callPackage packages/scanned.nix {};
|
||||
swallow = pkgs.callPackage packages/swallow.nix {};
|
||||
text2pdf = pkgs.callPackage packages/text2pdf.nix {};
|
||||
timer = pkgs.callPackage packages/timer.nix {};
|
||||
tocharian-font = pkgs.callPackage packages/tocharian-font.nix {};
|
||||
passmenu = pkgs.callPackage packages/passmenu.nix {};
|
||||
trans = pkgs.callPackage packages/trans.nix {};
|
||||
ttspaste = pkgs.callPackage packages/ttspaste.nix {};
|
||||
unicodmenu = pkgs.callPackage packages/unicodmenu.nix {};
|
||||
@@ -378,6 +416,7 @@
|
||||
vg = pkgs.callPackage packages/vg.nix {};
|
||||
vim = pkgs.callPackage packages/vim.nix {niveumPackages = self.packages.${system};};
|
||||
obsidian-vim = pkgs.callPackage packages/obsidian-vim.nix {};
|
||||
radio-news = pkgs.callPackage packages/radio-news.nix {};
|
||||
vimPlugins-cheat-sh-vim = pkgs.callPackage packages/vimPlugins/cheat-sh.nix {};
|
||||
vimPlugins-icalendar-vim = pkgs.callPackage packages/vimPlugins/icalendar-vim.nix {};
|
||||
vimPlugins-jq-vim = pkgs.callPackage packages/vimPlugins/jq-vim.nix {};
|
||||
|
||||
@@ -45,11 +45,11 @@
|
||||
theme = pkgs: {
|
||||
gtk = {
|
||||
name = "Adwaita-dark";
|
||||
package = pkgs.gnome.gnome-themes-extra;
|
||||
package = pkgs.gnome-themes-extra;
|
||||
};
|
||||
icon = {
|
||||
name = "Adwaita";
|
||||
package = pkgs.gnome.adwaita-icon-theme;
|
||||
package = pkgs.adwaita-icon-theme;
|
||||
};
|
||||
cursor = {
|
||||
name = "capitaine-cursors-white";
|
||||
|
||||
@@ -13,6 +13,9 @@ include "%L"
|
||||
<Multi_key> <E> <E> : "ɛ" U025B
|
||||
<Multi_key> <O> <O> : "ɔ" U0254
|
||||
<Multi_key> <s> <h> : "ʃ" U0283
|
||||
<Multi_key> <g> <h> : "ɣ" U0283
|
||||
<Multi_key> <b> <h> : "β" U0283
|
||||
<Multi_key> <p> <h> : "ɸ" U0283
|
||||
<Multi_key> <z> <h> : "ʒ" U0292
|
||||
<Multi_key> <e> <i> : "ɪ" U026A
|
||||
<Multi_key> <e> <u> : "ʊ" U028A
|
||||
|
||||
114
lib/keyboards/farsi
Normal file
114
lib/keyboards/farsi
Normal file
@@ -0,0 +1,114 @@
|
||||
// https://github.com/gpuminingir/Farsi-Phonetic-Keyboard-Linux
|
||||
// by @gpuminingir
|
||||
|
||||
partial alphanumeric_keys
|
||||
xkb_symbols "qwerty" {
|
||||
// Classic Finnish keyboard layout without dead keys and {[]} on asdf + AltG
|
||||
name[Group1]="Persian (QWERTY)";
|
||||
include "ir(pesq_part_basic)"
|
||||
include "ir(pesq_part_ext)"
|
||||
include "ir(pesq_part_keypad)"
|
||||
include "nbsp(zwnj2nb3nnb4)"
|
||||
include "level3(ralt_switch)"
|
||||
};
|
||||
|
||||
hidden partial alphanumeric_keys
|
||||
xkb_symbols "pesq_part_basic" {
|
||||
// Persian digits
|
||||
key <AE01> { [ Arabic_1, exclam, exclam ] }; // ١ ! !
|
||||
key <AE02> { [ Arabic_2, at, at ] }; // ٢ @ @
|
||||
key <AE03> { [ Arabic_3, numbersign, numbersign ] }; // ٣ # #
|
||||
key <AE04> { [ Farsi_4, dollar, dollar ] }; // ۴ $ $
|
||||
key <AE05> { [ Farsi_5, percent, percent ] }; // ۵ % %
|
||||
key <AE06> { [ Farsi_6, asciicircum, asciicircum ] }; // ۶ ^ ^
|
||||
key <AE07> { [ Arabic_7, ampersand, ampersand ] }; // ٧ & &
|
||||
key <AE08> { [ Arabic_8, KP_Multiply, KP_Multiply ] }; // ٨ * *
|
||||
key <AE09> { [ Arabic_9, Armenian_parenright, Armenian_parenright, Armenian_parenleft ] }; // ٩ ) ) (
|
||||
key <AE10> { [ Farsi_0, Armenian_parenleft, Armenian_parenleft ] }; // ۰ ( (
|
||||
key <AE11> { [ underbar, KP_Subtract, KP_Subtract ] }; // _ – –
|
||||
key <AE12> { [ KP_Equal, KP_Add, KP_Add ] }; // = + +
|
||||
|
||||
// Persian letters and symbols
|
||||
key <AD01> { [ Arabic_qaf, Arabic_ghain ] }; // ق غ
|
||||
key <AD02> { [ Arabic_sheen ] }; // ش
|
||||
key <AD03> { [ Arabic_ain ] }; // ع
|
||||
key <AD04> { [ Arabic_ra ] }; // ر
|
||||
key <AD05> { [ Arabic_teh, Arabic_tah ] }; // ت ط
|
||||
key <AD06> { [ Farsi_yeh ] }; // ى
|
||||
key <AD07> { [ Arabic_waw ] }; // و
|
||||
key <AD08> { [ Farsi_yeh ] }; // ى
|
||||
key <AD09> { [ Arabic_waw ] }; // و
|
||||
key <AD10> { [ Arabic_peh ] }; // پ
|
||||
key <AD11> { [ bracketright, braceleft ] }; // ] } {
|
||||
key <AD12> { [ bracketleft, braceright ] }; // [ { }
|
||||
|
||||
key <AC01> { [ Arabic_alef, Arabic_maddaonalef, Arabic_maddaonalef ] }; // ا آ آ
|
||||
key <AC02> { [ Arabic_seen, Arabic_sad, Arabic_sheen, Arabic_sheen ] }; // س ص ش
|
||||
key <AC03> { [ Arabic_dal, Arabic_thal ] }; // د ذ ذ
|
||||
key <AC04> { [ Arabic_feh ] }; // ف
|
||||
key <AC05> { [ Arabic_gaf, Arabic_ghain ] }; // گ
|
||||
key <AC06> { [ Arabic_heh, Arabic_hah ] }; // ە ح ه
|
||||
key <AC07> { [ Arabic_jeem, Arabic_jeh ] }; // ج ژ ژ
|
||||
key <AC08> { [ Arabic_keheh ] }; // ک
|
||||
key <AC09> { [ Arabic_lam ] }; // ل
|
||||
key <AC10> { [ Arabic_semicolon, colon ] }; // ؛ : ։
|
||||
key <AC11> { [ Arabic_comma, quotedbl, quotedbl ] }; // ، ” ”
|
||||
|
||||
key <AB01> { [ Arabic_zain, Arabic_dad, Arabic_zah, Arabic_zah ] }; // ض ض ز خ
|
||||
key <AB02> { [ Arabic_khah, Arabic_zah ] }; // ظ خ
|
||||
key <AB03> { [ Arabic_theh, Arabic_tcheh ] }; // چ ث
|
||||
key <AB04> { [ Arabic_hamza, Arabic_waw ] }; // و
|
||||
key <AB05> { [ Arabic_beh ] }; // ب
|
||||
key <AB06> { [ Arabic_noon ] }; // ن
|
||||
key <AB07> { [ Arabic_meem ] }; // م
|
||||
key <AB08> { [ Arabic_comma, rightcaret, leftcaret ] }; // , > <
|
||||
key <AB09> { [ period, leftcaret, rightcaret ] }; // . < >
|
||||
key <AB10> { [ slash, Arabic_question_mark, question ] }; // / ?
|
||||
|
||||
key <AE11> { [ minus, underscore ] };
|
||||
key <AE12> { [ equal, plus, 0x1002212 ] };
|
||||
key <BKSL> { [ backslash, bar, 0x1002010 ] };
|
||||
key <TLDE> { [ U02DC, UFDFC, UFDF2 ] }; // ˜ ﷼ ﷲ
|
||||
};
|
||||
|
||||
hidden partial alphanumeric_keys
|
||||
xkb_symbols "pesq_part_ext" {
|
||||
// Persian and ASCII digits
|
||||
key <AE01> { [ Farsi_1, exclam, grave, 1 ] };
|
||||
key <AE02> { [ Farsi_2, 0x100066c, at, 2 ] };
|
||||
key <AE03> { [ Farsi_3, 0x100066b, numbersign, 3 ] };
|
||||
key <AE04> { [ Farsi_4, 0x100fdfc, dollar, 4 ] };
|
||||
key <AE05> { [ Farsi_5, 0x100066a, percent, 5 ] };
|
||||
key <AE06> { [ Farsi_6, multiply, asciicircum, 6 ] };
|
||||
key <AE07> { [ Farsi_7, Arabic_comma, ampersand, 7 ] };
|
||||
key <AE08> { [ Farsi_8, asterisk, enfilledcircbullet, 8 ] };
|
||||
key <AE09> { [ Farsi_9, parenright, 0x100200e, 9 ] };
|
||||
key <AE10> { [ Farsi_0, parenleft, 0x100200f, 0 ] };
|
||||
};
|
||||
|
||||
hidden partial alphanumeric_keys
|
||||
xkb_symbols "pesq_part_keypad" {
|
||||
// Persian digits and Mathematical operators
|
||||
key <KPDV> { [ division, XF86_Ungrab ] };
|
||||
key <KPMU> { [ multiply, XF86_ClearGrab ] };
|
||||
key <KPSU> { [ 0x1002212, XF86_Prev_VMode ] };
|
||||
key <KPAD> { [ plus, XF86_Next_VMode ] };
|
||||
|
||||
key <KPEN> { [ KP_Enter ] };
|
||||
key <KPEQ> { [ equal ] };
|
||||
|
||||
key <KP7> { [ KP_Home, Farsi_7 ] };
|
||||
key <KP8> { [ KP_Up, Farsi_8 ] };
|
||||
key <KP9> { [ KP_Prior, Farsi_9 ] };
|
||||
|
||||
key <KP4> { [ KP_Left, Farsi_4 ] };
|
||||
key <KP5> { [ KP_Begin, Farsi_5 ] };
|
||||
key <KP6> { [ KP_Right, Farsi_6 ] };
|
||||
|
||||
key <KP1> { [ KP_End, Farsi_1 ] };
|
||||
key <KP2> { [ KP_Down, Farsi_2 ] };
|
||||
key <KP3> { [ KP_Next, Farsi_3 ] };
|
||||
|
||||
key <KP0> { [ KP_Insert, Farsi_0 ] };
|
||||
key <KPDL> { [ KP_Delete, 0x100066b ] };
|
||||
};
|
||||
8
lib/mycelium-network.nix
Normal file
8
lib/mycelium-network.nix
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
zaatar = "5c5:49e0:7793:f017:59e1:1715:9e0e:3fc8";
|
||||
fatteh = "463:a0d4:daa3:aa8d:a9b1:744a:46a5:7a80";
|
||||
ful = "5bf:d60e:bebf:5163:f495:8787:880c:6d41";
|
||||
kabsa = "432:e30:d5d8:9311:e34b:6587:96ee:3fcb";
|
||||
makanek = "43f:ad4f:fa67:d9f7:8a56:713c:7418:164b";
|
||||
manakish = "512:d3bd:3cd9:fcc8:ae34:81fa:385f:8c21";
|
||||
}
|
||||
@@ -2,7 +2,6 @@
|
||||
pkgs,
|
||||
lib,
|
||||
niveumPackages,
|
||||
config,
|
||||
...
|
||||
}: {
|
||||
# watcher scripts
|
||||
@@ -37,7 +36,7 @@
|
||||
then "2"
|
||||
else "3"
|
||||
}s/^/${messagePrefix}/p" \
|
||||
| ${config.nur.repos.mic92.ircsink}/bin/ircsink \
|
||||
| ${pkgs.nur.repos.mic92.ircsink}/bin/ircsink \
|
||||
--nick ${nick} \
|
||||
--server ${server} \
|
||||
--target ${target}
|
||||
|
||||
@@ -18,6 +18,7 @@ let
|
||||
dnb = "dnb";
|
||||
dubstep = "dubstep";
|
||||
french = "france";
|
||||
hebrew = "hebrew";
|
||||
geschepper = "geschepper";
|
||||
greek = "greece";
|
||||
greenlandic = "greenland";
|
||||
@@ -118,7 +119,7 @@ let
|
||||
in
|
||||
[
|
||||
{
|
||||
stream = "http://lassul.us:8000/radio.ogg";
|
||||
stream = "http://radio.lassul.us/radio.opus";
|
||||
station = "Radio lassulus";
|
||||
logo = "http://lassul.us/art/portraits/selbstportrait.jpg";
|
||||
desc = "Diminutive from lassus (“weary, faint, tired”). A programming human. Doing superior professional art.";
|
||||
@@ -151,7 +152,7 @@ in
|
||||
{
|
||||
stream = "http://stream.freiesradio.org:8000/live.mp3";
|
||||
station = "Freies Radio Kassel";
|
||||
description = "Gesellschaft zur drahtlosen Belehrung und Erbauung";
|
||||
desc = "Gesellschaft zur drahtlosen Belehrung und Erbauung";
|
||||
}
|
||||
{
|
||||
stream = "http://162.244.80.20:6948";
|
||||
@@ -161,7 +162,7 @@ in
|
||||
tags = [tags.jazz];
|
||||
}
|
||||
{
|
||||
stream = "https://stream1.mfm.plexpark.com/radio/8000/simulcast-berlin-sd-64.aac";
|
||||
stream = "https://metropol-fm.api.radiosphere.io/channels/MetropolFM/stream.aac?quality=4";
|
||||
station = "Metropol FM Berlin";
|
||||
logo = "https://www.metropolfm.de/wp-content/uploads/2017/04/berlin.png";
|
||||
tags = [tags.berlin tags.turkish];
|
||||
@@ -184,6 +185,12 @@ in
|
||||
logo = "https://www.metropolfm.de/wp-content/uploads/2017/04/berlin.png";
|
||||
tags = [tags.turkish];
|
||||
}
|
||||
{
|
||||
station = "Ancient FM";
|
||||
stream = "https://mediaserv73.live-streams.nl:18058/stream";
|
||||
desc = " Music of the Mediæval and Renaissance";
|
||||
tags = [tags.trad];
|
||||
}
|
||||
{
|
||||
stream = "http://rb-stream.de:8000/rrb_128.mp3";
|
||||
station = "Radio Golos Berlina";
|
||||
@@ -1547,6 +1554,11 @@ in
|
||||
desc = "Ohne Blatt vor dem Mund! Für alle, die aufwachen wollen.";
|
||||
tags = [tags.text];
|
||||
}
|
||||
{
|
||||
station = "Kontrafunk";
|
||||
stream = "https://icecast.multhielemedia.de/listen/kontrafunk/radio.mp3";
|
||||
tags = [tags.text];
|
||||
}
|
||||
{
|
||||
logo = "http://www.beatlesradio.com/content/images/thumbs/0000587.gif";
|
||||
station = "Beatles Radio";
|
||||
@@ -1729,6 +1741,10 @@ in
|
||||
desc = "... einfach gute Laune!";
|
||||
tags = [tags.schlager];
|
||||
}
|
||||
{
|
||||
stream = "https://ifiye.tv/radio/8000/radio.mp3";
|
||||
station = "Ifiye Radio";
|
||||
}
|
||||
{
|
||||
stream = paloma "RP-Fresh";
|
||||
station = paloma-name "Fresh";
|
||||
@@ -1810,6 +1826,26 @@ in
|
||||
stream = "http://lyd.nrk.no/nrk_radio_jazz_aac_h";
|
||||
tags = [tags.jazz];
|
||||
}
|
||||
{
|
||||
station = "Sham FM";
|
||||
stream = "https://radioshamfm.grtvstream.com:8400/stream";
|
||||
tags = [tags.arabic];
|
||||
}
|
||||
{
|
||||
station = "Sky News Arabia";
|
||||
stream = "https://radio.skynewsarabia.com/stream/radio/skynewsarabia";
|
||||
tags = [tags.arabic];
|
||||
}
|
||||
{
|
||||
station = "KAN Kol HaMusika";
|
||||
stream = "http://kanliveicy.media.kan.org.il/icy/kankolhamusica_mp3";
|
||||
tags = [tags.classical tags.hebrew];
|
||||
}
|
||||
{
|
||||
station = "KAN 88";
|
||||
stream = "https://playerservices.streamtheworld.com/api/livestream-redirect/KAN_88.mp3";
|
||||
tags = [tags.hebrew];
|
||||
}
|
||||
{
|
||||
station = "Digital Impulse – Classical Channel";
|
||||
stream = "http://orion.shoutca.st:8978/stream";
|
||||
@@ -1955,6 +1991,11 @@ in
|
||||
stream = "http://162.244.81.30:8224/;";
|
||||
station = "Quran Radio Lebanon";
|
||||
}
|
||||
{
|
||||
tags = [tags.arabic tags.text tags.holy];
|
||||
stream = "http://tijaniyyah.asuscomm.com:8000/stream/2/";
|
||||
station = "Quran Radio Sudan";
|
||||
}
|
||||
{
|
||||
tags = [tags.arabic tags.text tags.holy];
|
||||
station = "Coptic for God";
|
||||
@@ -1984,6 +2025,10 @@ in
|
||||
stream = "http://mp3.ffh.de/radioffh/hqlivestream.mp3";
|
||||
station = "Hitradio FFH";
|
||||
}
|
||||
{ # Lex Fridman's favourite
|
||||
stream = "av://lavfi:anoisesrc=color=brown";
|
||||
station = "Brownian noise";
|
||||
}
|
||||
]
|
||||
++ map (name: {
|
||||
stream = "https://${name}.stream.publicradio.org/${name}.aac";
|
||||
|
||||
175
lib/style.css
Normal file
175
lib/style.css
Normal file
@@ -0,0 +1,175 @@
|
||||
* {
|
||||
font-size: 14px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
/* `otf-font-awesome` is required to be installed for icons */
|
||||
font-family: FontAwesome, monospace;
|
||||
background-color: transparent;
|
||||
border-bottom: 0px;
|
||||
color: #ebdbb2;
|
||||
transition-property: background-color;
|
||||
transition-duration: .5s;
|
||||
}
|
||||
|
||||
window#waybar.hidden {
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
window#waybar.empty #window {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/*
|
||||
window#waybar.empty {
|
||||
background-color: transparent;
|
||||
}
|
||||
window#waybar.solo {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
*/
|
||||
|
||||
.modules-right {
|
||||
margin: 10px 10px 0 0;
|
||||
}
|
||||
.modules-center {
|
||||
margin: 10px 0 0 0;
|
||||
}
|
||||
.modules-left {
|
||||
margin: 10px 0 0 10px;
|
||||
}
|
||||
|
||||
button {
|
||||
/* Use box-shadow instead of border so the text isn't offset */
|
||||
/* box-shadow: inset 0 -3px transparent; */
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* https://github.com/Alexays/Waybar/wiki/FAQ#the-workspace-buttons-have-a-strange-hover-effect */
|
||||
/*
|
||||
button:hover {
|
||||
background: inherit;
|
||||
box-shadow: inset 0 -3px #ebdbb2;
|
||||
} */
|
||||
|
||||
#workspaces {
|
||||
background-color: #282828;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 0 5px;
|
||||
background-color: transparent;
|
||||
color: #ebdbb2;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
#workspaces button:first-child {
|
||||
border-radius: 5px 0 0 5px;
|
||||
}
|
||||
|
||||
#workspaces button:last-child {
|
||||
border-radius: 0 5px 5px 0;
|
||||
}
|
||||
|
||||
#workspaces button:hover {
|
||||
color: #d79921;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
background-color: #665c54;
|
||||
/* box-shadow: inset 0 -3px #ffffff; */
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
background-color: #b16286;
|
||||
}
|
||||
|
||||
#idle_inhibitor,
|
||||
#cava,
|
||||
#scratchpad,
|
||||
#mode,
|
||||
#window,
|
||||
#clock,
|
||||
#battery,
|
||||
#backlight,
|
||||
#wireplumber,
|
||||
#tray,
|
||||
#mpris,
|
||||
#load {
|
||||
padding: 0 10px;
|
||||
background-color: #282828;
|
||||
color: #ebdbb2;
|
||||
}
|
||||
|
||||
#mode {
|
||||
background-color: #689d6a;
|
||||
color: #282828;
|
||||
/* box-shadow: inset 0 -3px #ffffff; */
|
||||
}
|
||||
|
||||
/* If workspaces is the leftmost module, omit left margin */
|
||||
.modules-left > widget:first-child > #workspaces {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
/* If workspaces is the rightmost module, omit right margin */
|
||||
.modules-right > widget:last-child > #workspaces {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#cava {
|
||||
padding: 0 5px;
|
||||
}
|
||||
|
||||
#battery.charging, #battery.plugged {
|
||||
background-color: #98971a;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
to {
|
||||
background-color: #282828;
|
||||
color: #ebdbb2;
|
||||
}
|
||||
}
|
||||
|
||||
/* Using steps() instead of linear as a timing function to limit cpu usage */
|
||||
#battery.critical:not(.charging) {
|
||||
background-color: #cc241d;
|
||||
color: #ebdbb2;
|
||||
animation-name: blink;
|
||||
animation-duration: 0.5s;
|
||||
animation-timing-function: steps(12);
|
||||
animation-iteration-count: infinite;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
|
||||
label:focus {
|
||||
background-color: #000000;
|
||||
}
|
||||
|
||||
#wireplumber.muted {
|
||||
background-color: #458588;
|
||||
}
|
||||
|
||||
#tray > .passive {
|
||||
-gtk-icon-effect: dim;
|
||||
}
|
||||
|
||||
#tray > .needs-attention {
|
||||
-gtk-icon-effect: highlight;
|
||||
}
|
||||
|
||||
#mpris.playing {
|
||||
background-color: #d79921;
|
||||
color: #282828;
|
||||
}
|
||||
|
||||
#tray menu {
|
||||
font-family: sans-serif;
|
||||
}
|
||||
|
||||
#scratchpad.empty {
|
||||
background: transparent;
|
||||
}
|
||||
@@ -88,10 +88,10 @@ local lsp_flags = {
|
||||
local language_servers = {
|
||||
clangd = {},
|
||||
pyright = {}, -- pyright
|
||||
tsserver = {}, -- typescript-language-server
|
||||
-- tsserver = {}, -- typescript-language-server
|
||||
cssls = {},
|
||||
elmls = {}, -- elm-language-server
|
||||
-- denols = {}, -- deno built in
|
||||
denols = {}, -- deno built in
|
||||
bashls = {}, -- bash-language-server
|
||||
lua_ls = {
|
||||
Lua = {
|
||||
@@ -112,12 +112,19 @@ local language_servers = {
|
||||
hls = {}, -- haskell-language-server
|
||||
html = {}, -- vscode-langservers-extracted
|
||||
jsonls = {}, -- vscode-langservers-extracted
|
||||
nil_ls = {}, -- github:oxalica/nil
|
||||
lemminx = {}, -- lemminx (for xml)
|
||||
nil_ls = {
|
||||
['nil'] = {
|
||||
formatting = {
|
||||
command = { "nixfmt" },
|
||||
},
|
||||
},
|
||||
}, -- github:oxalica/nil
|
||||
dhall_lsp_server = {}, -- dhall-lsp-server
|
||||
-- rnix = {}, -- rnix-lsp
|
||||
jqls = {}, -- jq-lsp
|
||||
rust_analyzer = { ["rust-analyzer"] = {} },
|
||||
eslint = {},
|
||||
-- eslint = {},
|
||||
-- volar? vls?
|
||||
texlab = {
|
||||
texlab = {
|
||||
|
||||
@@ -3,8 +3,6 @@ vnoremap a= :Tabularize /=<CR>
|
||||
vnoremap a; :Tabularize /::<CR>
|
||||
vnoremap a- :Tabularize /-><CR>
|
||||
|
||||
colorscheme dim
|
||||
|
||||
" noremap <Leader>h :<C-u>split<CR>
|
||||
" noremap <Leader>v :<C-u>vsplit<CR>
|
||||
noremap <Leader>gs :Git<CR>
|
||||
@@ -42,8 +40,6 @@ let g:netrw_banner=0
|
||||
let g:netrw_browse_split=4
|
||||
let g:netrw_altv=1 " open splits to the right
|
||||
let g:netrw_liststyle=3 " tree view
|
||||
let g:netrw_list_hide=netrw_gitignore#Hide()
|
||||
let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+'
|
||||
let g:netrw_winsize = 25
|
||||
|
||||
call matchadd('colorcolumn', '\%101v', 100)
|
||||
|
||||
@@ -5,48 +5,117 @@
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.niveum.telegramBots;
|
||||
cfg = config.niveum.bots;
|
||||
|
||||
botService = name: bot:
|
||||
nameValuePair "telegram-bot-${name}" {
|
||||
nameValuePair "bot-${name}" {
|
||||
enable = bot.enable;
|
||||
startAt = bot.time;
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
LoadCredential = "token:${bot.tokenFile}";
|
||||
LoadCredential = lib.optionals (bot.telegram.enable) [
|
||||
"telegram-token:${bot.telegram.tokenFile}"
|
||||
] ++ lib.optionals (bot.mastodon.enable) [
|
||||
"mastodon-token:${bot.mastodon.tokenFile}"
|
||||
] ++ lib.optionals (bot.matrix.enable) [
|
||||
"matrix-token:${bot.matrix.tokenFile}"
|
||||
];
|
||||
};
|
||||
wants = ["network-online.target"];
|
||||
script = ''
|
||||
export TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")"
|
||||
QUOTE=$(${bot.command})
|
||||
if [ -n "$QUOTE" ]; then
|
||||
echo $QUOTE >&2
|
||||
${strings.concatStringsSep "\n" (map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot''${TOKEN}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.parseMode != null)
|
||||
"-d parse_mode=${bot.parseMode}"
|
||||
} | ${pkgs.jq}/bin/jq -e .ok
|
||||
'')
|
||||
bot.chatIds)}
|
||||
|
||||
${lib.optionalString (bot.matrix.enable) ''
|
||||
export MATRIX_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/matrix-token")"
|
||||
export JSON_PAYLOAD=$(${pkgs.jq}/bin/jq -n --arg msgtype "m.text" --arg body "$QUOTE" '{msgtype: $msgtype, body: $body}')
|
||||
${strings.concatStringsSep "\n" (map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -X POST "https://${bot.matrix.homeserver}/_matrix/client/r0/rooms/${chatId}/send/m.room.message" \
|
||||
-d "$JSON_PAYLOAD" \
|
||||
-H "Authorization: Bearer $MATRIX_TOKEN" \
|
||||
-H "Content-Type: application/json"
|
||||
'') bot.matrix.chatIds)}
|
||||
''}
|
||||
|
||||
${lib.optionalString (bot.mastodon.enable) ''
|
||||
export MASTODON_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/mastodon-token")"
|
||||
${pkgs.curl}/bin/curl -X POST "https://${bot.mastodon.homeserver}/api/v1/statuses" \
|
||||
-H "Authorization: Bearer $MASTODON_TOKEN" \
|
||||
-d status="$QUOTE" \
|
||||
-d "language=${bot.mastodon.language}" \
|
||||
-d "visibility=public"
|
||||
''}
|
||||
|
||||
${lib.optionalString (bot.telegram.enable) ''
|
||||
export TELEGRAM_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/telegram-token")"
|
||||
${strings.concatStringsSep "\n" (map (chatId: ''
|
||||
${pkgs.curl}/bin/curl -X POST "https://api.telegram.org/bot''${TELEGRAM_TOKEN}/sendMessage" \
|
||||
-d chat_id="${chatId}" \
|
||||
-d text="$QUOTE" ${
|
||||
lib.strings.optionalString (bot.telegram.parseMode != null)
|
||||
"-d parse_mode=${bot.telegram.parseMode}"
|
||||
} | ${pkgs.jq}/bin/jq -e .ok
|
||||
'')
|
||||
bot.telegram.chatIds)}
|
||||
''}
|
||||
fi
|
||||
'';
|
||||
};
|
||||
in {
|
||||
options.niveum.telegramBots = mkOption {
|
||||
options.niveum.bots = mkOption {
|
||||
type = types.attrsOf (types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Telegram bot";
|
||||
enable = mkEnableOption "Mastodon and Telegram bot";
|
||||
time = mkOption {type = types.str;};
|
||||
tokenFile = mkOption {type = types.path;};
|
||||
chatIds = mkOption {
|
||||
type = types.listOf (types.strMatching "-?[0-9]+|@[A-Za-z0-9]+");
|
||||
};
|
||||
command = mkOption {type = types.str;};
|
||||
parseMode = mkOption {
|
||||
type = types.nullOr (types.enum ["HTML" "Markdown"]);
|
||||
default = null;
|
||||
matrix = mkOption {
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Posting to Matrix";
|
||||
tokenFile = mkOption {type = types.path;};
|
||||
homeserver = mkOption {
|
||||
type = types.str;
|
||||
};
|
||||
chatIds = mkOption {
|
||||
type = types.listOf types.str;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
mastodon = mkOption {
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Posting to Mastodon";
|
||||
language = mkOption {
|
||||
type = types.str;
|
||||
default = "en";
|
||||
};
|
||||
tokenFile = mkOption {type = types.path;};
|
||||
homeserver = mkOption {
|
||||
type = types.str;
|
||||
default = "social.krebsco.de";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
telegram = mkOption {
|
||||
default = {};
|
||||
type = types.submodule {
|
||||
options = {
|
||||
enable = mkEnableOption "Posting to Telegram";
|
||||
tokenFile = mkOption {type = types.path;};
|
||||
chatIds = mkOption {
|
||||
type = types.listOf (types.strMatching "-?[0-9]+|@[A-Za-z0-9]+");
|
||||
};
|
||||
parseMode = mkOption {
|
||||
type = types.nullOr (types.enum ["HTML" "Markdown"]);
|
||||
default = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
});
|
||||
|
||||
39
packages/brainmelter.nix
Executable file
39
packages/brainmelter.nix
Executable file
@@ -0,0 +1,39 @@
|
||||
{ writers, flite, netcat, gnused, ... }:
|
||||
writers.writeDashBin "brainmelter" ''
|
||||
SERVER="brockman.news"
|
||||
PORT=6667
|
||||
NICK="irccat"
|
||||
USER="irccat"
|
||||
CHANNEL="#all"
|
||||
|
||||
# Open connection to IRC server using a FIFO and netcat
|
||||
FIFO=$(mktemp -u)
|
||||
mkfifo "$FIFO"
|
||||
trap "rm -f $FIFO" EXIT
|
||||
|
||||
# Send IRC commands
|
||||
{
|
||||
echo "NICK $NICK"
|
||||
echo "USER $USER 0 * :$USER"
|
||||
sleep 5
|
||||
echo "JOIN $CHANNEL"
|
||||
while true; do
|
||||
sleep 30
|
||||
echo "PING :keepalive"
|
||||
done
|
||||
} > "$FIFO" &
|
||||
|
||||
# Read from server and write to stdout
|
||||
${netcat}/bin/nc "$SERVER" "$PORT" < "$FIFO" | while IFS= read -r line; do
|
||||
voice="$(echo -e "awb\nkal\nrms\nslt" | shuf -n1)"
|
||||
echo "$line" \
|
||||
| ${gnused}/bin/sed -n 's/.*go.brockman.news\/\S\+ //p' \
|
||||
| tee /dev/stderr \
|
||||
| ${flite}/bin/flite -voice "$voice"
|
||||
# Respond to PINGs to avoid timeout
|
||||
if [ "$line" = PING* ]; then
|
||||
server_ping=$(echo "$line" | cut -d':' -f2)
|
||||
echo "PONG :$server_ping" > "$FIFO"
|
||||
fi
|
||||
done
|
||||
''
|
||||
10
packages/cro.nix
Normal file
10
packages/cro.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ writers, chromium }:
|
||||
writers.writeDashBin "cro" ''
|
||||
${chromium}/bin/chromium \
|
||||
--disable-sync \
|
||||
--no-default-browser-check \
|
||||
--no-first-run \
|
||||
--user-data-dir="$(mktemp -d)" \
|
||||
--incognito \
|
||||
"$@"
|
||||
''
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
writers,
|
||||
formats,
|
||||
acpi,
|
||||
wtf,
|
||||
himalaya,
|
||||
lib,
|
||||
@@ -34,32 +35,33 @@
|
||||
cmd = "${khal}/bin/khal";
|
||||
args = ["--color" "list" "--exclude-calendar" "calendarium-tridentinum"];
|
||||
refreshInterval = "1m";
|
||||
position = rec {
|
||||
top = 0;
|
||||
left = columnCount - width + 1;
|
||||
height = rowCount - mods.vdir_todo.position.height;
|
||||
width = 1;
|
||||
position = {
|
||||
top = 4;
|
||||
left = 0;
|
||||
height = 4;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.vdir_todo = command {
|
||||
enabled = true;
|
||||
title = "Agenda";
|
||||
cmd = writers.writeDash "vdir_todo" "${todoman}/bin/todo --color=always -h | ${coreutils}/bin/tac";
|
||||
refreshInterval = "1m";
|
||||
position = {
|
||||
top = 8;
|
||||
left = 0;
|
||||
height = 2;
|
||||
width = columnCount + 1;
|
||||
top = 4;
|
||||
left = 2;
|
||||
height = 4;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.weather = {
|
||||
enabled = true;
|
||||
cityids = weatherCityIds;
|
||||
position = {
|
||||
top = 6;
|
||||
top = 8;
|
||||
left = 2;
|
||||
height = 2;
|
||||
width = 1;
|
||||
width = 2;
|
||||
};
|
||||
refreshInterval = "15m";
|
||||
language = "DE";
|
||||
@@ -67,48 +69,26 @@
|
||||
useEmoji = true;
|
||||
compact = true;
|
||||
};
|
||||
mods.btc = command {
|
||||
title = "BTC";
|
||||
cmd = writers.writeDash "btc" "${curl}/bin/curl -sSL https://rate.sx/BTC | ${gnused}/bin/sed -n '34,36p'";
|
||||
refreshInterval = "1h";
|
||||
position = {
|
||||
top = 6;
|
||||
left = 0;
|
||||
height = 1;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.xmr = command {
|
||||
title = "XMR";
|
||||
cmd = writers.writeDash "xmr" "${curl}/bin/curl -sSL https://rate.sx/XMR | ${gnused}/bin/sed -n '34,36p'";
|
||||
refreshInterval = "1h";
|
||||
position = {
|
||||
top = 7;
|
||||
left = 0;
|
||||
height = 1;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.top = command {
|
||||
title = "uptime";
|
||||
cmd = writers.writeDash "top" "top -b -n 1 -E g | ${gnused}/bin/sed -n '1,5p'";
|
||||
refreshInterval = "30s";
|
||||
position = {
|
||||
top = 0;
|
||||
left = 0;
|
||||
top = 4;
|
||||
left = 4;
|
||||
height = 2;
|
||||
width = 3;
|
||||
width = 2;
|
||||
};
|
||||
enabled = false;
|
||||
enabled = true;
|
||||
};
|
||||
mods.resourceusage = {
|
||||
enabled = true;
|
||||
cpuCombined = false;
|
||||
position = {
|
||||
top = 0;
|
||||
left = 0;
|
||||
top = 6;
|
||||
left = 4;
|
||||
height = 2;
|
||||
width = 1;
|
||||
width = 2;
|
||||
};
|
||||
refreshInterval = "1s";
|
||||
showCPU = true;
|
||||
@@ -116,7 +96,7 @@
|
||||
showSwp = false;
|
||||
};
|
||||
mods.ipapi = {
|
||||
enabled = true;
|
||||
enabled = false;
|
||||
position = {
|
||||
top = 0;
|
||||
left = 1;
|
||||
@@ -125,14 +105,27 @@
|
||||
};
|
||||
refreshInterval = "150s";
|
||||
};
|
||||
mods.battery-status = command {
|
||||
enabled = true;
|
||||
cmd = writers.writeDash "battery-status" ''
|
||||
${acpi}/bin/acpi --battery --details | sed 's/^Battery //'
|
||||
'';
|
||||
refreshInterval = "1m";
|
||||
position = {
|
||||
top = 8;
|
||||
left = 4;
|
||||
height = 2;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.disk-usage = command {
|
||||
enabled = false;
|
||||
cmd = "df";
|
||||
args = ["-h"];
|
||||
refreshInterval = "1m";
|
||||
position = {
|
||||
top = 2;
|
||||
left = 1;
|
||||
top = 8;
|
||||
left = 4;
|
||||
height = 2;
|
||||
width = 2;
|
||||
};
|
||||
@@ -153,10 +146,10 @@
|
||||
'';
|
||||
refreshInterval = "5m";
|
||||
position = {
|
||||
top = 2;
|
||||
top = 0;
|
||||
left = 0;
|
||||
height = 4;
|
||||
width = 3;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.gh-status = command {
|
||||
@@ -168,10 +161,25 @@
|
||||
'';
|
||||
refreshInterval = "5m";
|
||||
position = {
|
||||
top = 4;
|
||||
left = 3;
|
||||
top = 0;
|
||||
left = 2;
|
||||
height = 2;
|
||||
width = 3;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.gh-issues = command {
|
||||
enabled = true;
|
||||
title = "GitHub";
|
||||
cmd = writers.writeDash "gh-issues" ''
|
||||
${gh}/bin/gh api issues \
|
||||
| ${jq}/bin/jq -r 'map(select(.repository.owner.login == "kmein") | "\u001b[35m\(.repository.name)\u001b[0m \(.title)") | join("\n")'
|
||||
'';
|
||||
refreshInterval = "5m";
|
||||
position = {
|
||||
top = 2;
|
||||
left = 2;
|
||||
height = 2;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.calendar = command {
|
||||
@@ -181,10 +189,10 @@
|
||||
pty = true;
|
||||
refreshInterval = "5m";
|
||||
position = {
|
||||
top = 6;
|
||||
left = 3;
|
||||
top = 8;
|
||||
left = 0;
|
||||
height = 2;
|
||||
width = 3;
|
||||
width = 2;
|
||||
};
|
||||
};
|
||||
mods.astro-aspects = command {
|
||||
@@ -200,6 +208,7 @@
|
||||
};
|
||||
};
|
||||
mods.feed = command {
|
||||
enabled = true;
|
||||
title = "Feed";
|
||||
cmd = writers.writeDash "feed" ''
|
||||
${curl}/bin/curl -u "$WTF_MINIFLUX_API_KEY" --basic -s 'https://feed.kmein.de/v1/entries?status=unread&direction=desc' \
|
||||
@@ -213,9 +222,9 @@
|
||||
# position = { top = 0; left = 5; height = 5; width = 1; };
|
||||
position = {
|
||||
top = 0;
|
||||
left = 3;
|
||||
left = 4;
|
||||
height = 4;
|
||||
width = 3;
|
||||
width = 2;
|
||||
};
|
||||
refreshInterval = "15m";
|
||||
};
|
||||
|
||||
20
packages/gimp.nix
Normal file
20
packages/gimp.nix
Normal file
@@ -0,0 +1,20 @@
|
||||
{ gimp, fetchurl, runCommand, symlinkJoin, writers }:
|
||||
let
|
||||
bring-out-the-gimp = fetchurl {
|
||||
url = "https://c.krebsco.de/bring-out-the-gimp.png";
|
||||
hash = "sha256-k42M5j58OzbcMJwx9CeM2mD2VsVwPKHwJvU55+Rkowc=";
|
||||
};
|
||||
data-dir-prefix = "share/gimp/2.0";
|
||||
data-dir = symlinkJoin {
|
||||
name = "gimp";
|
||||
paths = [
|
||||
(runCommand "splash" {} ''
|
||||
mkdir -p $out/${data-dir-prefix}/images
|
||||
install ${bring-out-the-gimp} $out/share/gimp/2.0/images/gimp-splash.png
|
||||
'')
|
||||
gimp
|
||||
];
|
||||
};
|
||||
in writers.writeDashBin "gimp" ''
|
||||
exec env GIMP2_DATADIR=${data-dir}/${data-dir-prefix} ${gimp}/bin/gimp "$@"
|
||||
''
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
writers,
|
||||
fetchurl,
|
||||
xsv,
|
||||
xan,
|
||||
}: let
|
||||
database = fetchurl {
|
||||
url = "http://c.krebsco.de/greek.csv";
|
||||
@@ -9,5 +9,5 @@
|
||||
};
|
||||
in
|
||||
writers.writeDashBin "heuretes" ''
|
||||
${xsv}/bin/xsv search -s simple "^$*$" ${database} | ${xsv}/bin/xsv table
|
||||
${xan}/bin/xan search -s simple "^$*$" ${database} | ${xan}/bin/xan table
|
||||
''
|
||||
|
||||
@@ -51,6 +51,7 @@ XSAMPA_TO_IPA = {
|
||||
"H\\": "\u029C",
|
||||
"I": "\u026A",
|
||||
"J": "\u0272",
|
||||
"J\\": "\u025F",
|
||||
"J\\_<": "\u0284",
|
||||
"K": "\u026C",
|
||||
"K\\": "\u026E",
|
||||
|
||||
@@ -42,14 +42,14 @@ in
|
||||
pkgs.writers.writeDashBin "klem" ''
|
||||
set -efu
|
||||
|
||||
${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -out \
|
||||
${pkgs.wl-clipboard}/bin/wl-paste \
|
||||
| case $(echo "${
|
||||
lib.concatStringsSep "\n" (lib.attrNames cfg.scripts)
|
||||
}" | ${cfg.dmenu}) in
|
||||
${lib.concatStringsSep "\n" (lib.mapAttrsToList scriptCase cfg.scripts)}
|
||||
*) ${pkgs.coreutils}/bin/cat ;;
|
||||
esac \
|
||||
| ${pkgs.xclip}/bin/xclip -selection ${cfg.selection} -in
|
||||
| ${pkgs.wl-clipboard}/bin/wl-copy
|
||||
|
||||
${pkgs.libnotify}/bin/notify-send --app-name="klem" "Result copied to clipboard."
|
||||
''
|
||||
|
||||
@@ -1,19 +1,38 @@
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
xsv,
|
||||
xan,
|
||||
curl,
|
||||
gnused,
|
||||
}:
|
||||
writers.writeDashBin "literature-quote" ''
|
||||
PATH=$PATH:${lib.makeBinPath [xsv curl gnused]}
|
||||
PATH=$PATH:${lib.makeBinPath [xan curl gnused]}
|
||||
ROW=$(curl -Ls http://kmein.github.io/logotheca/quotes.csv | shuf -n1)
|
||||
|
||||
(
|
||||
printf '%s\n\n— %s: _%s_, %s\n' \
|
||||
"$(echo "$ROW" | xsv select 4)" \
|
||||
"$(echo "$ROW" | xsv select 1)" \
|
||||
"$(echo "$ROW" | xsv select 2)" \
|
||||
"$(echo "$ROW" | xsv select 3 | tr : ,)"
|
||||
) | sed 's/ | /\n/g;s/ || /\n\n/g;s/"\(.*\)"/\1/'
|
||||
QUOTE="$(echo "$ROW" | xan select 3)"
|
||||
|
||||
echo "$QUOTE" | sed 's/^"//;s/"$//;s/\s*||\s*/\n\n/g;s/\s*|\s*/\n/g'
|
||||
echo
|
||||
|
||||
AUTHOR="$(echo "$ROW" | xan select 0)"
|
||||
# Prepare the output
|
||||
ATTRIBUTION="($AUTHOR"
|
||||
|
||||
SOURCE="$(echo "$ROW" | xan select 1)"
|
||||
|
||||
# Add SOURCE if it's not empty
|
||||
if [ -n "$SOURCE" ]; then
|
||||
ATTRIBUTION="$ATTRIBUTION: $SOURCE"
|
||||
fi
|
||||
|
||||
LOC="$(echo "$ROW" | xan select 2 | sed 's/""//;s/-/–/g')"
|
||||
# Add LOC if it's not empty
|
||||
if [ -n "$LOC" ]; then
|
||||
ATTRIBUTION="$ATTRIBUTION, $LOC"
|
||||
fi
|
||||
|
||||
ATTRIBUTION="$ATTRIBUTION)"
|
||||
|
||||
echo "$ATTRIBUTION"
|
||||
)
|
||||
''
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
coreutils,
|
||||
gnused,
|
||||
di-fm-key-file,
|
||||
executableName ? "mpv-radio",
|
||||
mpvCommand ? "${mpv}/bin/mpv --force-window=yes"
|
||||
}: let
|
||||
streams = import ../lib/streams.nix {
|
||||
di-fm-key = "%DI_FM_KEY%";
|
||||
@@ -19,11 +21,13 @@
|
||||
}: "${station}\t${desc}\t${stream}")
|
||||
streams);
|
||||
in
|
||||
writers.writeDashBin "mpv-radio" ''
|
||||
writers.writeDashBin executableName ''
|
||||
set -x
|
||||
|
||||
if [ -z ''${DI_FM_KEY} ]; then
|
||||
DI_FM_KEY=$(cat "${di-fm-key-file}")
|
||||
fi
|
||||
exec ${mpv}/bin/mpv --force-window=yes "$(
|
||||
exec ${mpvCommand} "$(
|
||||
${dmenu}/bin/dmenu -i -l 5 < ${streams-tsv} \
|
||||
| ${coreutils}/bin/cut -f3 \
|
||||
| ${gnused}/bin/sed s/%DI_FM_KEY%/"$DI_FM_KEY"/
|
||||
|
||||
@@ -8,13 +8,13 @@
|
||||
'';
|
||||
|
||||
live-tv = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/Free-TV/IPTV/master/playlist.m3u8";
|
||||
hash = "sha256-l8tBwdTWm7l4h/eIHlcflDTgvv6lGMs6Vt7eVMpNLlw=";
|
||||
url = "https://raw.githubusercontent.com/Free-TV/IPTV/39a573d7a428ca1b2ffeec422751a01d37e59e94/playlist.m3u8";
|
||||
hash = "sha256-GBJBJN1AwwtO8HYrD0y3/qPCiK48IXyjt93s6DF/7Yo=";
|
||||
postFetch = m3u-to-tsv;
|
||||
};
|
||||
|
||||
kodi-tv = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/jnk22/kodinerds-iptv/master/iptv/kodi/kodi_tv.m3u";
|
||||
url = "https://raw.githubusercontent.com/jnk22/kodinerds-iptv/3f35761b7edcfb356d22cac0e561592ba589c20b/iptv/kodi/kodi_tv.m3u";
|
||||
sha256 = "sha256-EZEshHWUejLTy6qsBhELfaYdDpQ/uqPsZa1JA0mb7h0=";
|
||||
postFetch = m3u-to-tsv;
|
||||
};
|
||||
|
||||
17
packages/noise-waves.nix
Normal file
17
packages/noise-waves.nix
Normal file
@@ -0,0 +1,17 @@
|
||||
{ sox, mpv, writers, coreutils }:
|
||||
# ref https://askubuntu.com/a/789472
|
||||
writers.writeDashBin "noise-waves" ''
|
||||
file="/tmp/noise-$(${coreutils}/bin/date +%s | ${coreutils}/bin/md5sum | ${coreutils}/bin/cut -d' ' -f1).wav"
|
||||
trap clean EXIT
|
||||
clean() {
|
||||
rm "$file"
|
||||
}
|
||||
|
||||
${coreutils}/bin/mkfifo "$file"
|
||||
|
||||
${sox}/bin/sox -c2 -r44.1k -b8 -n "$file" synth brownnoise synth pinknoise mix synth sine amod 0.3 10 &
|
||||
${mpv}/bin/mpv "$file"
|
||||
''
|
||||
|
||||
# play -c2 -r44.1k -b8 -n synth -1 brownnoise .1 40
|
||||
# play -c2 -r44.1k -b8 -n synth -1 pinknoise .1 60
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
writers,
|
||||
lib,
|
||||
rofi,
|
||||
wofi,
|
||||
findutils,
|
||||
coreutils,
|
||||
noteDirectory ? "~/state/obsidian",
|
||||
@@ -11,7 +11,7 @@
|
||||
writers.writeDashBin "notemenu" ''
|
||||
set -efu
|
||||
PATH=$PATH:${
|
||||
lib.makeBinPath [rofi findutils coreutils]
|
||||
lib.makeBinPath [wofi findutils coreutils]
|
||||
}
|
||||
|
||||
cd ${noteDirectory}
|
||||
@@ -21,7 +21,7 @@ writers.writeDashBin "notemenu" ''
|
||||
echo $(date -I -d yesterday).md
|
||||
''}
|
||||
find . -not -path '*/.*' -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2-
|
||||
} | rofi -dmenu -i -p 'notes')
|
||||
} | wofi -dmenu -i -p 'notes')
|
||||
if test "$note_file"
|
||||
then
|
||||
alacritty --working-directory ${noteDirectory} -e ${niveumPackages.obsidian-vim}/bin/nvim "$note_file"
|
||||
|
||||
@@ -35,6 +35,7 @@ neovim.override {
|
||||
vimPlugins.nerdtree
|
||||
vimPlugins.fzf-vim
|
||||
vimPlugins.fzfWrapper
|
||||
vimPlugins.vim-fugitive
|
||||
];
|
||||
};
|
||||
}
|
||||
|
||||
18
packages/passmenu.nix
Normal file
18
packages/passmenu.nix
Normal file
@@ -0,0 +1,18 @@
|
||||
{ writers, wofi, pass, fd, libnotify, ... }:
|
||||
writers.writeBashBin "passmenu" ''
|
||||
shopt -s nullglob globstar
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
prefix=$(readlink -f ''${PASSWORD_STORE_DIR-~/.password-store})
|
||||
password_files=( $( ${fd}/bin/fd -L ".gpg\$" "$prefix" ) )
|
||||
password_files=( "''${password_files[@]#"$prefix"/}" )
|
||||
password_files=( "''${password_files[@]%.gpg}" )
|
||||
|
||||
password=$( printf '%s\n' "''${password_files[@]}" | ${wofi}/bin/wofi -i -k /dev/null -d menu -- "$@" )
|
||||
|
||||
[[ -n $password ]] || exit
|
||||
|
||||
OUT=$(${pass}/bin/pass show --clip "$password")
|
||||
${libnotify}/bin/notify-send -t 5000 "$(echo "$OUT" | grep '^login:' | sed 's/^login: //')"
|
||||
''
|
||||
@@ -30,10 +30,27 @@
|
||||
"that's a good song!"
|
||||
"👍"
|
||||
"vibin'"
|
||||
"this is a jam!"
|
||||
"absolutely love it!"
|
||||
"such a vibe!"
|
||||
"this track is fire!"
|
||||
"feeling this one!"
|
||||
"pure gold!"
|
||||
"this is my jam!"
|
||||
"so catchy!"
|
||||
"on repeat!"
|
||||
"this is a masterpiece!"
|
||||
"let's dance!"
|
||||
"I'm all in!"
|
||||
"so gut!"
|
||||
"mega!"
|
||||
"ich fühl's!"
|
||||
"das ist Musik für die Seele!"
|
||||
];
|
||||
|
||||
messages.bad = [
|
||||
"how can anyone listen to this?"
|
||||
"(╯°□°)╯ ┻━┻"
|
||||
"(╯°□°)╯ ┻━┻"
|
||||
"skip this!"
|
||||
"next, please! i'm suffering!"
|
||||
"that's just bad music"
|
||||
@@ -43,12 +60,40 @@
|
||||
"turn that down"
|
||||
"make it stooop"
|
||||
"noooo"
|
||||
"this is painful to listen to"
|
||||
"what is this noise?"
|
||||
"not my cup of tea"
|
||||
"this is a hard pass"
|
||||
"yikes!"
|
||||
"please no more"
|
||||
"this is a disaster"
|
||||
"I can't handle this"
|
||||
"this is just wrong"
|
||||
"let's skip this one"
|
||||
"ugh, why?"
|
||||
"definitely not a fan"
|
||||
"wie kann man das hören?"
|
||||
"das ist schrecklich!"
|
||||
"bitte nicht!"
|
||||
"das ist einfach schlecht"
|
||||
"oh nein, nicht das!"
|
||||
];
|
||||
|
||||
messages.neutral = [
|
||||
"meh"
|
||||
"i have no opinion about this song"
|
||||
"idk man"
|
||||
"it's okay"
|
||||
"not bad, not great"
|
||||
"just average"
|
||||
"it's fine"
|
||||
"i can take it or leave it"
|
||||
"kann man hören"
|
||||
"ist in ordnung"
|
||||
"naja"
|
||||
"nicht schlecht, nicht gut"
|
||||
"ich kann damit leben"
|
||||
"es ist was es ist"
|
||||
];
|
||||
in
|
||||
writers.writeDashBin "pls" ''
|
||||
|
||||
9
packages/q.nix
Normal file
9
packages/q.nix
Normal file
@@ -0,0 +1,9 @@
|
||||
{ writers, lib, todoman, khal, util-linux, wego, pass }:
|
||||
writers.writeDashBin "q" ''
|
||||
export PATH=$PATH:${lib.makeBinPath [todoman khal util-linux wego pass]}
|
||||
(todo list --due 240; echo) &
|
||||
(khal list today today; echo) &
|
||||
(cal -3; echo) &
|
||||
(wego -location Berlin -owm-api-key "$(pass api-keys/openweathermap)" -frontend emoji -days 2; echo) &
|
||||
wait
|
||||
''
|
||||
@@ -2,7 +2,7 @@
|
||||
writers,
|
||||
mktemp,
|
||||
qrencode,
|
||||
xclip,
|
||||
wl-clipboard,
|
||||
nsxiv,
|
||||
}:
|
||||
writers.writeDashBin "qrpaste" ''
|
||||
@@ -11,6 +11,6 @@ writers.writeDashBin "qrpaste" ''
|
||||
clean() {
|
||||
rm "$file"
|
||||
}
|
||||
${qrencode}/bin/qrencode "$(${xclip}/bin/xclip -selection clipboard -out)" -o "$file"
|
||||
${qrencode}/bin/qrencode "$(${wl-clipboard}/bin/wl-paste)" -o "$file"
|
||||
${nsxiv}/bin/nsxiv "$file"
|
||||
''
|
||||
|
||||
47
packages/radio-news.nix
Normal file
47
packages/radio-news.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ writers, lib, gnused, curl, jq, yq }:
|
||||
writers.writeBashBin "radio-news" ''
|
||||
set -efu
|
||||
PATH=$PATH:${lib.makeBinPath [gnused curl jq yq]}
|
||||
|
||||
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 as possible, and easy to follow.
|
||||
Please no unnecessary explanations why the news is good.
|
||||
|
||||
Begin the digest with: "Here's your good news update."
|
||||
EOF
|
||||
)
|
||||
|
||||
REQUEST=$(cat <<EOF
|
||||
{
|
||||
"system_instruction": {
|
||||
"parts": [
|
||||
{
|
||||
"text": $(jq -Rs <<< "$SYSTEM_PROMPT")
|
||||
}
|
||||
]
|
||||
},
|
||||
"contents": [
|
||||
{
|
||||
"parts": [
|
||||
{
|
||||
"text": $(jq -Rs <<< "$EVENTS")
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
)
|
||||
|
||||
echo "$REQUEST" | curl "https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-flash-8b:generateContent?key=$GEMINI_API_KEY" -s -H "Content-Type: application/json" -d @-
|
||||
''
|
||||
71
packages/random-zeno.nix
Executable file
71
packages/random-zeno.nix
Executable file
@@ -0,0 +1,71 @@
|
||||
{ writers, lib, curl, pup, gnused, coreutils, pandoc, gawk, jq }:
|
||||
writers.writeDashBin "random-zeno" ''
|
||||
set -efu
|
||||
|
||||
export PATH=${lib.makeBinPath [ curl pup gnused coreutils pandoc gawk jq ]}
|
||||
|
||||
root="http://www.zeno.org"
|
||||
character_limit=350
|
||||
|
||||
fetch() {
|
||||
curl -sSL "$root$1"
|
||||
}
|
||||
|
||||
blacklist='\/Biographie$'
|
||||
|
||||
next_links() {
|
||||
html="$1"
|
||||
echo "$html" | pup '.zenoTXLinkInt attr{href}' | sed "/$blacklist/d"
|
||||
echo "$html" | pup '.zenoTRNavBottom a attr{href}' | sed "/$blacklist/d"
|
||||
}
|
||||
|
||||
eval_html() {
|
||||
url="$1"
|
||||
html="$(fetch "$url")"
|
||||
links="$(next_links "$html" | sed '/^\s*$/d')"
|
||||
links_count="$(echo "$links" | wc -l)"
|
||||
if [ -z "$links" ]
|
||||
then
|
||||
random_paragraph="$(echo "$html" | pup '.zenoCOMain p' | tr '\n' ' ' | sed 's/<\/p>/&\n/g')"
|
||||
[ "$random_paragraph" = null ] && exit
|
||||
prettify "$url" "$random_paragraph"
|
||||
else
|
||||
next_link="$(echo "$links" | shuf -n1)"
|
||||
eval_html "$next_link"
|
||||
fi
|
||||
}
|
||||
|
||||
prettify() {
|
||||
url="$1"
|
||||
html="$2"
|
||||
|
||||
plain_text="$(echo "$html" | tr '\n' ' ' \
|
||||
| sed \
|
||||
-e 's/<h[1-6][^>]*>[^<]*<\/h[1-6]>//g' \
|
||||
-e 's/\[[0-9]*\]\s*//g' \
|
||||
| pandoc -f html -t plain \
|
||||
| tr '\n' ' '
|
||||
)"
|
||||
|
||||
truncated=$(echo "$plain_text" | awk -v limit="$character_limit" '
|
||||
{
|
||||
for (i = 1; i <= NF; i++) {
|
||||
word_length = length($i) + 1; # +1 for the space
|
||||
if (total_length + word_length > limit) {
|
||||
print "…";
|
||||
break;
|
||||
} else {
|
||||
total_length += word_length;
|
||||
printf "%s ", $i; # Print the word followed by a space
|
||||
}
|
||||
}
|
||||
print "";
|
||||
}
|
||||
' | sed 's/\([:,.!?;]\)[^:,.!?;]*…/\1 …/')
|
||||
|
||||
url="$(echo "$url" | jq -sRr @uri)"
|
||||
printf "%s\n\n%s\n" "$truncated" "$root$url"
|
||||
}
|
||||
|
||||
eval_html "$1"
|
||||
''
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
writers,
|
||||
xclip,
|
||||
wl-clipboard,
|
||||
espeak,
|
||||
}:
|
||||
writers.writeDashBin "ttspaste" ''
|
||||
${xclip}/bin/xclip -selection clipboard -out | ${espeak}/bin/espeak
|
||||
${wl-clipboard}/bin/paste | ${espeak}/bin/espeak
|
||||
''
|
||||
# curl, mpv,
|
||||
# ${curl}/bin/curl -G http://tts.r/api/tts --data-urlencode 'text@-' | ${mpv}/bin/mpv -
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
dmenu,
|
||||
gnused,
|
||||
libnotify,
|
||||
xclip,
|
||||
wl-clipboard,
|
||||
xdotool,
|
||||
gawk,
|
||||
fetchFromGitHub,
|
||||
@@ -89,7 +89,8 @@ in
|
||||
# ref https://github.com/LukeSmithxyz/voidrice/blob/9fe6802122f6e0392c7fe20eefd30437771d7f8e/.local/bin/dmenuunicode
|
||||
writers.writeDashBin "unicodmenu" ''
|
||||
history_file=$HOME/.cache/unicodmenu
|
||||
PATH=${lib.makeBinPath [coreutils dmenu gawk gnused libnotify xclip xdotool]}
|
||||
touch "$history_file"
|
||||
PATH=${lib.makeBinPath [coreutils dmenu gawk gnused libnotify wl-clipboard xdotool]}
|
||||
|
||||
all_characters() {
|
||||
tac "$history_file"
|
||||
@@ -100,7 +101,7 @@ in
|
||||
|
||||
[ "$chosen" != "" ] || exit
|
||||
|
||||
echo "$chosen" | tr -d '\n' | xclip -selection clipboard
|
||||
echo "$chosen" | tr -d '\n' | wl-copy
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
xdotool key Shift+Insert
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
fetchFromGitHub,
|
||||
vimUtils,
|
||||
niveumPackages,
|
||||
writeText,
|
||||
stylixColors ? null,
|
||||
colorscheme ? null,
|
||||
lib,
|
||||
...
|
||||
}: (neovim.override {
|
||||
configure = {
|
||||
@@ -12,9 +16,21 @@
|
||||
source ${../lib/vim/init.vim}
|
||||
let g:snippet_directory = '${vimPlugins.friendly-snippets}'
|
||||
luafile ${../lib/vim/init.lua}
|
||||
'' + lib.optionalString (stylixColors != null) (with stylixColors.withHashtag; ''
|
||||
luafile ${writeText "colors.lua" ''
|
||||
require('base16-colorscheme').setup({
|
||||
base00 = '${base00}', base01 = '${base01}', base02 = '${base02}', base03 = '${base03}',
|
||||
base04 = '${base04}', base05 = '${base05}', base06 = '${base06}', base07 = '${base07}',
|
||||
base08 = '${base08}', base09 = '${base09}', base0A = '${base0A}', base0B = '${base0B}',
|
||||
base0C = '${base0C}', base0D = '${base0D}', base0E = '${base0E}', base0F = '${base0F}'
|
||||
})
|
||||
''}
|
||||
'') + lib.optionalString (colorscheme != null) ''
|
||||
colorscheme ${colorscheme}
|
||||
'';
|
||||
packages.nvim = with vimPlugins; {
|
||||
start = [
|
||||
base16-nvim
|
||||
nvim-cmp
|
||||
cmp-buffer
|
||||
cmp-path
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
unstablePackages,
|
||||
...
|
||||
} @ args: let
|
||||
# config cannot be declared in the input attribute set because that would
|
||||
@@ -136,7 +137,7 @@
|
||||
))
|
||||
);
|
||||
|
||||
weechat = pkgs.weechat.override {
|
||||
weechat = unstablePackages.weechat.override {
|
||||
configure = _: {
|
||||
init = "/exec -oc cat ${setFile}";
|
||||
|
||||
@@ -169,7 +170,7 @@ in
|
||||
name = "weechat-configured";
|
||||
paths = [
|
||||
wrapper
|
||||
pkgs.weechat
|
||||
unstablePackages.weechat
|
||||
];
|
||||
postBuild = ''
|
||||
ln -s ${setFile} $out/weechat.set
|
||||
|
||||
2
secrets
2
secrets
Submodule secrets updated: ecdc95abf8...e14a3170cc
24
secrets.txt
24
secrets.txt
@@ -1,22 +1,22 @@
|
||||
secrets/alertmanager-token-reporters.age
|
||||
secrets/cifs-credentials-hu-berlin.age
|
||||
secrets/cifs-credentials-zodiac.age
|
||||
secrets/di-fm-key.age
|
||||
secrets/email-password-cock.age
|
||||
secrets/email-password-dslalewa.age
|
||||
secrets/email-password-fsklassp.age
|
||||
secrets/email-password-fysi.age
|
||||
secrets/email-password-letos.age
|
||||
secrets/email-password-meinhak99.age
|
||||
secrets/email-password-meinhaki.age
|
||||
secrets/email-password-posteo.age
|
||||
secrets/fatteh-retiolum-privateKey-ed25519.age
|
||||
secrets/fatteh-retiolum-privateKey-rsa.age
|
||||
secrets/fatteh-syncthing-cert.age
|
||||
secrets/fatteh-syncthing-key.age
|
||||
secrets/fatteh-wireguard-aether-key.age
|
||||
secrets/fatteh-wireguard-aether-psk.age
|
||||
secrets/ful-retiolum-privateKey-ed25519.age
|
||||
secrets/ful-retiolum-privateKey-rsa.age
|
||||
secrets/ful-root.age
|
||||
secrets/fu-sftp-key.age
|
||||
secrets/gemini-api-key.age
|
||||
secrets/github-token-i3status-rust.age
|
||||
secrets/grafana-password-admin.age
|
||||
secrets/hetzner-storagebox-credentials.age
|
||||
@@ -25,7 +25,13 @@ secrets/kabsa-retiolum-privateKey-ed25519.age
|
||||
secrets/kabsa-retiolum-privateKey-rsa.age
|
||||
secrets/kabsa-syncthing-cert.age
|
||||
secrets/kabsa-syncthing-key.age
|
||||
secrets/kabsa-wireguard-aether-key.age
|
||||
secrets/kabsa-wireguard-aether-psk.age
|
||||
secrets/kfm-password.age
|
||||
secrets/kibbeh-retiolum-privateKey-ed25519.age
|
||||
secrets/kibbeh-retiolum-privateKey-rsa.age
|
||||
secrets/kibbeh-syncthing-cert.age
|
||||
secrets/kibbeh-syncthing-key.age
|
||||
secrets/ledger-basicAuth.age
|
||||
secrets/makanek-retiolum-privateKey-ed25519.age
|
||||
secrets/makanek-retiolum-privateKey-rsa.age
|
||||
@@ -33,6 +39,16 @@ secrets/manakish-retiolum-privateKey-ed25519.age
|
||||
secrets/manakish-retiolum-privateKey-rsa.age
|
||||
secrets/manakish-syncthing-cert.age
|
||||
secrets/manakish-syncthing-key.age
|
||||
secrets/manakish-wireguard-aether-key.age
|
||||
secrets/manakish-wireguard-aether-psk.age
|
||||
secrets/mastodon-token-celan.age
|
||||
secrets/mastodon-token-hesychius.age
|
||||
secrets/mastodon-token-nietzsche.age
|
||||
secrets/mastodon-token-smyth.age
|
||||
secrets/mastodon-token-tlgwotd.age
|
||||
secrets/mastodon-token-transits.age
|
||||
secrets/matrix-token-lakai.age
|
||||
secrets/matrix-token-lakai-env.age
|
||||
secrets/maxmind-license-key.age
|
||||
secrets/mega-password.age
|
||||
secrets/miniflux-api-token.age
|
||||
|
||||
@@ -20,26 +20,28 @@ in {
|
||||
|
||||
services.illum.enable = true;
|
||||
|
||||
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/selenized-light.yaml";
|
||||
|
||||
age.secrets = {
|
||||
retiolum-rsa = {
|
||||
file = ../../secrets/fatteh-retiolum-privateKey-rsa.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
retiolum-ed25519 = {
|
||||
file = ../../secrets/fatteh-retiolum-privateKey-ed25519.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
restic.file = ../../secrets/restic.age;
|
||||
syncthing-cert.file = ../../secrets/fatteh-syncthing-cert.age;
|
||||
syncthing-key.file = ../../secrets/fatteh-syncthing-key.age;
|
||||
wireguard-aether-key.file = ../../secrets/fatteh-wireguard-aether-key.age;
|
||||
wireguard-aether-psk.file = ../../secrets/fatteh-wireguard-aether-psk.age;
|
||||
};
|
||||
|
||||
networking.wg-quick.interfaces.aether.address = ["192.168.178.202/24"];
|
||||
|
||||
networking.hostName = "fatteh";
|
||||
networking.retiolum = retiolumAddresses.fatteh;
|
||||
|
||||
|
||||
89
systems/ful/alew.nix
Normal file
89
systems/ful/alew.nix
Normal file
@@ -0,0 +1,89 @@
|
||||
{ pkgs, config, inputs, ... }:
|
||||
let
|
||||
postgrestPort = 3001;
|
||||
alewPort = 3000;
|
||||
in
|
||||
{
|
||||
systemd.services.postgrest = {
|
||||
enable = true;
|
||||
wantedBy = ["podman-alew.service"];
|
||||
wants = ["postgresql.service"];
|
||||
environment = {
|
||||
PGRST_DB_ANON_ROLE = "alew_1";
|
||||
PGRST_DB_SCHEMA = "alew_2022_05"; # alew_2023_09 for most recent (beta)
|
||||
PGRST_DB_URI = "postgres://alew_1:alew_1@localhost:5432/alew";
|
||||
PGRST_SERVER_PORT = toString postgrestPort;
|
||||
};
|
||||
script = "${pkgs.postgrest}/bin/postgrest";
|
||||
serviceConfig = {
|
||||
User = "postgres";
|
||||
Group = "postgres";
|
||||
};
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."alew.kmein.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/" = {
|
||||
proxyPass = "http://localhost:${toString alewPort}";
|
||||
};
|
||||
};
|
||||
|
||||
# deploy nuxt app using
|
||||
# $ cd alew/web/
|
||||
# $ rsync -rav --delete . ful:/var/lib/alew --exclude .git --exclude .nuxt --exclude node_modules
|
||||
systemd.services.alew = {
|
||||
enable = true;
|
||||
wantedBy = ["multi-user.target"];
|
||||
wants = ["postgrest.service"];
|
||||
path = [
|
||||
pkgs.yarn
|
||||
pkgs.python3
|
||||
pkgs.gcc
|
||||
pkgs.bash
|
||||
pkgs.coreutils
|
||||
pkgs.gnumake
|
||||
];
|
||||
environment = {
|
||||
NODE_OPTIONS= "--openssl-legacy-provider";
|
||||
POSTGREST_URL = "http://localhost:${toString postgrestPort}";
|
||||
BETA = "0";
|
||||
PORT = toString alewPort;
|
||||
};
|
||||
preStart = ''
|
||||
# rsync -rav --delete ALEW_SRC .
|
||||
yarn install
|
||||
yarn build
|
||||
'';
|
||||
script = "yarn start";
|
||||
serviceConfig = {
|
||||
User = "alew";
|
||||
Group = "alew";
|
||||
WorkingDirectory = config.users.extraUsers.alew.home;
|
||||
};
|
||||
};
|
||||
|
||||
users.extraUsers.alew = {
|
||||
isSystemUser = true;
|
||||
createHome = true;
|
||||
home = "/var/lib/alew";
|
||||
group = "alew";
|
||||
};
|
||||
|
||||
users.extraGroups.alew = {};
|
||||
|
||||
environment.systemPackages = [pkgs.podman];
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureDatabases = ["alew"];
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "alew";
|
||||
ensureDBOwnership = true;
|
||||
}
|
||||
{ name = "alew_1"; } # readonly
|
||||
];
|
||||
package = pkgs.postgresql_16;
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
inherit (import ../../lib) kieran retiolumAddresses restic;
|
||||
@@ -11,7 +12,10 @@ in {
|
||||
./radio.nix
|
||||
./panoptikon.nix
|
||||
./hledger.nix
|
||||
./wallabag.nix
|
||||
./alew.nix
|
||||
../../configs/monitoring.nix
|
||||
../../configs/mycelium.nix
|
||||
../../configs/tor.nix
|
||||
../../configs/save-space.nix
|
||||
../../configs/spacetime.nix
|
||||
@@ -39,14 +43,14 @@ in {
|
||||
retiolum-rsa = {
|
||||
file = ../../secrets/ful-retiolum-privateKey-rsa.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
retiolum-ed25519 = {
|
||||
file = ../../secrets/ful-retiolum-privateKey-ed25519.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
root.file = ../../secrets/ful-root.age;
|
||||
restic.file = ../../secrets/restic.age;
|
||||
@@ -65,6 +69,65 @@ in {
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
users.users.servant = {
|
||||
isSystemUser = true;
|
||||
group = "servant";
|
||||
};
|
||||
users.groups.servant = {};
|
||||
systemd.services.servant = {
|
||||
enable = true;
|
||||
environment.PORT = toString 18987;
|
||||
environment.VIRTUAL_HOST = "https://openapiaiapi.kmein.de";
|
||||
serviceConfig.ExecStart = pkgs.writers.writeHaskell "server" {
|
||||
libraries = with pkgs.haskellPackages; [
|
||||
servant
|
||||
servant-server
|
||||
servant-openapi3
|
||||
servant-swagger-ui
|
||||
servant-client
|
||||
aeson
|
||||
text
|
||||
warp
|
||||
uuid
|
||||
lens
|
||||
];
|
||||
ghcArgs = ["-O3" "-threaded"];
|
||||
} ./servant-openapi.hs;
|
||||
serviceConfig.User = "servant";
|
||||
serviceConfig.Group = "servant";
|
||||
};
|
||||
|
||||
services.htgen.openapi-conversion = {
|
||||
port = 18988;
|
||||
script = ''. ${pkgs.writers.writeDash "openapi-conversion" ''
|
||||
case "$Method $Request_URI" in
|
||||
"GET /openapi-3.1.json")
|
||||
schema=$(mktemp -d)
|
||||
trap 'rm -rf $schema' EXIT
|
||||
${pkgs.wget}/bin/wget http://127.0.0.1:${toString 18987}/openapi.json -O "$schema"/openapi.json
|
||||
cat "$schema"/openapi.json >&2
|
||||
PATH=${lib.makeBinPath [pkgs.bashInteractive pkgs.nodejs]} ${pkgs.nodejs}/bin/npx --yes openapi-format "$schema"/openapi.json --convertTo "3.1" -o "$schema"/openapi-new.json
|
||||
printf 'HTTP/1.1 200 OK\r\n'
|
||||
printf 'Content-Type: %s\r\n' "$(${pkgs.file}/bin/file -ib "$schema"/openapi-new.json)"
|
||||
printf 'Server: %s\r\n' "$Server"
|
||||
printf 'Connection: close\r\n'
|
||||
printf 'Content-Length: %d\r\n' $(${pkgs.coreutils}/bin/wc -c < "$schema"/openapi-new.json)
|
||||
printf '\r\n'
|
||||
cat "$schema"/openapi-new.json
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
''}'';
|
||||
};
|
||||
|
||||
services.nginx.virtualHosts."openapiaiapi.kmein.de" = {
|
||||
enableACME = true;
|
||||
forceSSL = true;
|
||||
locations."/openapi-3.1.json".proxyPass = "http://127.0.0.1:${toString 18988}";
|
||||
locations."/".proxyPass = "http://127.0.0.1:${toString 18987}";
|
||||
};
|
||||
|
||||
networking = {
|
||||
firewall.allowedTCPPorts = [80 443];
|
||||
hostName = "ful";
|
||||
|
||||
@@ -5,11 +5,7 @@
|
||||
}: {
|
||||
services.hledger-web = {
|
||||
enable = true;
|
||||
capabilities = {
|
||||
add = true;
|
||||
view = true;
|
||||
manage = false;
|
||||
};
|
||||
allow = "edit";
|
||||
serveApi = false; # serve only the JSON API
|
||||
baseUrl = "https://ledger.kmein.de";
|
||||
journalFiles = [
|
||||
@@ -18,7 +14,7 @@
|
||||
};
|
||||
|
||||
systemd.services.hledger-backup = {
|
||||
enable = true;
|
||||
enable = false;
|
||||
startAt = "hourly";
|
||||
wants = ["network-online.target"];
|
||||
wantedBy = ["multi-user.target"];
|
||||
|
||||
@@ -21,6 +21,7 @@ in {
|
||||
nginx = {
|
||||
serverName = "matomo.kmein.de";
|
||||
};
|
||||
package = pkgs.matomo_5;
|
||||
};
|
||||
|
||||
services.mysql = {
|
||||
|
||||
@@ -13,6 +13,23 @@
|
||||
retiolumLink = true;
|
||||
};
|
||||
|
||||
matrix = {
|
||||
server ? "matrix.4d2.org",
|
||||
target,
|
||||
}:
|
||||
pkgs.writers.writeDash "matrix-reporter" ''
|
||||
export RAW_MESSAGE="$(cat)"
|
||||
export MESSAGE=$(printf '<b>%s</b><br><pre>%s</pre>' "$PANOPTIKON_WATCHER" "$RAW_MESSAGE")
|
||||
export MATRIX_TOKEN="$(cat ${config.age.secrets.matrix-token-lakai.path})"
|
||||
export JSON_PAYLOAD=$(${pkgs.jq}/bin/jq -n --arg msgtype "m.text" --arg body "$RAW_MESSAGE" --arg formattedBody "$MESSAGE" '{msgtype: $msgtype, body: $body, format: "org.matrix.custom.html", formatted_body: $formattedBody}')
|
||||
${pkgs.curl}/bin/curl -X POST "https://${server}/_matrix/client/r0/rooms/${target}/send/m.room.message" \
|
||||
-d "$JSON_PAYLOAD" \
|
||||
-H "Authorization: Bearer $MATRIX_TOKEN" \
|
||||
-H "Content-Type: application/json"
|
||||
'';
|
||||
|
||||
matrix-kmein = matrix { target = "!zlwCuPiCNMSxDviFzA:4d2.org"; };
|
||||
|
||||
telegram-kmein = let
|
||||
chatId = "-1001796440545";
|
||||
in
|
||||
@@ -32,6 +49,12 @@
|
||||
};
|
||||
in {
|
||||
age.secrets.telegram-token-kmein.file = ../../secrets/telegram-token-kmein.age;
|
||||
age.secrets.matrix-token-lakai = {
|
||||
file = ../../secrets/matrix-token-lakai.age;
|
||||
owner = "panoptikon";
|
||||
group = "panoptikon";
|
||||
mode = "400";
|
||||
};
|
||||
|
||||
services.panoptikon = {
|
||||
enable = true;
|
||||
@@ -49,79 +72,79 @@ in {
|
||||
};
|
||||
lammla = {
|
||||
script = panoptikon.url "http://lammla.info/index.php?reihe=30";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
kratylos = {
|
||||
script = panoptikon.url "https://kratylos.reichert-online.org/current_issue/KRATYLOS";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
kobudo-tesshinkan = {
|
||||
script = panoptikon.url "https://kobudo-tesshinkan.eu/index.php/de/termine-berichte/lehrgaenge/";
|
||||
reporters = [irc-kmein telegram-kmein];
|
||||
reporters = [telegram-kmein matrix-kmein];
|
||||
};
|
||||
zeno-free = {
|
||||
script = panoptikon.urlSelector ".zenoCOMain" "http://www.zeno.org/Lesesaal/M/E-Books";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
carolinawelslau = {
|
||||
script = panoptikon.urlSelector "#main" "https://carolinawelslau.de/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
humboldt-preis = {
|
||||
script = panoptikon.urlSelector "#content-core" "https://www.hu-berlin.de/de/ueberblick/menschen/ehrungen/humboldtpreis";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
lisalittmann = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://lisalittmann.de/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
lisalittmann-archive = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://lisalittmann.de/archive/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
lisalittmann-projects = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://lisalittmann.de/projects/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
tatort = {
|
||||
script = panoptikon.urlSelector ".linklist" "https://www.daserste.de/unterhaltung/krimi/tatort/sendung/index.html";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
warpgrid-idiomarium = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://warpgrid.de/idiomarium/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
warpgrid-futurism = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://warpgrid.de/futurism/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
warpgrid-imagiary = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://warpgrid.de/imagiary/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
warpgrid-alchemy = {
|
||||
script = panoptikon.urlSelector "#site-content" "https://warpgrid.de/alchemy/";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
indogermanische-forschungen = {
|
||||
script = panoptikon.urlSelector "#latestIssue" "https://www.degruyter.com/journal/key/INDO/html";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
ig-neuigkeiten = {
|
||||
script = panoptikon.urlSelector "[itemprop=articleBody]" "https://www.indogermanistik.org/aktuelles/neuigkeiten.html";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
ig-tagungen = {
|
||||
script = panoptikon.urlSelector "[itemprop=articleBody]" "https://www.indogermanistik.org/tagungen/tagungen-der-ig.html";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
fu-distant = {
|
||||
script = panoptikon.urlSelector "#current_events" "https://www.geschkult.fu-berlin.de/en/e/ma-distant/Termine/index.html";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
fu-aegyptologie = {
|
||||
script = panoptikon.urlSelector "#current_events" "https://www.geschkult.fu-berlin.de/e/aegyptologie/termine/index.html";
|
||||
reporters = [irc-kmein];
|
||||
reporters = [matrix-kmein];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -118,14 +118,15 @@ in {
|
||||
)
|
||||
end
|
||||
|
||||
make_streams("lyrikline", random_url("${lyrikline-poem}"), description="lyrikline. listen to the poet (unofficial)", genre="poetry")
|
||||
# make_streams("lyrikline", random_url("${lyrikline-poem}"), description="lyrikline. listen to the poet (unofficial)", genre="poetry")
|
||||
make_streams("qasida", random_url("${qasida-poem}"), description="Qasa'id. Classical arabic poetry", genre="poetry")
|
||||
make_streams("lyrik", random_url("${stavenhagen-poem}"), description="Fritz Stavenhagen – Lyrik für alle | www.deutschelyrik.de", genre="poetry")
|
||||
make_streams("wikipedia", random_url("${wikipedia-article}"), description="Zufällige Artikel von Wikipedia", genre="useless knowledge")
|
||||
# make_streams("wikipedia", random_url("${wikipedia-article}"), description="Zufällige Artikel von Wikipedia", genre="useless knowledge")
|
||||
'';
|
||||
|
||||
systemd.services.radio = {
|
||||
environment.TMPDIR = liquidsoapDirectory;
|
||||
wants = ["network-online.target"];
|
||||
serviceConfig = {
|
||||
RuntimeMaxSec = "${toString (5 * 60 * 60)}s";
|
||||
Restart = "always";
|
||||
|
||||
119
systems/ful/servant-openapi.hs
Normal file
119
systems/ful/servant-openapi.hs
Normal file
@@ -0,0 +1,119 @@
|
||||
|
||||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE TypeFamilies #-}
|
||||
{-# LANGUAGE TypeOperators #-}
|
||||
{-# LANGUAGE DeriveGeneric #-}
|
||||
{-# LANGUAGE OverloadedStrings #-}
|
||||
|
||||
module Main where
|
||||
|
||||
import Data.Aeson (ToJSON, FromJSON)
|
||||
import GHC.Generics (Generic)
|
||||
import Data.String (IsString(..))
|
||||
import Network.Wai (Application)
|
||||
import Network.Wai.Handler.Warp (run)
|
||||
import Servant
|
||||
import Servant.Client (HasClient (..))
|
||||
import Servant.OpenApi (HasOpenApi(..), toOpenApi)
|
||||
import qualified Data.Version as Version
|
||||
import Servant.Swagger.UI (SwaggerSchemaUI, swaggerSchemaUIServer)
|
||||
import Data.OpenApi (ToSchema, servers, license, info, description, version, title)
|
||||
import qualified Data.OpenApi as OpenApi
|
||||
import Control.Concurrent.MVar (MVar, newMVar, modifyMVar, readMVar)
|
||||
import System.Environment (getEnv)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
import Control.Lens
|
||||
import qualified Data.Text as T
|
||||
import GHC.Generics
|
||||
import GHC.TypeLits
|
||||
import Data.UUID (UUID)
|
||||
import Data.UUID.V4 (nextRandom)
|
||||
import qualified Data.UUID as UUID
|
||||
|
||||
-- Define a simple data type
|
||||
data User = User
|
||||
{ userId :: UUID
|
||||
, name :: String
|
||||
, age :: Int
|
||||
} deriving (Generic, Show)
|
||||
|
||||
instance ToJSON User
|
||||
instance FromJSON User
|
||||
instance ToSchema User
|
||||
|
||||
-- Define the API type
|
||||
type API = "users" :> OperationId "getUsers" :> Get '[JSON] [User]
|
||||
:<|> "users" :> OperationId "insertUser" :> ReqBody '[JSON] User :> Post '[JSON] User
|
||||
:<|> "users" :> OperationId "updateUser" :> Capture "id" UUID :> ReqBody '[JSON] User :> Put '[JSON] User
|
||||
:<|> "users" :> OperationId "deleteUser" :> Capture "id" UUID :> Delete '[JSON] NoContent
|
||||
|
||||
-- Define the API with Swagger endpoints
|
||||
type APIWithSwagger = API
|
||||
:<|> SwaggerSchemaUI "swagger-ui" "openapi.json"
|
||||
|
||||
|
||||
data OperationId (name :: Symbol)
|
||||
|
||||
instance HasServer subApi ctx => HasServer (OperationId name :> subApi) ctx where
|
||||
type ServerT (OperationId name :> subApi) m = ServerT subApi m
|
||||
route _ = route (Proxy @subApi)
|
||||
hoistServerWithContext _ = hoistServerWithContext (Proxy @subApi)
|
||||
|
||||
instance (HasOpenApi subApi, KnownSymbol name) => HasOpenApi (OperationId name :> subApi) where
|
||||
toOpenApi _ = toOpenApi (Proxy @subApi) & OpenApi.allOperations . OpenApi.operationId ?~ apiName
|
||||
where
|
||||
apiName = T.pack $ symbolVal (Proxy @name)
|
||||
|
||||
instance HasClient m api => HasClient m (OperationId name :> api) where
|
||||
type Client m (OperationId name :> api) = Client m api
|
||||
clientWithRoute pm Proxy = clientWithRoute pm (Proxy :: Proxy api)
|
||||
hoistClientMonad pm _ = hoistClientMonad pm (Proxy :: Proxy api)
|
||||
|
||||
-- Handlers for the API
|
||||
getUsers :: MVar [User] -> Handler [User]
|
||||
getUsers usersVar = liftIO $ readMVar usersVar
|
||||
|
||||
addUser :: MVar [User] -> User -> Handler User
|
||||
addUser usersVar newUser = liftIO $ do
|
||||
newId <- nextRandom
|
||||
let userWithId = newUser { userId = newId }
|
||||
modifyMVar usersVar $ \users -> return (userWithId : users, userWithId)
|
||||
|
||||
updateUser :: MVar [User] -> UUID -> User -> Handler User
|
||||
updateUser usersVar uid updatedUser = liftIO $ do
|
||||
modifyMVar usersVar $ \users ->
|
||||
let newUsers = map (\user -> if userId user == uid then updatedUser { userId = uid } else user) users
|
||||
in return (newUsers, updatedUser { userId = uid })
|
||||
|
||||
deleteUser :: MVar [User] -> UUID -> Handler NoContent
|
||||
deleteUser usersVar uid = liftIO $ do
|
||||
modifyMVar usersVar $ \users ->
|
||||
let newUsers = filter (\user -> userId user /= uid) users
|
||||
in return (newUsers, NoContent)
|
||||
|
||||
-- Implement the server
|
||||
server :: OpenApi.Server -> MVar [User] -> Server APIWithSwagger
|
||||
server virtualHost usersVar = (getUsers usersVar
|
||||
:<|> addUser usersVar
|
||||
:<|> updateUser usersVar
|
||||
:<|> deleteUser usersVar)
|
||||
:<|> swaggerSchemaUIServer (toOpenApi (Proxy :: Proxy API)
|
||||
& info.title .~ "OpenAPI AI API"
|
||||
& info.version .~ "1.0"
|
||||
& info.description ?~ "This is an API for AI with OpenAPI"
|
||||
& info.license ?~ "MIT"
|
||||
& servers .~ [virtualHost])
|
||||
|
||||
-- Create the application
|
||||
app :: OpenApi.Server -> MVar [User] -> Application
|
||||
app virtualHost usersVar = serve (Proxy :: Proxy APIWithSwagger) (server virtualHost usersVar)
|
||||
|
||||
-- Main entry point
|
||||
main :: IO ()
|
||||
main = do
|
||||
initialUsers <- mapM (\(name, age) -> nextRandom >>= \uid -> return (User uid name age)) [("Alice", 30), ("Bob", 25)]
|
||||
usersVar <- newMVar initialUsers
|
||||
virtualHost <- getEnv "VIRTUAL_HOST"
|
||||
port <- read <$> getEnv "PORT" -- Assuming PORT is a number
|
||||
run port (app (fromString virtualHost) usersVar)
|
||||
|
||||
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" ];
|
||||
};
|
||||
}
|
||||
@@ -1,13 +1,18 @@
|
||||
{
|
||||
config,
|
||||
niveumPackages,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}: let
|
||||
}:
|
||||
let
|
||||
# TODO wrap obsidian: obsidian --no-sandbox --ozone-platform=wayland --ozone-platform-hint=auto --enable-features=UseOzonePlatform,WaylandWindowDecorations %U
|
||||
inherit (import ../../lib) retiolumAddresses;
|
||||
in {
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../kibbeh/hardware-configuration.nix
|
||||
../../configs/tlp.nix
|
||||
../../configs/default.nix
|
||||
../../configs/networkmanager.nix
|
||||
@@ -20,8 +25,6 @@ in {
|
||||
promptColours.success = "cyan";
|
||||
};
|
||||
|
||||
stylix.base16Scheme = "${pkgs.base16-schemes}/share/themes/dracula.yaml";
|
||||
|
||||
nix.settings = {
|
||||
cores = 1;
|
||||
max-jobs = 2;
|
||||
@@ -31,27 +34,31 @@ in {
|
||||
retiolum-rsa = {
|
||||
file = ../../secrets/kabsa-retiolum-privateKey-rsa.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
retiolum-ed25519 = {
|
||||
file = ../../secrets/kabsa-retiolum-privateKey-ed25519.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
restic.file = ../../secrets/restic.age;
|
||||
syncthing-cert.file = ../../secrets/kabsa-syncthing-cert.age;
|
||||
syncthing-key.file = ../../secrets/kabsa-syncthing-key.age;
|
||||
wireguard-aether-key.file = ../../secrets/kabsa-wireguard-aether-key.age;
|
||||
wireguard-aether-psk.file = ../../secrets/kabsa-wireguard-aether-psk.age;
|
||||
};
|
||||
|
||||
environment.systemPackages = [pkgs.minecraft pkgs.zeroad];
|
||||
networking.wg-quick.interfaces.aether.address = [ "192.168.178.203/24" ];
|
||||
|
||||
environment.systemPackages = [ pkgs.zeroad ];
|
||||
|
||||
networking = {
|
||||
hostName = "kabsa";
|
||||
wireless.interfaces = ["wlp3s0"];
|
||||
wireless.interfaces = [ "wlp3s0" ];
|
||||
retiolum = retiolumAddresses.kabsa;
|
||||
};
|
||||
|
||||
system.stateVersion = "19.03";
|
||||
system.stateVersion = "23.11";
|
||||
}
|
||||
|
||||
97
systems/kibbeh/configuration.nix
Normal file
97
systems/kibbeh/configuration.nix
Normal file
@@ -0,0 +1,97 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
niveumPackages,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
../../configs/spacetime.nix
|
||||
../../configs/admin-essentials.nix
|
||||
../../configs/keyboard.nix
|
||||
../../configs/sound.nix
|
||||
../../configs/printing.nix
|
||||
../../configs/nix.nix
|
||||
../../configs/flix.nix
|
||||
../../configs/fonts.nix
|
||||
../../configs/mycelium.nix
|
||||
../../configs/retiolum.nix
|
||||
../../configs/sshd.nix
|
||||
../../configs/sudo.nix
|
||||
../../configs/zsh.nix
|
||||
../../configs/tor.nix
|
||||
];
|
||||
|
||||
age.secrets = {
|
||||
retiolum-rsa = {
|
||||
file = ../../secrets/kibbeh-retiolum-privateKey-rsa.age;
|
||||
mode = "400";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
retiolum-ed25519 = {
|
||||
file = ../../secrets/kibbeh-retiolum-privateKey-ed25519.age;
|
||||
mode = "400";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
};
|
||||
|
||||
services.gnome.gnome-keyring.enable = true;
|
||||
security.pam.services.lightdm.enableGnomeKeyring = true;
|
||||
|
||||
services.openssh.enable = true;
|
||||
|
||||
networking.hostName = "kibbeh";
|
||||
networking.networkmanager.enable = true;
|
||||
|
||||
i18n.defaultLocale = "en_DK.UTF-8";
|
||||
|
||||
services.xserver.enable = true;
|
||||
services.xserver.displayManager.lightdm.enable = true;
|
||||
services.xserver.desktopManager.pantheon.enable = true;
|
||||
# services.displayManager.autoLogin.enable = true;
|
||||
# services.displayManager.autoLogin.user = config.users.users.me.name;
|
||||
|
||||
age.secrets = {
|
||||
di-fm-key.file = ../../secrets/di-fm-key.age;
|
||||
};
|
||||
|
||||
users.users.me = {
|
||||
name = "kfm";
|
||||
isNormalUser = true;
|
||||
description = "किरण";
|
||||
extraGroups = [ "networkmanager" ];
|
||||
password = "hackme";
|
||||
packages = with pkgs; [
|
||||
# packages TODO
|
||||
firefox
|
||||
thunderbird
|
||||
alacritty
|
||||
tor-browser-bundle-bin
|
||||
zathura
|
||||
okular
|
||||
anki-bin
|
||||
libreoffice
|
||||
xournalpp
|
||||
jellyfin-media-player
|
||||
niveumPackages.mpv-tv
|
||||
telegram-desktop
|
||||
(niveumPackages.mpv-radio.override { di-fm-key-file = config.age.secrets.di-fm-key.path; })
|
||||
niveumPackages.meteo
|
||||
spotify
|
||||
];
|
||||
};
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
htop
|
||||
git
|
||||
vim
|
||||
tmux
|
||||
(niveumPackages.vim.override { colorscheme = "base16-gruvbox-dark-medium"; })
|
||||
];
|
||||
|
||||
system.stateVersion = "23.11";
|
||||
}
|
||||
55
systems/kibbeh/hardware-configuration.nix
Normal file
55
systems/kibbeh/hardware-configuration.nix
Normal file
@@ -0,0 +1,55 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
modulesPath,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
imports = [
|
||||
(modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot = {
|
||||
initrd = {
|
||||
availableKernelModules = [
|
||||
"ehci_pci"
|
||||
"ahci"
|
||||
"usb_storage"
|
||||
"sd_mod"
|
||||
"sdhci_pci"
|
||||
];
|
||||
luks.devices."luks-16a8b3b0-5e0a-4d36-920c-eb6322a3c181".device =
|
||||
"/dev/disk/by-uuid/16a8b3b0-5e0a-4d36-920c-eb6322a3c181";
|
||||
luks.devices."luks-b3988d35-72a9-4e7c-992d-f500bb388554".device =
|
||||
"/dev/disk/by-uuid/b3988d35-72a9-4e7c-992d-f500bb388554";
|
||||
};
|
||||
kernelModules = [ "kvm-intel" ];
|
||||
extraModulePackages = [ ];
|
||||
loader = {
|
||||
systemd-boot.enable = true;
|
||||
efi.canTouchEfiVariables = true;
|
||||
};
|
||||
};
|
||||
|
||||
fileSystems = {
|
||||
"/" = {
|
||||
device = "/dev/disk/by-uuid/ecab6acb-66f1-41c9-8281-59c76cf8f0c6";
|
||||
fsType = "ext4";
|
||||
};
|
||||
"/boot" = {
|
||||
device = "/dev/disk/by-uuid/8066-63C2";
|
||||
fsType = "vfat";
|
||||
};
|
||||
};
|
||||
|
||||
swapDevices = [
|
||||
{ device = "/dev/disk/by-uuid/8cebdb17-4f2e-4750-8e91-71aa942bdfde"; }
|
||||
];
|
||||
|
||||
networking.useDHCP = lib.mkDefault true;
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -92,7 +92,7 @@ in {
|
||||
home.username = "xm7234fu";
|
||||
home.homeDirectory = "/Users/${config.home.username}";
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
nix.package = pkgs.nixFlakes;
|
||||
nix.package = pkgs.nixVersions.stable;
|
||||
nix.extraOptions = "experimental-features = nix-command flakes";
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,9 @@ in {
|
||||
./monitoring
|
||||
./names.nix
|
||||
./nextcloud.nix
|
||||
../../configs/mycelium.nix
|
||||
./radio-news.nix
|
||||
./scrabble.nix
|
||||
# ./onlyoffice.nix
|
||||
./retiolum-map.nix
|
||||
./tarot.nix
|
||||
@@ -28,7 +30,7 @@ in {
|
||||
../../configs/retiolum.nix
|
||||
../../configs/spacetime.nix
|
||||
../../configs/sshd.nix
|
||||
../../configs/telegram-bots
|
||||
../../configs/bots
|
||||
../../configs/admin-essentials.nix
|
||||
];
|
||||
|
||||
@@ -88,14 +90,14 @@ in {
|
||||
retiolum-rsa = {
|
||||
file = ../../secrets/makanek-retiolum-privateKey-rsa.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
retiolum-ed25519 = {
|
||||
file = ../../secrets/makanek-retiolum-privateKey-ed25519.age;
|
||||
mode = "400";
|
||||
owner = "tinc.retiolum";
|
||||
group = "tinc.retiolum";
|
||||
owner = "tinc-retiolum";
|
||||
group = "tinc-retiolum";
|
||||
};
|
||||
restic.file = ../../secrets/restic.age;
|
||||
};
|
||||
|
||||
@@ -1,20 +1,45 @@
|
||||
{ config, ... }:
|
||||
let
|
||||
inherit (import ../../lib) sshPort;
|
||||
domain = "https://code.kmein.de";
|
||||
domain = "code.kmein.de";
|
||||
in {
|
||||
services.anubis = {
|
||||
defaultOptions.settings = {
|
||||
USER_DEFINED_DEFAULT = true;
|
||||
};
|
||||
instances = {
|
||||
"gitea".settings = {
|
||||
TARGET = "http://localhost:${toString config.services.gitea.settings.server.HTTP_PORT}";
|
||||
USER_DEFINED_INSTANCE = true;
|
||||
OG_PASSTHROUGH = true;
|
||||
SERVE_ROBOTS_TXT = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
users.users.nginx.extraGroups = [ config.services.anubis.instances."gitea".group ];
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
appName = "code.kmein.de";
|
||||
appName = domain;
|
||||
settings = {
|
||||
server.ROOT_URL = domain;
|
||||
server.ROOT_URL = "https://${domain}";
|
||||
server.DOMAIN = domain;
|
||||
server.SSH_PORT = sshPort;
|
||||
service.DISABLE_REGISTRATION = true;
|
||||
};
|
||||
};
|
||||
services.nginx.virtualHosts."code.kmein.de" = {
|
||||
services.nginx.virtualHosts.${domain} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
locations."/".extraConfig = "proxy_pass http://localhost:3000;";
|
||||
# locations."/".extraConfig = "proxy_pass http://localhost:3000;";
|
||||
locations = {
|
||||
"/" = {
|
||||
proxyPass = "http://unix:${config.services.anubis.instances."gitea".settings.BIND}";
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
"/metrics".proxyPass = "http://unix:${config.services.anubis.instances."gitea".settings.METRICS_BIND}";
|
||||
};
|
||||
};
|
||||
|
||||
niveum.passport.services = [
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user