Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a31717c27 |
@@ -1,38 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
set -euf
|
|
||||||
|
|
||||||
pl() {
|
|
||||||
for i in $(seq $1 $(expr $2 - 1)); do
|
|
||||||
printf '\e[38;5;%sm%03i\e[m ' $i $i
|
|
||||||
done
|
|
||||||
printf '\e[38;5;%sm%03i\e[m\n' $2 $2
|
|
||||||
}
|
|
||||||
|
|
||||||
p() {
|
|
||||||
printf '\e[38;5;%sm%03i\e[m ' $1 $1
|
|
||||||
}
|
|
||||||
pn() {
|
|
||||||
printf '\e[38;5;%sm%03i\e[m\n' $1 $1
|
|
||||||
}
|
|
||||||
|
|
||||||
p6x6() {
|
|
||||||
for i in $(seq 0 5); do
|
|
||||||
for j in $(seq 0 5); do
|
|
||||||
p $(expr $1 + $i + $j \* 6)
|
|
||||||
done
|
|
||||||
echo
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
pl 0 7
|
|
||||||
pl 8 15
|
|
||||||
|
|
||||||
p6x6 16
|
|
||||||
p6x6 52
|
|
||||||
p6x6 88
|
|
||||||
p6x6 124
|
|
||||||
p6x6 160
|
|
||||||
p6x6 196
|
|
||||||
|
|
||||||
pl 232 243
|
|
||||||
pl 244 255
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
file="${1?please supply a poetry file}"
|
|
||||||
[ -f "$file" ] || {
|
|
||||||
echo "'$file' is no file"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
poem="$(mktemp)"
|
|
||||||
clean () {
|
|
||||||
rm "$poem"
|
|
||||||
}
|
|
||||||
trap clean EXIT
|
|
||||||
sed '/^$/d' "$file" > "$poem"
|
|
||||||
|
|
||||||
htmlize() {
|
|
||||||
awk 'ORS="<br/>"' \
|
|
||||||
| head -c -5 # remove final <br/> characters
|
|
||||||
}
|
|
||||||
|
|
||||||
for line_number in $(seq 1 "$(wc -l "$poem" | cut -d' ' -f1)"); do
|
|
||||||
if [ "$line_number" -gt 3 ] && [ "$line_number" -gt 1 ]; then
|
|
||||||
sed -n "$((line_number - 3)),$((line_number - 1))p" "$poem"
|
|
||||||
else
|
|
||||||
sed -n "1,$((line_number - 1))p" "$poem"
|
|
||||||
fi | htmlize
|
|
||||||
printf '\t'
|
|
||||||
sed -n "${line_number},+1p" "$poem" | htmlize
|
|
||||||
printf '\n'
|
|
||||||
done
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
#!/usr/bin/env -S sed -f
|
|
||||||
s/ā̊/𐬃/g
|
|
||||||
s/t̰/𐬝/g
|
|
||||||
s/ṣ̌/𐬴/g
|
|
||||||
s/š́/𐬳/g
|
|
||||||
s/ą̄/𐬅/g
|
|
||||||
s/ŋᵛ/𐬤/g
|
|
||||||
s/ə̄/𐬇/g
|
|
||||||
s/ŋ́/𐬣/g
|
|
||||||
s/x́/𐬒/g
|
|
||||||
s/xᵛ/𐬓/g
|
|
||||||
s/a/𐬀/g
|
|
||||||
s/ā/𐬁/g
|
|
||||||
s/å/𐬂/g
|
|
||||||
s/ą/𐬄/g
|
|
||||||
s/ə/𐬆/g
|
|
||||||
s/e/𐬈/g
|
|
||||||
s/ē/𐬉/g
|
|
||||||
s/o/𐬊/g
|
|
||||||
s/ō/𐬋/g
|
|
||||||
s/i/𐬌/g
|
|
||||||
s/ī/𐬍/g
|
|
||||||
s/u/𐬎/g
|
|
||||||
s/ū/𐬏/g
|
|
||||||
s/k/𐬐/g
|
|
||||||
s/x/𐬑/g
|
|
||||||
s/g/𐬔/g
|
|
||||||
s/ġ/𐬕/g
|
|
||||||
s/γ/𐬖/g
|
|
||||||
s/c/𐬗/g
|
|
||||||
s/j/𐬘/g
|
|
||||||
s/t/𐬙/g
|
|
||||||
s/θ/𐬚/g
|
|
||||||
s/d/𐬛/g
|
|
||||||
s/δ/𐬜/g
|
|
||||||
s/p/𐬞/g
|
|
||||||
s/f/𐬟/g
|
|
||||||
s/b/𐬠/g
|
|
||||||
s/β/𐬡/g
|
|
||||||
s/ŋ/𐬢/g
|
|
||||||
s/n/𐬥/g
|
|
||||||
s/ń/𐬦/g
|
|
||||||
s/ṇ/𐬧/g
|
|
||||||
s/m/𐬨/g
|
|
||||||
s/m̨/𐬩/g
|
|
||||||
s/ẏ/𐬫/g
|
|
||||||
s/y/𐬪/g
|
|
||||||
s/v/𐬬/g
|
|
||||||
s/r/𐬭/g
|
|
||||||
s/s/𐬯/g
|
|
||||||
s/z/𐬰/g
|
|
||||||
s/š/𐬱/g
|
|
||||||
s/ž/𐬲/g
|
|
||||||
s/h/𐬵/g
|
|
||||||
24
.bin/browser
@@ -1,24 +0,0 @@
|
|||||||
#!/bin/sh -e
|
|
||||||
#
|
|
||||||
# Usage: browser
|
|
||||||
# pipe html to a browser
|
|
||||||
# e.g.
|
|
||||||
# $ echo '<h1>hi mom!</h1>' | browser
|
|
||||||
# $ ron -5 man/rip.5.ron | browser
|
|
||||||
|
|
||||||
if [ -t 0 ]; then
|
|
||||||
if [ -n "$1" ]; then
|
|
||||||
open $1
|
|
||||||
else
|
|
||||||
cat <<usage
|
|
||||||
Usage: browser
|
|
||||||
pipe html to a browser
|
|
||||||
$ echo '<h1>hi mom!</h1>' | browser
|
|
||||||
$ ron -5 man/rip.5.ron | browser
|
|
||||||
usage
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
f="/tmp/browser.$RANDOM.html"
|
|
||||||
cat /dev/stdin > $f
|
|
||||||
xdg-open $f
|
|
||||||
fi
|
|
||||||
46
.bin/bvg.sh
@@ -1,46 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
interesting="U6 N6 140 M46 184 N84"
|
|
||||||
|
|
||||||
curl -sSL 'https://www.bvg.de/disruption-reports/q' \
|
|
||||||
--data-raw '{"variables":{},"query":"{
|
|
||||||
allDisruptions {
|
|
||||||
disruptions {
|
|
||||||
meldungsId
|
|
||||||
linie
|
|
||||||
verkehrsmittel
|
|
||||||
__typename
|
|
||||||
... on Traffic {
|
|
||||||
datum
|
|
||||||
gueltigVonDatum
|
|
||||||
gueltigVonZeit
|
|
||||||
gueltigBisDatum
|
|
||||||
gueltigBisZeit
|
|
||||||
richtungName
|
|
||||||
richtungHafasId
|
|
||||||
beginnAbschnittName
|
|
||||||
beginnAbschnittHafasId
|
|
||||||
endeAbschnittName
|
|
||||||
endeAbschnittHafasId
|
|
||||||
textIntUrsache
|
|
||||||
sev
|
|
||||||
textIntAuswirkung
|
|
||||||
umfahrung
|
|
||||||
textWAPSMSUrsache
|
|
||||||
textWAPSMSAuswirkung
|
|
||||||
prioritaet
|
|
||||||
__typename
|
|
||||||
}
|
|
||||||
}
|
|
||||||
__typename
|
|
||||||
}
|
|
||||||
}"}' \
|
|
||||||
| jq --arg interesting "$interesting" '
|
|
||||||
.data.allDisruptions.disruptions
|
|
||||||
| map(select(
|
|
||||||
(.linie as $linie
|
|
||||||
| $interesting
|
|
||||||
| split(" ")
|
|
||||||
| index($linie))
|
|
||||||
and (.["__typename"] == "Traffic")
|
|
||||||
))
|
|
||||||
'
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
directory="$(mktemp -d)"
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm -rf "$directory"
|
|
||||||
}
|
|
||||||
|
|
||||||
year=$(date +%Y)
|
|
||||||
output=/tmp/$year.pdf
|
|
||||||
|
|
||||||
for month in $(seq 1 12); do
|
|
||||||
printf "\r%d" "$month" 1>&2
|
|
||||||
astrolog -zN Berlin -qm "$month" "$year" -X -K -XA -Xr -Xm -Xb -Xo "$(printf "%s/%02d.bmp" "$directory" "$month")" -Xw 1080 720 2>/dev/null
|
|
||||||
done
|
|
||||||
printf "\r"
|
|
||||||
|
|
||||||
convert "$directory/*.bmp" "$output"
|
|
||||||
echo "$output"
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
usage() {
|
|
||||||
echo >&2 "$0 add-{reddit,telegram,youtube,twitch,twitter} NAME"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
candyman() {
|
|
||||||
curl -fsSv http://news.r/api -H content-type:application/json -d "$(jq -n "
|
|
||||||
{
|
|
||||||
command: \"PRIVMSG\",
|
|
||||||
params: [\"#all\", \"candyman: $1 $2\"]
|
|
||||||
}
|
|
||||||
")"
|
|
||||||
}
|
|
||||||
|
|
||||||
[ $# -ge 2 ] || usage
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
add-reddit|add-telegram|add-youtube|add-twitter|add-twitch)
|
|
||||||
candyman "$@"
|
|
||||||
;;
|
|
||||||
*) usage;;
|
|
||||||
esac
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#! /usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash -p pdftk gnugrep
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
INPUT_FILE="${2:?Pass the PDF path as second argument.}"
|
|
||||||
PAGES_PER_REPORT="${1:?Pass the chunk size as first argument.}"
|
|
||||||
|
|
||||||
if [ ! -f "$INPUT_FILE" ]; then
|
|
||||||
echo >&2 "File $INPUT_FILE does not exist."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
TOTAL_PAGES="$(pdftk "$INPUT_FILE" dump_data | grep NumberOfPages | cut -f2 -d' ')"
|
|
||||||
|
|
||||||
RUNS=$((TOTAL_PAGES/PAGES_PER_REPORT))
|
|
||||||
|
|
||||||
for run in $(seq 0 "$((RUNS-1))"); do
|
|
||||||
start_page=$((run*PAGES_PER_REPORT+1))
|
|
||||||
end_page=$(((run+1)*PAGES_PER_REPORT))
|
|
||||||
output_file="chunk_$((run+1)).pdf"
|
|
||||||
echo "splitting $INPUT_FILE from $start_page to $end_page into $output_file"
|
|
||||||
pdftk "$INPUT_FILE" cat "$start_page-$end_page" output "$output_file"
|
|
||||||
done
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/usr/bin/env -S awk -f
|
|
||||||
function z() {
|
|
||||||
getline < "/proc/uptime"
|
|
||||||
close("/proc/uptime")
|
|
||||||
return $0
|
|
||||||
}
|
|
||||||
BEGIN {
|
|
||||||
x = z()
|
|
||||||
while (1) {
|
|
||||||
y = z()
|
|
||||||
printf "%02d:%05.2f\r", (y - x) / 60, (y - x) % 60
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import csv
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
import argparse
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument("--delimiter", "-d", default=",", help="CSV field separator")
|
|
||||||
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
json.dump(list(csv.DictReader(sys.stdin, delimiter=args.delimiter)), sys.stdout)
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
name=$RANDOM
|
|
||||||
url='http://localhost:9093/api/v1/alerts'
|
|
||||||
|
|
||||||
echo "firing up alert $name"
|
|
||||||
|
|
||||||
# change url o
|
|
||||||
curl -XPOST $url -d "[{
|
|
||||||
\"status\": \"firing\",
|
|
||||||
\"labels\": {
|
|
||||||
\"alertname\": \"$name\",
|
|
||||||
\"service\": \"my-service\",
|
|
||||||
\"severity\":\"warning\",
|
|
||||||
\"instance\": \"$name.example.net\"
|
|
||||||
},
|
|
||||||
\"annotations\": {
|
|
||||||
\"summary\": \"High latency is high!\"
|
|
||||||
},
|
|
||||||
\"generatorURL\": \"http://prometheus.int.example.net/<generating_expression>\"
|
|
||||||
}]"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
|
|
||||||
echo "press enter to resolve alert"
|
|
||||||
read
|
|
||||||
|
|
||||||
echo "sending resolve"
|
|
||||||
curl -XPOST $url -d "[{
|
|
||||||
\"status\": \"resolved\",
|
|
||||||
\"labels\": {
|
|
||||||
\"alertname\": \"$name\",
|
|
||||||
\"service\": \"my-service\",
|
|
||||||
\"severity\":\"warning\",
|
|
||||||
\"instance\": \"$name.example.net\"
|
|
||||||
},
|
|
||||||
\"annotations\": {
|
|
||||||
\"summary\": \"High latency is high!\"
|
|
||||||
},
|
|
||||||
\"generatorURL\": \"http://prometheus.int.example.net/<generating_expression>\"
|
|
||||||
}]"
|
|
||||||
|
|
||||||
echo ""
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#! /usr/bin/env nix-shell
|
|
||||||
#! nix-shell -p "(import <nixpkgs> { overlays = [ (import ~/work/fysiweb/engiadina-pwa/devops/pkgs) ]; }).elm-publish-private"
|
|
||||||
#! nix-shell -i bash
|
|
||||||
|
|
||||||
set -efux
|
|
||||||
|
|
||||||
exec elm-publish-private "$@"
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#!/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
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
# Berlin: -d lodeg=13 -d lomin=22 -d losec=41 -d lodir=E -d ladeg=52 -d lamin=27 -d lasec=42 -d ladir=N -d usecoords=1 \
|
|
||||||
# Kassel: -d lodeg=9 -d lomin=32 -d losec=5 -d lodir=E -d ladeg=51 -d lamin=18 -d lasec=17 -d ladir=N -d usecoords=1 \
|
|
||||||
|
|
||||||
|
|
||||||
[ $# -eq 1 ] || {
|
|
||||||
echo >&2 Usage: "$0" TIMESTAMP
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
export TZ=UTC
|
|
||||||
|
|
||||||
chart_path="$(mktemp /tmp/chart_XXX.pdf)"
|
|
||||||
|
|
||||||
timestamp="$1"
|
|
||||||
|
|
||||||
year="$(date -d "@$timestamp" +%Y)"
|
|
||||||
month="$(date -d "@$timestamp" +%m)"
|
|
||||||
day="$(date -d "@$timestamp" +%d)"
|
|
||||||
hour="$(date -d "@$timestamp" +%H)"
|
|
||||||
minute="$(date -d "@$timestamp" +%M)"
|
|
||||||
|
|
||||||
curl -sSL 'https://edifyingfellowship.org/astro/' \
|
|
||||||
-d lodeg=9 -d lomin=32 -d losec=5 -d lodir=E -d ladeg=51 -d lamin=18 -d lasec=17 -d ladir=N -d usecoords=1 \
|
|
||||||
-d ybyr="$year" -d ybmo="$month" -d ybdy="$day" -d ybhr="$hour" -d ybmi="$minute" -d ybsc=0 -d ybtz="$TZ" \
|
|
||||||
-d currenttime=0 \
|
|
||||||
-d title="$timestamp" \
|
|
||||||
-d options[]=VancouverWheel -d options[]=Arrow -d options[]=XBold -d options[]=HouseLabels -d options[]=Placidus \
|
|
||||||
-d options[]=Sun -d options[]=Moon -d options[]=Mercury -d options[]=Venus -d options[]=Mars -d options[]=Jupiter -d options[]=Saturn -d options[]=Uranus -d options[]=Neptune -d options[]=Pluto -d options[]=Ascendant -d options[]=MC -d options[]=Lilith -d options[]=MeanNode -d options[]=TrueNode \
|
|
||||||
-d aspectpct=100 -d format=PDF -d Submit= -o "$chart_path"
|
|
||||||
|
|
||||||
zathura "$chart_path"
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
import csv
|
|
||||||
import json
|
|
||||||
import sys
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
json_list = json.load(sys.stdin)
|
|
||||||
if not isinstance(json_list, list):
|
|
||||||
print("JSON object is not a list.", file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
if len(json_list) == 0:
|
|
||||||
print("JSON list is empty.", file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
keys = set()
|
|
||||||
for element in json_list:
|
|
||||||
if isinstance(element, dict):
|
|
||||||
keys |= element.keys()
|
|
||||||
else:
|
|
||||||
print("Non-dict element:", element, file=sys.stderr)
|
|
||||||
sys.exit(1)
|
|
||||||
writer = csv.DictWriter(sys.stdout, fieldnames=list(keys))
|
|
||||||
writer.writeheader()
|
|
||||||
for element in json_list:
|
|
||||||
writer.writerow(element)
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
#!/usr/bin/env -S jq -r -f
|
|
||||||
(map(keys) | add | unique) as $cols
|
|
||||||
| map(. as $row | $cols | map($row[.])) as $rows
|
|
||||||
| $cols, $rows[]
|
|
||||||
| @csv
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
session_id=7b638c194d9bda74f80043045018cc9e
|
|
||||||
|
|
||||||
declare -A libraries
|
|
||||||
|
|
||||||
libraries["Literatur"]=344428
|
|
||||||
libraries["Sprache"]=344160
|
|
||||||
libraries["Miscellanea"]=344427
|
|
||||||
libraries["Wissenschaft"]=344429
|
|
||||||
libraries["Relicta"]=565920
|
|
||||||
|
|
||||||
for library in ${!libraries[@]}
|
|
||||||
do
|
|
||||||
curl -sSL 'https://www.libib.com/library/functions/csv-export.php' -H "Cookie: PHPSESSID=$session_id" -d export="${libraries[$library]}" > "$library.csv"
|
|
||||||
done
|
|
||||||
@@ -1,81 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
if echo "$1" | grep -Eq '[[:digit:]]{5}'; then
|
|
||||||
PLZ="$1"
|
|
||||||
else
|
|
||||||
echo >&2 "Usage: $0 PLZ"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
lieferando_dir=/tmp/lieferando
|
|
||||||
mkdir -p "$lieferando_dir/$PLZ"
|
|
||||||
|
|
||||||
fetch_restaurants() {
|
|
||||||
cache_path="$lieferando_dir/$PLZ.json"
|
|
||||||
|
|
||||||
if [ -r "$cache_path" ]; then
|
|
||||||
cat "$cache_path"
|
|
||||||
else
|
|
||||||
w3m -dump_source "http://www.lieferando.de/$PLZ" \
|
|
||||||
| gunzip \
|
|
||||||
| sed -n '/var restaurants/,/];$/p' \
|
|
||||||
| sed 's/var restaurants =//;$s/;$//' \
|
|
||||||
| prettier --parser=json \
|
|
||||||
| jq '
|
|
||||||
map({
|
|
||||||
name: .[30] | .name,
|
|
||||||
category: .[30] |.categories | split(", "),
|
|
||||||
url: "http://lieferando.de\(.[30] | .url)",
|
|
||||||
minutes: .[19],
|
|
||||||
minimum: .[10],
|
|
||||||
delivery: .[14]
|
|
||||||
})' \
|
|
||||||
| tee "$cache_path"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch_menu() {
|
|
||||||
[ $# -eq 1 ] || exit 1
|
|
||||||
|
|
||||||
slug="$(echo "$1" | sed 's!.*/!!')"
|
|
||||||
cache_path="$lieferando_dir/$PLZ/$slug.json"
|
|
||||||
|
|
||||||
if [ -r "$cache_path" ]; then
|
|
||||||
cat "$cache_path"
|
|
||||||
else
|
|
||||||
w3m -dump_source "$1" \
|
|
||||||
| gunzip \
|
|
||||||
| sed -n '/var MenucardProducts/,/\];/p' \
|
|
||||||
| sed 's/var MenucardProducts =//;s/;$//' \
|
|
||||||
| jq -r '
|
|
||||||
unique_by(.productId)
|
|
||||||
| group_by(.categoryId)
|
|
||||||
| flatten
|
|
||||||
' \
|
|
||||||
| tee "$cache_path"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
data="$(fetch_restaurants)"
|
|
||||||
|
|
||||||
# echo "$data" | jq -c '.[]' | while read -r restaurant; do
|
|
||||||
# fetch_menu "$(echo "$restaurant" | jq -r .url)"
|
|
||||||
# done
|
|
||||||
|
|
||||||
selected_categories="$(echo "$data" | jq -r 'map(.category) | flatten | unique | .[]' | fzf -m)"
|
|
||||||
|
|
||||||
selected_restaurant_url="$(echo "$selected_categories" | jq --argjson restaurants "$data" -sRr '
|
|
||||||
split("\n")[:-1] as $categories
|
|
||||||
| $restaurants[]
|
|
||||||
| select(.category - $categories != .category)
|
|
||||||
| "\(.name) [🚴\(.minutes)min 💰\(.minimum)€ + \(.delivery)€] (\(.url))"
|
|
||||||
' \
|
|
||||||
| fzf \
|
|
||||||
| sed 's/.*(//;s/)$//'
|
|
||||||
)"
|
|
||||||
|
|
||||||
fetch_menu "$selected_restaurant_url" \
|
|
||||||
| jq -r '.[] | "\(.price)\t\(.name)"' \
|
|
||||||
| fzf -m \
|
|
||||||
| awk '{print $0; sum += $1} END {print "-----"; print sum}'
|
|
||||||
17
.bin/lit.awk
@@ -1,17 +0,0 @@
|
|||||||
BEGIN {
|
|
||||||
if (!comment) comment = "--";
|
|
||||||
if (!begin) begin = "\\begin{code}";
|
|
||||||
if (!end) end = "\\end{code}";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
if ($0 == begin) {
|
|
||||||
code = 1;
|
|
||||||
print comment, $0;
|
|
||||||
} else if ($0 == end) {
|
|
||||||
code = 0;
|
|
||||||
print comment, $0;
|
|
||||||
} else {
|
|
||||||
if (code) print $0;
|
|
||||||
else print comment, $0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
set -efu
|
|
||||||
exec curl -fSs --unix-socket /tmp/much.api.sock http://localhost/current/part
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# usage: mail-current-query-find-part-by-name NAME
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
name=$1
|
|
||||||
|
|
||||||
query=$(mail-current-query)
|
|
||||||
result=$(notmuch show --entire-thread=false --format=json "$query")
|
|
||||||
|
|
||||||
part_id=$(printf %s "$result" | jq --arg name "$name" '
|
|
||||||
[
|
|
||||||
recurse |
|
|
||||||
select(type == "object") |
|
|
||||||
{ id, name: .filename } |
|
|
||||||
select(.id != null and .name != null)
|
|
||||||
] |
|
|
||||||
map(select(.name == $name))[0].id
|
|
||||||
')
|
|
||||||
|
|
||||||
if test "$part_id" = null; then
|
|
||||||
printf 'error: could not find part with name %s\n' \
|
|
||||||
"$name" \
|
|
||||||
>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec notmuch show --part="$part_id" "$query"
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
#! /bin/sh
|
|
||||||
# usage: mail-current-query-find-part-by-type TYPE
|
|
||||||
set -efu
|
|
||||||
|
|
||||||
type=$1
|
|
||||||
|
|
||||||
query=$(mail-current-query)
|
|
||||||
result=$(notmuch show --entire-thread=false --format=json "$query")
|
|
||||||
|
|
||||||
part_id=$(printf %s "$result" | jq --arg type "$type" '
|
|
||||||
#flatten|map(select(.!=null))[0].body[0] |
|
|
||||||
#
|
|
||||||
#if .["content-type"] == $type then
|
|
||||||
# .id
|
|
||||||
#elif .["content-type"] | test("^multipart/") then
|
|
||||||
# .content|map(select(.["content-type"]==$type))[0].id
|
|
||||||
#else
|
|
||||||
# null
|
|
||||||
#end
|
|
||||||
|
|
||||||
[
|
|
||||||
recurse |
|
|
||||||
select(type == "object") |
|
|
||||||
{ id, type: .["content-type"] } |
|
|
||||||
select(.id != null and .type != null)
|
|
||||||
] |
|
|
||||||
map(select(.type == $type))[0].id
|
|
||||||
')
|
|
||||||
|
|
||||||
if test "$part_id" = null; then
|
|
||||||
printf 'error: could not find part with type %s\n' \
|
|
||||||
"$type" \
|
|
||||||
>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
exec notmuch show --part="$part_id" "$query"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh mud@hotdog.r -t "MUD_NICKNAME=$LOGNAME mud"
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
curl -sSL 'https://diac.alsharekh.org/Diac/DiacText' \
|
|
||||||
-H "Content-Type: application/json" \
|
|
||||||
--data-raw "$(jq --raw-input '{word: ., type: 1}')" \
|
|
||||||
--compressed \
|
|
||||||
| jq -r .diacWord
|
|
||||||
@@ -1,93 +0,0 @@
|
|||||||
#! /usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash -p coreutils gnugrep gnused graphviz
|
|
||||||
#
|
|
||||||
# usage: nix-haddock-index
|
|
||||||
#
|
|
||||||
# Run this script in an environment where either NIX_GHC is set, or the ghc
|
|
||||||
# executable exists, to generate an HTML index file pointing to all Haddock
|
|
||||||
# files accessible to the respective ghc version.
|
|
||||||
#
|
|
||||||
# Additionally, an SVG dependency graph of all packages is linked at the
|
|
||||||
# bottom of the index file.
|
|
||||||
#
|
|
||||||
# Note: all files will be generated in /tmp, and won't be deleted automatically
|
|
||||||
#
|
|
||||||
|
|
||||||
set -efux
|
|
||||||
|
|
||||||
if test -z "${NIX_GHC-}"; then
|
|
||||||
NIX_GHC=$(readlink -f "$(type -P ghc)")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if ! echo $NIX_GHC | grep -q '^/nix/store/'; then
|
|
||||||
printf '%s: error: unsupported GHC executable path (not in Nix store): %q\n' \
|
|
||||||
"$0" \
|
|
||||||
"$NIX_GHC" \
|
|
||||||
>&2
|
|
||||||
exit -1
|
|
||||||
fi
|
|
||||||
|
|
||||||
NIX_GHC_PREFIX=$(dirname "$(dirname "$NIX_GHC")")
|
|
||||||
NIX_GHC_DOCDIR=$NIX_GHC_PREFIX/share/doc/ghc/html
|
|
||||||
|
|
||||||
main() {
|
|
||||||
|
|
||||||
hash=$(echo $NIX_GHC_PREFIX | sed -n 's|^/nix/store/\([a-z0-9]\+\).*|\1|p')
|
|
||||||
title="Haddock index for $NIX_GHC_PREFIX"
|
|
||||||
|
|
||||||
header=$(
|
|
||||||
printf 'Haddock index for <a href="%s">%s</a>\n' \
|
|
||||||
$NIX_GHC_PREFIX \
|
|
||||||
$NIX_GHC_PREFIX \
|
|
||||||
)
|
|
||||||
|
|
||||||
suffix=${hash:+-$hash}
|
|
||||||
index_file=/tmp/haddock$suffix-index.html
|
|
||||||
svg_file=/tmp/haddock$suffix.svg
|
|
||||||
|
|
||||||
#if ! test -e $index_file; then
|
|
||||||
eval "$(
|
|
||||||
echo 'gen_index() {'
|
|
||||||
echo ' html_head'
|
|
||||||
"$NIX_GHC_PREFIX"/bin/ghc-pkg dump | sed -n '
|
|
||||||
s/^---$/ reset/p
|
|
||||||
s/^\(name\|version\):\s*\([-A-Za-z0-9_.]\+\)$/ \1=\2/p
|
|
||||||
s/^haddock-html:\s*\([-A-Za-z0-9_./]\+\)$/ haddock_html \1/p
|
|
||||||
'
|
|
||||||
echo ' html_foot'
|
|
||||||
echo '}'
|
|
||||||
)"
|
|
||||||
|
|
||||||
gen_index > $index_file
|
|
||||||
#fi
|
|
||||||
|
|
||||||
#if ! test -e $svg_file; then
|
|
||||||
"$NIX_GHC_PREFIX"/bin/ghc-pkg dot | tred | dot -Tsvg | sed '
|
|
||||||
s/<svg width="[0-9]\+pt" height="[0-9]\+pt"/<svg width="3600px" height="100%"/
|
|
||||||
' > $svg_file
|
|
||||||
#fi
|
|
||||||
|
|
||||||
echo $index_file
|
|
||||||
}
|
|
||||||
reset() {
|
|
||||||
unset name version
|
|
||||||
}
|
|
||||||
haddock_html() {
|
|
||||||
printf '<li>'
|
|
||||||
printf '<a href="%s/index.html">%s</a>' "$1" "$name-$version"
|
|
||||||
printf '</li>\n'
|
|
||||||
}
|
|
||||||
html_head() {
|
|
||||||
printf '<!doctype html>\n'
|
|
||||||
printf '<title>%s</title>\n' "$title"
|
|
||||||
printf '<link href="%s" rel="stylesheet" type="text/css">\n' \
|
|
||||||
"$NIX_GHC_DOCDIR/libraries/ocean.css"
|
|
||||||
printf '<h1>%s</h1>\n' "$header"
|
|
||||||
printf '<ul>\n'
|
|
||||||
}
|
|
||||||
html_foot() {
|
|
||||||
printf '</ul>\n'
|
|
||||||
printf '<a href="%s">graph</a>\n' "$svg_file"
|
|
||||||
}
|
|
||||||
|
|
||||||
main "$@"
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# inspired by https://github.com/connermcd/bin/blob/1d38cb98812906d8b95dc6e51e1149e29261617d/notetags
|
|
||||||
|
|
||||||
cd "$HOME/notes/" || exit
|
|
||||||
|
|
||||||
[ -f tags ] && rm tags
|
|
||||||
grep -r 'tags:' ./* | while read -r line; do
|
|
||||||
file=$(echo "$line" | cut -d: -f1)
|
|
||||||
unparsed_tags=$(echo "$line" | cut -d: -f3) #
|
|
||||||
tags=$(echo "$unparsed_tags" | sed -e 's/tags: *//g' -e 's/[][,]//g')
|
|
||||||
for tag in $tags; do
|
|
||||||
echo "$tag $file /^$unparsed_tags$/;" >> tags
|
|
||||||
done
|
|
||||||
done
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
#!/usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i bash -p poppler_utils tesseract4
|
|
||||||
set -eu
|
|
||||||
|
|
||||||
pdf_path="$(realpath "$1")"
|
|
||||||
|
|
||||||
[ -f "$pdf_path" ] || {
|
|
||||||
echo "Usage: $0 FILE.pdf" >&2
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
tmpdir="$(mktemp -d)"
|
|
||||||
trap 'rm -rf $tmpdir' EXIT
|
|
||||||
|
|
||||||
cd "$tmpdir"
|
|
||||||
|
|
||||||
pdftoppm -png "$pdf_path" pdf-ocr
|
|
||||||
for png in pdf-ocr*.png; do
|
|
||||||
tesseract "$png" "$png.txt" 2>/dev/null
|
|
||||||
done
|
|
||||||
|
|
||||||
cat pdf-ocr-*.txt
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
youtube-dl -ij "$*" | jq -sr '.[] | .webpage_url'
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
lidl() {
|
|
||||||
echo LIDL
|
|
||||||
curl -sSL 'https://endpoints.lidl-flyer.com/v3/region-overview/lidl/de-DE/0.json' \
|
|
||||||
| jq -r '
|
|
||||||
.categories
|
|
||||||
| map(select(.name == "Filial-Angebote") | .subcategories | map(.flyers))
|
|
||||||
| flatten
|
|
||||||
| flatten
|
|
||||||
| .[]
|
|
||||||
| .pdfUrl
|
|
||||||
'
|
|
||||||
}
|
|
||||||
|
|
||||||
aldi_nord() {
|
|
||||||
echo ALDI nord
|
|
||||||
echo 'https://magazine.aldi-nord.de/aldi-nord/aldi-aktuell/GetPDF.ashx'
|
|
||||||
echo 'https://magazine.aldi-nord.de/aldi-nord/aldi-vorschau/GetPDF.ashx'
|
|
||||||
}
|
|
||||||
|
|
||||||
rewe_berlin() {(
|
|
||||||
store_id=662366923
|
|
||||||
publisher_id=1062
|
|
||||||
|
|
||||||
echo REWE
|
|
||||||
curl -sSL 'https://www.bonialserviceswidget.de/de/stores/'$store_id'/brochures?storeId='$store_id'&publisherId='$publisher_id | while read -r brochure_id; do
|
|
||||||
curl -sSL 'https://www.bonialserviceswidget.de/de/v5/brochureDetails/'"$brochure_id"'?publisherId='$publisher_id | jq -r .pdfUrl
|
|
||||||
done
|
|
||||||
)}
|
|
||||||
|
|
||||||
kaufland() {(
|
|
||||||
region_code=8920
|
|
||||||
echo KAUFLAND
|
|
||||||
curl -sSL https://filiale.kaufland.de/prospekte.html | htmlq --attribute href '.flyer a' | grep -Eo 'DE_de_KDZ[^/]*' | sed "s/_3000_/_${region_code}_/" | while read -r flyer_id; do
|
|
||||||
curl -sSL "https://endpoints.leaflets.kaufland.com/v3/$flyer_id/flyer.json?regionCode=$region_code" | jq -r .flyer.pdfUrl
|
|
||||||
done
|
|
||||||
)}
|
|
||||||
|
|
||||||
netto_schwarz() {
|
|
||||||
echo 'NETTO (schwarz)'
|
|
||||||
curl -sSL 'https://squid-api.tjek.com/v2/catalogs?dealer_ids=90f2VL&order_by=created' \
|
|
||||||
| jq -r '.[] | .id' \
|
|
||||||
| while read -r flyer_id; do
|
|
||||||
curl -sSL "https://squid-api.tjek.com/v2/catalogs/$flyer_id/download" \
|
|
||||||
| jq -r .pdf_url
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
dir="$(mktemp -d)"
|
|
||||||
trap clean EXIT
|
|
||||||
|
|
||||||
clean() {
|
|
||||||
rm -rf "$dir"
|
|
||||||
}
|
|
||||||
|
|
||||||
prospekt_url="$( (
|
|
||||||
lidl
|
|
||||||
aldi_nord
|
|
||||||
rewe_berlin
|
|
||||||
kaufland
|
|
||||||
netto_schwarz
|
|
||||||
) | fzf)"
|
|
||||||
|
|
||||||
curl -sSL "$prospekt_url" -o "$dir/prospekt.pdf"
|
|
||||||
zathura "$dir/prospekt.pdf"
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
curl -sSL https://www.netzwelt.de/proxy/index.html \
|
|
||||||
| pup ".tblc" \
|
|
||||||
| xml-to-json /dev/stdin \
|
|
||||||
| jq '
|
|
||||||
.div.table.tbody.tr
|
|
||||||
| map(
|
|
||||||
.td
|
|
||||||
| {
|
|
||||||
ip: .[0].a.value,
|
|
||||||
port: .[1],
|
|
||||||
country: .[2] | (if type == "string" then . else .a.value end),
|
|
||||||
security: .[3],
|
|
||||||
protocol: .[4]
|
|
||||||
}
|
|
||||||
)
|
|
||||||
'
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
curl -sSL "https://raw.githubusercontent.com/$*/master/README.md" \
|
|
||||||
| pandoc -f gfm -t man -s \
|
|
||||||
| man -l -
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
filepath="$(shuf --head-count=1)"
|
|
||||||
pages="$(pdfinfo "$filepath" | awk '/^Pages:/{print $2}')"
|
|
||||||
random_page="$(shuf --input-range="1-$pages" --head-count=1)"
|
|
||||||
zathura --page="$random_page" "$filepath"
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#! /usr/bin/env nix-shell
|
|
||||||
#! nix-shell -i sh -p coreutils byzanz xorg.xwininfo gnused
|
|
||||||
|
|
||||||
# shellcheck shell=sh
|
|
||||||
# ref https://gist.github.com/aforemny/0994cb7f06ea30d56c8b9681ff5d2054
|
|
||||||
|
|
||||||
set -eux
|
|
||||||
|
|
||||||
eval "$(xwininfo | \
|
|
||||||
sed -n -e 's/^ \+Absolute upper-left X: \+\([0-9]\+\).*/x=\1/p' \
|
|
||||||
-e 's/^ \+Absolute upper-left Y: \+\([0-9]\+\).*/y=\1/p' \
|
|
||||||
-e 's/^ \+Width: \+\([0-9]\+\).*/w=\1/p' \
|
|
||||||
-e 's/^ \+Height: \+\([0-9]\+\).*/h=\1/p')"
|
|
||||||
|
|
||||||
trap "pkill -f 'sleep 360d'" INT
|
|
||||||
byzanz-record -e "sleep 360d" -c -x $x -y $y -w $w -h $h "$@"
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import ephem
|
|
||||||
from datetime import datetime, date, timedelta
|
|
||||||
|
|
||||||
now = datetime.now()
|
|
||||||
limit = now + timedelta(days=365)
|
|
||||||
|
|
||||||
|
|
||||||
def events_until(limit):
|
|
||||||
initial_date = ephem.Date(datetime.now())
|
|
||||||
events = {}
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_full_moon(now)
|
|
||||||
events[now] = "🌕"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_new_moon(now)
|
|
||||||
events[now] = "🌑"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_vernal_equinox(now)
|
|
||||||
events[now] = "spring equinox"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_autumnal_equinox(now)
|
|
||||||
events[now] = "fall equinox"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_winter_solstice(now)
|
|
||||||
events[now] = "winter solstice"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_summer_solstice(now)
|
|
||||||
events[now] = "summer solstice"
|
|
||||||
return events
|
|
||||||
|
|
||||||
|
|
||||||
events = events_until(limit)
|
|
||||||
|
|
||||||
|
|
||||||
for date, event in sorted(events.items(), key=lambda x: x[0]):
|
|
||||||
if ephem.localtime(date) < limit:
|
|
||||||
print(ephem.localtime(date), event)
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
let
|
|
||||||
lib = import <nixpkgs/lib>;
|
|
||||||
in rec {
|
|
||||||
inherit lib;
|
|
||||||
|
|
||||||
input = [
|
|
||||||
{
|
|
||||||
x = ["pool" "zfs"];
|
|
||||||
y = ["mdadm" "raid1"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
x = ["pool" "zfs"];
|
|
||||||
y = ["disk" "sda"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
x = ["mdadm" "raid1"];
|
|
||||||
y = ["disk" "sdb"];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
x = ["mdadm" "raid1"];
|
|
||||||
y = ["disk" "sdc"];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
outNodes = node: graph:
|
|
||||||
lib.unique
|
|
||||||
(builtins.map (e: e.y)
|
|
||||||
(builtins.filter (v: v.x == node) graph));
|
|
||||||
|
|
||||||
vertices = graph:
|
|
||||||
lib.unique
|
|
||||||
(builtins.map (x: x.y) graph ++ builtins.map (x: x.x) graph);
|
|
||||||
|
|
||||||
deleteVertex = node: graph: (builtins.filter (v: v.x != node && v.y != node) graph);
|
|
||||||
|
|
||||||
findSink = graph:
|
|
||||||
lib.findFirst
|
|
||||||
(v: outNodes v graph == [])
|
|
||||||
(lib.trace graph (builtins.abort "No sink found"))
|
|
||||||
(vertices graph);
|
|
||||||
|
|
||||||
topSort = graph:
|
|
||||||
if graph == []
|
|
||||||
then []
|
|
||||||
else if builtins.length graph == 1
|
|
||||||
then let only = builtins.head graph; in [only.y only.x]
|
|
||||||
else let sink = findSink graph; in [sink] ++ topSort (deleteVertex sink graph);
|
|
||||||
|
|
||||||
output = topSort input;
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
#/usr/bin/env -S deno run -A:q
|
|
||||||
set -x
|
|
||||||
session_cache="$HOME/.cache/tt-rss.session"
|
|
||||||
ttrss_endpoint=https://feed.kmein.de/api/
|
|
||||||
ttrss_user=k
|
|
||||||
ttrss_password=$(pass shared/tt-rss/password)
|
|
||||||
|
|
||||||
login() {
|
|
||||||
if [ -f "$session_cache" ]; then
|
|
||||||
session_id="$(cat "$session_cache")"
|
|
||||||
else
|
|
||||||
session_id="$(curl -d '{"op":"login","user":"'"$ttrss_user"'","password":"'"$ttrss_password"'"}' "$ttrss_endpoint" | jq -r .content.session_id)"
|
|
||||||
echo "$session_id" > "$session_cache"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
login
|
|
||||||
curl -d '{"sid":"'"$session_id"'","op":"getUnread"}' "$ttrss_endpoint" | jq .content
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
set -efux
|
|
||||||
expected_max_results=1024 # the upper bound on the number of restaurants
|
|
||||||
radius=250
|
|
||||||
|
|
||||||
echo '[out:json];node(id:260050809)->.cbase;
|
|
||||||
(
|
|
||||||
node(around.cbase:'$radius')[amenity=fast_food];
|
|
||||||
node(around.cbase:'$radius')[amenity=restaurant];
|
|
||||||
);out;' \
|
|
||||||
| curl -sSL -d @- -X POST http://overpass-api.de/api/interpreter \
|
|
||||||
| jq --argjson random "$(shuf -i 0-$expected_max_results -n 1)" '
|
|
||||||
.elements
|
|
||||||
| length as $length
|
|
||||||
| .[$random % $length]
|
|
||||||
'
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
import sys
|
|
||||||
import unicodedata
|
|
||||||
|
|
||||||
for index, character in enumerate(sys.stdin.read().strip()):
|
|
||||||
try:
|
|
||||||
print(index, character, hex(ord(character)), unicodedata.category(character), unicodedata.name(character))
|
|
||||||
except:
|
|
||||||
print(index, character, hex(ord(character)))
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
project=Filli
|
|
||||||
year=2022
|
|
||||||
|
|
||||||
for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
|
|
||||||
from="$(date +%F -d "$month 1, $year")"
|
|
||||||
to="$(date +%F -d "$month 1, $year + 1 month")"
|
|
||||||
watson report --json --from "$from" --to "$to" --project "$project"
|
|
||||||
done | jq --slurp '
|
|
||||||
def in_array($arr):
|
|
||||||
. as $value | any($arr[]; . == $value);
|
|
||||||
|
|
||||||
map(
|
|
||||||
["engadin-app","fysiweb","val-muestair","mia-engiadina","ol"] as $official_projects
|
|
||||||
| (.timespan.from | .[0:7]) as $timespan
|
|
||||||
| .projects | .[0]
|
|
||||||
| .time as $total_time
|
|
||||||
| .tags
|
|
||||||
| select(. != null)
|
|
||||||
| map(select(.name | in_array($official_projects)))
|
|
||||||
| (map(.time)|add) as $official_time
|
|
||||||
| map({key:.name, value:.time}) | from_entries
|
|
||||||
| .other |= ($total_time - $official_time)
|
|
||||||
| map_values(. / (60*60) | ceil)
|
|
||||||
| .month |= $timespan
|
|
||||||
)
|
|
||||||
'
|
|
||||||
19
.github/workflows/flake.yml
vendored
@@ -1,19 +0,0 @@
|
|||||||
name: Update flake.lock
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # allows manual triggering
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lockfile:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v16
|
|
||||||
with:
|
|
||||||
extra_nix_config: |
|
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Update flake.lock
|
|
||||||
uses: DeterminateSystems/update-flake-lock@v3
|
|
||||||
39
.github/workflows/niveum.yml
vendored
@@ -1,39 +0,0 @@
|
|||||||
name: CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
system: [makanek,manakish,kabsa,zaatar,ful,fatteh]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- name: Install QEMU (ARM)
|
|
||||||
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
|
|
||||||
if: ${{ matrix.system == 'ful' }}
|
|
||||||
with:
|
|
||||||
extra_nix_config: |
|
|
||||||
system = aarch64-linux
|
|
||||||
- name: Install Nix (x86_64)
|
|
||||||
uses: cachix/install-nix-action@v16
|
|
||||||
if: ${{ matrix.system != 'ful' }}
|
|
||||||
- name: nixos-rebuild dry-build
|
|
||||||
run: |
|
|
||||||
# remove secrets: ref https://stackoverflow.com/questions/1260748/how-do-i-remove-a-submodule/36593218
|
|
||||||
git submodule deinit -f secrets
|
|
||||||
rm -rf .git/modules/secrets
|
|
||||||
git rm -f secrets
|
|
||||||
|
|
||||||
# recreate secrets
|
|
||||||
mkdir secrets
|
|
||||||
cat secrets.txt | while read -r path; do touch $path; done
|
|
||||||
git add secrets
|
|
||||||
|
|
||||||
nix run nixpkgs#nixos-rebuild -- dry-build --flake $GITHUB_WORKSPACE#${{matrix.system}}
|
|
||||||
6
.gitignore
vendored
@@ -1,6 +1,2 @@
|
|||||||
|
secrets.nix
|
||||||
result
|
result
|
||||||
.direnv
|
|
||||||
.envrc
|
|
||||||
.history
|
|
||||||
.todo
|
|
||||||
node_modules
|
|
||||||
|
|||||||
3
.gitmodules
vendored
@@ -1,3 +0,0 @@
|
|||||||
[submodule "secrets"]
|
|
||||||
path = secrets
|
|
||||||
url = ssh://gitea@code.kmein.de:22022/kfm/niveum-secrets.git
|
|
||||||
12
README.md
@@ -1,12 +0,0 @@
|
|||||||
# niveum
|
|
||||||
|
|
||||||
> [nĭvĕus](https://logeion.uchicago.edu/niveus), a, um, adj. [nix], _of_ or _from snow, snowy, snow-_ (poet.)
|
|
||||||
>
|
|
||||||
> 1. Lit.: aggeribus niveis informis, Verg. G. 3, 354: aqua, _cooled with snow_, Mart. 12, 17, 6; cf. id. 14, 104 and 117: mons, _covered with snow_, Cat. 64, 240.—
|
|
||||||
>
|
|
||||||
> 2. Transf., _snow-white, snowy_ (mostly poet.): a similitudine sic: Corpore niveum candorem, aspectu igneum ardorem assequebatur, Auct. Her. 4, 33, 44: lacerti, Verg. A. 8, 387: lac, id. E. 2, 20: hanc si capite niveae agnae exorari judicas, Sen. Q. N. 2, 36: Briseis niveo colore, Hor. C. 2, 4, 3: vestis, Ov. M. 10, 432: candidior nivei folio, Galatea, ligustri, id. ib. 13, 789: dens, id. H. 18, 18: quā notam duxit niveus videri, Hor. C. 4, 2, 59: panis, Juv. 5, 70: flumen, _clear, pellucid_, Sen. Hippol. 504: undae, Mart. 7, 32, 11: tribuni, _clothed in white togas_, Calp. Ecl. 7, 29; so, Quirites, Juv. 10, 45.
|
|
||||||
|
|
||||||
## Pressestimmen
|
|
||||||
> das ist ja pure poesie —[riotbib](https://github.com/riotbib/)
|
|
||||||
|
|
||||||
> Deine Configs sind wunderschön <3 —[flxai](https://github.com/flxai/)
|
|
||||||
BIN
art/.haskell-grey.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
art/37333571_p0_master1200.jpg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
art/55991392_p0_master1200.jpg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
art/58991926_p0_master1200.jpg
Normal file
|
After Width: | Height: | Size: 512 KiB |
BIN
art/59560674_p0_master1200.jpg
Normal file
|
After Width: | Height: | Size: 653 KiB |
BIN
art/68479906_p0_master1200.jpg
Normal file
|
After Width: | Height: | Size: 325 KiB |
BIN
art/69915574_p0_master1200.jpg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
art/d7ujb9p-e1389b42-5b67-422f-8f23-ddd280a7889a.jpg
Normal file
|
After Width: | Height: | Size: 477 KiB |
BIN
art/file (1).jpeg
Normal file
|
After Width: | Height: | Size: 1.4 MiB |
BIN
art/file.jpeg
Normal file
|
After Width: | Height: | Size: 2.0 MiB |
BIN
art/sky_full_of_stars_by_baxiaart_d7vsofp-fullview.jpg
Normal file
|
After Width: | Height: | Size: 66 KiB |
BIN
art/the_view_by_xlocky-d988pnv.jpg
Normal file
|
After Width: | Height: | Size: 2.5 MiB |
BIN
art/tumblr_p3p4cdjUB61qe959eo1_1280.jpg
Normal file
|
After Width: | Height: | Size: 345 KiB |
BIN
art/turn_into_stars_by_awanqi_d9z2go0-fullview.jpg
Normal file
|
After Width: | Height: | Size: 210 KiB |
@@ -1,119 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
niveumPackages,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
darwin = lib.strings.hasSuffix "-darwin" pkgs.system;
|
|
||||||
in {
|
|
||||||
environment.systemPackages =
|
|
||||||
[
|
|
||||||
pkgs.htop
|
|
||||||
pkgs.w3m
|
|
||||||
pkgs.wget
|
|
||||||
# ARCHIVE TOOLS
|
|
||||||
pkgs.unzip
|
|
||||||
pkgs.unrar
|
|
||||||
pkgs.p7zip
|
|
||||||
pkgs.sshuttle
|
|
||||||
pkgs.zip
|
|
||||||
# MONITORS
|
|
||||||
pkgs.iftop # interface bandwidth monitor
|
|
||||||
pkgs.lsof # list open files
|
|
||||||
# SHELL
|
|
||||||
pkgs.sqlite
|
|
||||||
pkgs.fd # better find
|
|
||||||
pkgs.tree
|
|
||||||
pkgs.parallel # for parallel, since moreutils shadows task spooler
|
|
||||||
pkgs.ripgrep # better grep
|
|
||||||
pkgs.rlwrap
|
|
||||||
pkgs.progress # display progress bars for pipes
|
|
||||||
pkgs.file # determine file type
|
|
||||||
pkgs.gdu # ncurses disk usage (ncdu is broken)
|
|
||||||
pkgs.rmlint # remove duplicate files
|
|
||||||
pkgs.jq # json toolkit
|
|
||||||
pkgs.jless # less(1) for json
|
|
||||||
pkgs.fq # toolkit for yaml, xml and binaries
|
|
||||||
pkgs.bc # calculator
|
|
||||||
pkgs.pari # gp -- better calculator
|
|
||||||
pkgs.ts
|
|
||||||
niveumPackages.vimv
|
|
||||||
niveumPackages.vg
|
|
||||||
niveumPackages.fkill
|
|
||||||
niveumPackages.cyberlocker-tools
|
|
||||||
niveumPackages.untilport
|
|
||||||
niveumPackages.kpaste
|
|
||||||
# HARDWARE
|
|
||||||
pkgs.pciutils # for lspci
|
|
||||||
]
|
|
||||||
++ lib.optionals (!darwin) [
|
|
||||||
pkgs.usbutils # for lsusb
|
|
||||||
pkgs.lshw # for lshw
|
|
||||||
pkgs.iotop # I/O load monitor
|
|
||||||
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"
|
|
||||||
'';
|
|
||||||
cdt = pkgs.writers.writeDash "cdt" ''
|
|
||||||
cd "$(mktemp -d)"
|
|
||||||
pwd
|
|
||||||
'';
|
|
||||||
wcd = pkgs.writers.writeDash "wcd" ''
|
|
||||||
cd "$(readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname)/.."
|
|
||||||
'';
|
|
||||||
where = pkgs.writers.writeDash "where" ''
|
|
||||||
readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname
|
|
||||||
'';
|
|
||||||
in
|
|
||||||
{
|
|
||||||
nixi = "nix repl '<nixpkgs>'";
|
|
||||||
take = "source ${take}";
|
|
||||||
wcd = "source ${wcd}";
|
|
||||||
where = "source ${where}";
|
|
||||||
# temporary files and directories
|
|
||||||
cdt = "source ${cdt}";
|
|
||||||
vit = "$EDITOR $(mktemp)";
|
|
||||||
# file safety
|
|
||||||
mv = "${pkgs.coreutils}/bin/mv --interactive";
|
|
||||||
rm = "${pkgs.coreutils}/bin/rm --interactive";
|
|
||||||
cp = "${pkgs.coreutils}/bin/cp --interactive";
|
|
||||||
# colours
|
|
||||||
cat = "${pkgs.bat}/bin/bat --theme=ansi --style=plain";
|
|
||||||
l = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all";
|
|
||||||
ls = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso";
|
|
||||||
ll = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso -l";
|
|
||||||
la = "${pkgs.coreutils}/bin/ls --color=auto --time-style=long-iso --almost-all -l";
|
|
||||||
}
|
|
||||||
// (
|
|
||||||
if darwin
|
|
||||||
then {}
|
|
||||||
else {
|
|
||||||
"ß" = "${pkgs.util-linux}/bin/setsid";
|
|
||||||
ip = "${pkgs.iproute2}/bin/ip -c";
|
|
||||||
# systemd
|
|
||||||
s = "${pkgs.systemd}/bin/systemctl";
|
|
||||||
us = "${pkgs.systemd}/bin/systemctl --user";
|
|
||||||
j = "${pkgs.systemd}/bin/journalctl";
|
|
||||||
uj = "${pkgs.systemd}/bin/journalctl --user";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
323
configs/aerc.nix
@@ -1,323 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
niveumPackages,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import ../lib/email.nix) defaults thunderbirdProfile;
|
|
||||||
in {
|
|
||||||
age.secrets = {
|
|
||||||
email-password-cock = {
|
|
||||||
file = ../secrets/email-password-cock.age;
|
|
||||||
owner = config.users.users.me.name;
|
|
||||||
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;
|
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "400";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
|
||||||
accounts.email.maildirBasePath = "${config.users.users.me.home}/state/Maildir";
|
|
||||||
|
|
||||||
services.mbsync = {
|
|
||||||
enable = true;
|
|
||||||
frequency = "daily";
|
|
||||||
preExec = "${pkgs.coreutils}/bin/mkdir -p ${config.home-manager.users.me.accounts.email.maildirBasePath}";
|
|
||||||
postExec = "${pkgs.notmuch}/bin/notmuch new";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.notmuch = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = {
|
|
||||||
database.path = config.home-manager.users.me.accounts.email.maildirBasePath;
|
|
||||||
new.tags = "";
|
|
||||||
user.name = defaults.realName;
|
|
||||||
user.primary_email = config.home-manager.users.me.accounts.email.accounts.posteo.address;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.mbsync = {
|
|
||||||
enable = true;
|
|
||||||
extraConfig = lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: ''
|
|
||||||
IMAPAccount ${name}
|
|
||||||
CertificateFile /etc/ssl/certs/ca-certificates.crt
|
|
||||||
Host ${account.imap.host}
|
|
||||||
PassCmd "${toString account.passwordCommand}"
|
|
||||||
User ${account.userName}
|
|
||||||
SSLType IMAPS
|
|
||||||
${lib.optionalString (lib.isInt account.imap.port) "Port ${toString account.imap.port}"}
|
|
||||||
|
|
||||||
IMAPStore ${name}-remote
|
|
||||||
Account ${name}
|
|
||||||
|
|
||||||
MaildirStore ${name}-local
|
|
||||||
Path ${config.home-manager.users.me.accounts.email.maildirBasePath}/${name}/
|
|
||||||
SubFolders Verbatim
|
|
||||||
|
|
||||||
Channel ${name}
|
|
||||||
Create Near
|
|
||||||
Expunge None
|
|
||||||
Far :${name}-remote:
|
|
||||||
Near :${name}-local:
|
|
||||||
Patterns *
|
|
||||||
Remove None
|
|
||||||
SyncState *
|
|
||||||
'')
|
|
||||||
config.home-manager.users.me.accounts.email.accounts);
|
|
||||||
};
|
|
||||||
|
|
||||||
accounts.email.accounts = {
|
|
||||||
cock =
|
|
||||||
lib.recursiveUpdate defaults
|
|
||||||
rec {
|
|
||||||
address = "2210@cock.li";
|
|
||||||
userName = address;
|
|
||||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-cock.path}";
|
|
||||||
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
|
|
||||||
rec {
|
|
||||||
address = "kieran.meinhardt@posteo.net";
|
|
||||||
aliases = ["kmein@posteo.de"];
|
|
||||||
userName = address;
|
|
||||||
imap.host = "posteo.de";
|
|
||||||
imap.port = 993;
|
|
||||||
imap.tls.enable = true;
|
|
||||||
smtp.host = imap.host;
|
|
||||||
smtp.port = 465;
|
|
||||||
smtp.tls.enable = true;
|
|
||||||
primary = true;
|
|
||||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-posteo.path}";
|
|
||||||
himalaya = {
|
|
||||||
enable = true;
|
|
||||||
settings.backend = "imap";
|
|
||||||
};
|
|
||||||
aerc.extraAccounts.pgp-key-id = "9EDE82CC72A343A95266D0F444857074A3ACC8B7";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.himalaya.enable = true;
|
|
||||||
|
|
||||||
programs.thunderbird = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
};
|
|
||||||
profiles.${thunderbirdProfile} = {
|
|
||||||
isDefault = true;
|
|
||||||
settings = {
|
|
||||||
"mail.default_send_format" = 1;
|
|
||||||
"msgcompose.default_colors" = false;
|
|
||||||
"msgcompose.text_color" = config.lib.stylix.colors.withHashtag.base00;
|
|
||||||
"msgcompose.background_color" = config.lib.stylix.colors.withHashtag.base05;
|
|
||||||
};
|
|
||||||
userChrome = ''
|
|
||||||
'';
|
|
||||||
userContent = ''
|
|
||||||
'';
|
|
||||||
withExternalGnupg = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.aerc = {
|
|
||||||
enable = true;
|
|
||||||
|
|
||||||
extraBinds = {
|
|
||||||
# Binds are of the form <key sequence> = <command to run>
|
|
||||||
# To use '=' in a key sequence, substitute it with "Eq": "<Ctrl+Eq>"
|
|
||||||
# If you wish to bind #, you can wrap the key sequence in quotes: "#" = quit
|
|
||||||
global = {
|
|
||||||
"<C-p>" = ":prev-tab<Enter>";
|
|
||||||
"<C-n>" = ":next-tab <Enter>";
|
|
||||||
"<C-t>" = ":term<Enter>";
|
|
||||||
"?" = ":help keys<Enter>";
|
|
||||||
};
|
|
||||||
messages = {
|
|
||||||
q = ":quit<Enter>";
|
|
||||||
j = ":next <Enter>";
|
|
||||||
"<Down>" = ":next<Enter>";
|
|
||||||
"<C-d>" = ":next 50%<Enter>";
|
|
||||||
"<C-f>" = ":next 100%<Enter>";
|
|
||||||
"<PgDn>" = ":next 100%<Enter>";
|
|
||||||
k = ":prev <Enter>";
|
|
||||||
"<Up>" = ":prev<Enter>";
|
|
||||||
"<C-u>" = ":prev 50%<Enter>";
|
|
||||||
"<C-b>" = ":prev 100%<Enter>";
|
|
||||||
"<PgUp>" = ":prev 100%<Enter>";
|
|
||||||
g = ":select 0 <Enter>";
|
|
||||||
G = ":select -1<Enter>";
|
|
||||||
J = ":next-folder <Enter>";
|
|
||||||
K = ":prev-folder<Enter>";
|
|
||||||
H = ":collapse-folder<Enter>";
|
|
||||||
L = ":expand-folder<Enter>";
|
|
||||||
"<space>" = ":read -t<Enter>:next<Enter>";
|
|
||||||
v = ":mark -t<Enter>";
|
|
||||||
V = ":mark -v<Enter>";
|
|
||||||
F = ":flag -t<Enter>";
|
|
||||||
T = ":toggle-threads<Enter>";
|
|
||||||
"<Enter>" = ":view<Enter>";
|
|
||||||
d = ":prompt 'Delete? ' 'delete-message'<Enter>";
|
|
||||||
D = ":move Trash<Enter>";
|
|
||||||
A = ":archive flat<Enter>";
|
|
||||||
C = ":compose<Enter>";
|
|
||||||
rr = ":reply -a<Enter>";
|
|
||||||
rq = ":reply -aq<Enter>";
|
|
||||||
Rr = ":reply<Enter>";
|
|
||||||
Rq = ":reply -q<Enter>";
|
|
||||||
c = ":cf<space>";
|
|
||||||
"$" = ":term<space>";
|
|
||||||
"!" = ":term<space>";
|
|
||||||
"|" = ":pipe<space>";
|
|
||||||
"/" = ":search<space>";
|
|
||||||
"\\" = ":filter <space>";
|
|
||||||
n = ":next-result<Enter>";
|
|
||||||
N = ":prev-result<Enter>";
|
|
||||||
"<Esc>" = ":clear<Enter>";
|
|
||||||
"*" = ":filter -x Flagged<Enter>";
|
|
||||||
};
|
|
||||||
view = {
|
|
||||||
tr = ":pipe ${niveumPackages.trans}/bin/trans -show-original n -b -no-autocorrect<Enter>"; # https://man.sr.ht/~rjarry/aerc/integrations/translator.md
|
|
||||||
"/" = ":toggle-key-passthrough <Enter> /";
|
|
||||||
q = ":close<Enter>";
|
|
||||||
O = ":open<Enter>";
|
|
||||||
S = ":save<space>";
|
|
||||||
"|" = ":pipe<space>";
|
|
||||||
D = ":move Trash<Enter>";
|
|
||||||
A = ":archive flat<Enter>";
|
|
||||||
"<C-l>" = ":open-link <space>";
|
|
||||||
f = ":forward <Enter>";
|
|
||||||
rr = ":reply -a<Enter>";
|
|
||||||
rq = ":reply -aq<Enter>";
|
|
||||||
Rr = ":reply<Enter>";
|
|
||||||
Rq = ":reply -q<Enter>";
|
|
||||||
H = ":toggle-headers<Enter>";
|
|
||||||
"<C-k>" = ":prev-part<Enter>";
|
|
||||||
"<C-j>" = ":next-part<Enter>";
|
|
||||||
J = ":next <Enter>";
|
|
||||||
K = ":prev<Enter>";
|
|
||||||
};
|
|
||||||
"view::passthrough" = {
|
|
||||||
"$noinherit" = "true";
|
|
||||||
"$ex" = "<C-x>";
|
|
||||||
"<Esc>" = ":toggle-key-passthrough<Enter>";
|
|
||||||
};
|
|
||||||
compose = {
|
|
||||||
# Keybindings used when the embedded terminal is not selected in the compose
|
|
||||||
# view
|
|
||||||
"$noinherit" = "true";
|
|
||||||
"$ex" = "<C-x>";
|
|
||||||
"<C-k>" = ":prev-field<Enter>";
|
|
||||||
"<C-j>" = ":next-field<Enter>";
|
|
||||||
"<tab>" = ":next-field<Enter>";
|
|
||||||
"<C-p>" = ":prev-tab<Enter>";
|
|
||||||
"<C-n>" = ":next-tab<Enter>";
|
|
||||||
};
|
|
||||||
|
|
||||||
"compose::editor" = {
|
|
||||||
# Keybindings used when the embedded terminal is selected in the compose view
|
|
||||||
"$noinherit" = "true";
|
|
||||||
"$ex" = "<C-x>";
|
|
||||||
"<C-k>" = ":prev-field<Enter>";
|
|
||||||
"<C-j>" = ":next-field<Enter>";
|
|
||||||
"<C-p>" = ":prev-tab<Enter>";
|
|
||||||
"<C-n>" = ":next-tab<Enter>";
|
|
||||||
};
|
|
||||||
|
|
||||||
"compose::review" = {
|
|
||||||
# Keybindings used when reviewing a message to be sent
|
|
||||||
y = ":send <Enter>";
|
|
||||||
n = ":abort<Enter>";
|
|
||||||
p = ":postpone<Enter>";
|
|
||||||
q = ":choose -o d discard abort -o p postpone postpone<Enter>";
|
|
||||||
e = ":edit<Enter>";
|
|
||||||
a = ":attach<space>";
|
|
||||||
d = ":detach<space>";
|
|
||||||
};
|
|
||||||
|
|
||||||
terminal = {
|
|
||||||
"$noinherit" = "true";
|
|
||||||
"$ex" = "<C-x>";
|
|
||||||
"<C-p>" = ":prev-tab<Enter>";
|
|
||||||
"<C-n>" = ":next-tab<Enter>";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
extraConfig = {
|
|
||||||
ui.sort = "-r date";
|
|
||||||
ui.timestamp-format = "2006-01-02 15:04";
|
|
||||||
ui.mouse-enabled = true;
|
|
||||||
ui.spinner = ". , .";
|
|
||||||
general.unsafe-accounts-conf = true;
|
|
||||||
general.pgp-provider = "gpg";
|
|
||||||
viewer = {pager = "${pkgs.less}/bin/less -R";};
|
|
||||||
compose = {
|
|
||||||
# address-book-cmd = "khard email --remove-first-line --parsable '%s'";
|
|
||||||
no-attachment-warning = "(attach|attached|attachments?|anbei|Anhang|angehängt|beigefügt)";
|
|
||||||
};
|
|
||||||
filters = {
|
|
||||||
"text/plain" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
|
||||||
"text/calendar" = "${pkgs.aerc}/libexec/aerc/filters/calendar";
|
|
||||||
"text/html" = "${pkgs.aerc}/libexec/aerc/filters/html"; # Requires w3m, dante
|
|
||||||
# "text/html" =
|
|
||||||
# "${pkgs.aerc}/share/aerc/filters/html | ${pkgs.aerc}/share/aerc/filters/colorize";
|
|
||||||
# "text/*" =
|
|
||||||
# ''${pkgs.bat}/bin/bat -fP --theme=ansi --file-name="$AERC_FILENAME "'';
|
|
||||||
"message/delivery-status" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
|
||||||
"message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
|
|
||||||
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
|
|
||||||
};
|
|
||||||
openers = let
|
|
||||||
as-pdf = pkgs.writers.writeDash "as-pdf" ''
|
|
||||||
d=$(mktemp -d)
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm -rf "$d"
|
|
||||||
}
|
|
||||||
${pkgs.libreoffice}/bin/libreoffice --headless --convert-to pdf "$1" --outdir "$d"
|
|
||||||
${pkgs.zathura}/bin/zathura "$d"/*.pdf
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
"image/*" = "${pkgs.nsxiv}/bin/nsxiv";
|
|
||||||
"application/pdf" = "${pkgs.zathura}/bin/zathura";
|
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = toString as-pdf;
|
|
||||||
"application/vnd.oasis.opendocument.text" = toString as-pdf;
|
|
||||||
"video/*" = "${pkgs.mpv}/bin/mpv";
|
|
||||||
"audio/*" = "${pkgs.mpv}/bin/mpv";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
templates = {
|
|
||||||
# new_message = "hello!";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
in {
|
|
||||||
environment.variables.TERMINAL = "alacritty";
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
|
||||||
programs.alacritty = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
keyboard.bindings = [
|
|
||||||
{
|
|
||||||
key = "Plus";
|
|
||||||
mods = "Control";
|
|
||||||
action = "IncreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "Minus";
|
|
||||||
mods = "Control";
|
|
||||||
action = "DecreaseFontSize";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
key = "Key0";
|
|
||||||
mods = "Control";
|
|
||||||
action = "ResetFontSize";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
programs.adb.enable = true;
|
|
||||||
|
|
||||||
users.users.me.extraGroups = ["adbusers"];
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import ../lib) restic;
|
|
||||||
in {
|
|
||||||
services.restic.backups.niveum = {
|
|
||||||
initialize = true;
|
|
||||||
inherit (restic) repository;
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "8:00";
|
|
||||||
RandomizedDelaySec = "1h";
|
|
||||||
};
|
|
||||||
passwordFile = config.age.secrets.restic.path;
|
|
||||||
extraBackupArgs = [
|
|
||||||
"--exclude=/home/kfm/sync/src/nixpkgs/.git"
|
|
||||||
"--exclude=node_modules"
|
|
||||||
"--exclude=.parcel-cache"
|
|
||||||
];
|
|
||||||
paths = [
|
|
||||||
"/home/kfm/sync"
|
|
||||||
"/home/kfm/state"
|
|
||||||
"/home/kfm/cloud"
|
|
||||||
"/home/kfm/mobile"
|
|
||||||
"/home/kfm/.gnupg"
|
|
||||||
"/home/kfm/.electrum"
|
|
||||||
"/home/kfm/.ssh"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.restic-backups-niveum.serviceConfig = {
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = "15s";
|
|
||||||
StartLimitIntervalSec = "1m"; # don't try more than 4 times
|
|
||||||
StartLimitBurst = 4;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
(pkgs.writers.writeDashBin "restic-niveum" ''
|
|
||||||
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${config.age.secrets.restic.path} "$@"
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "restic-mount" ''
|
|
||||||
mountdir=$(mktemp -d)
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm -r "$mountdir"
|
|
||||||
}
|
|
||||||
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${config.age.secrets.restic.path} mount "$mountdir"
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
{pkgs, ...}: {
|
{
|
||||||
programs.bash = {
|
programs.bash = {
|
||||||
promptInit = ''
|
promptInit = ''PS1="$(tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(tput sgr0) "'';
|
||||||
PS1="$(${pkgs.ncurses}/bin/tput bold)\w \$([[ \$? == 0 ]] && echo \"\[\033[1;32m\]\" || echo \"\[\033[1;31m\]\")\$$(${pkgs.ncurses}/bin/tput sgr0) "'';
|
|
||||||
interactiveShellInit = ''
|
interactiveShellInit = ''
|
||||||
set -o vi
|
set -o vi
|
||||||
'';
|
'';
|
||||||
|
|||||||
@@ -1,10 +1,16 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.general = {
|
extraConfig = ''
|
||||||
enable = "Source,Sink,Media,Socket";
|
[General]
|
||||||
};
|
Enable=Source,Sink,Media,Socket
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ pkgs.bluetuith ];
|
environment.systemPackages = [ pkgs.blueman ];
|
||||||
|
|
||||||
|
home-manager.users.me = {
|
||||||
|
services.blueman-applet.enable = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
autorenkalender-package = pkgs.fetchFromGitHub {
|
|
||||||
owner = "kmein";
|
|
||||||
repo = "autorenkalender";
|
|
||||||
rev = "cf49a7b057301332d980eb47042a626add93db66";
|
|
||||||
sha256 = "1pa7sjg33vdnjianrqldv445jdzzv3mn231ljk1j58hs0cd505gs";
|
|
||||||
};
|
|
||||||
autorenkalender =
|
|
||||||
pkgs.python3Packages.callPackage autorenkalender-package {};
|
|
||||||
in {
|
|
||||||
niveum.bots.autorenkalender = {
|
|
||||||
enable = true;
|
|
||||||
time = "07:00";
|
|
||||||
telegram = {
|
|
||||||
enable = true;
|
|
||||||
tokenFile = config.age.secrets.telegram-token-kmein.path;
|
|
||||||
chatIds = ["@autorenkalender"];
|
|
||||||
parseMode = "Markdown";
|
|
||||||
};
|
|
||||||
command = "${autorenkalender}/bin/autorenkalender";
|
|
||||||
};
|
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Autorenkalender";
|
|
||||||
description = "sends <a href=\"https://www.projekt-gutenberg.org/\">Projekt Gutenberg</a>'s anniversary information to Telegram.";
|
|
||||||
link = "https://t.me/Autorenkalender";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,79 +0,0 @@
|
|||||||
{
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,104 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
telebots = inputs.telebots.defaultPackage.x86_64-linux;
|
|
||||||
reverseDirectory = "/run/telegram-reverse";
|
|
||||||
proverbDirectory = "/run/telegram-proverb";
|
|
||||||
inherit (import ../../lib) tmpfilesConfig;
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
./logotheca.nix
|
|
||||||
./transits.nix
|
|
||||||
./autorenkalender.nix
|
|
||||||
./hesychius.nix
|
|
||||||
./smyth.nix
|
|
||||||
./nachtischsatan.nix
|
|
||||||
./tlg-wotd.nix
|
|
||||||
./celan.nix
|
|
||||||
./nietzsche.nix
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = map (path:
|
|
||||||
tmpfilesConfig {
|
|
||||||
type = "d";
|
|
||||||
mode = "0750";
|
|
||||||
age = "1h";
|
|
||||||
inherit path;
|
|
||||||
}) [reverseDirectory proverbDirectory];
|
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Rückwarts-Bot";
|
|
||||||
link = "https://t.me/RueckwaertsBot";
|
|
||||||
description = "reverses things on Telegram.";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "BetaCode-Bot";
|
|
||||||
link = "https://t.me/BetaCodeBot";
|
|
||||||
description = "converts <a href=\"https://en.wikipedia.org/wiki/Beta_Code\">beta code</a> to polytonic Greek on Telegram.";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Sprichwortgenerator-Bot";
|
|
||||||
link = "https://t.me/SprichwortGeneratorBot";
|
|
||||||
description = "generates useless German proverbs with optional stock photo background on Telegram.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
telegram-token-reverse.file = ../../secrets/telegram-token-reverse.age;
|
|
||||||
telegram-token-betacode.file = ../../secrets/telegram-token-betacode.age;
|
|
||||||
telegram-token-proverb.file = ../../secrets/telegram-token-proverb.age;
|
|
||||||
telegram-token-streaming-link.file = ../../secrets/telegram-token-streaming-link.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.telegram-reverse = {
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
description = "Telegram reverse bot";
|
|
||||||
path = [pkgs.ffmpeg];
|
|
||||||
enable = true;
|
|
||||||
script = ''
|
|
||||||
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-reverse
|
|
||||||
'';
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
serviceConfig.WorkingDirectory = reverseDirectory;
|
|
||||||
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-reverse.path}";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.telegram-streaming-link = {
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
description = "Telegram bot converting YouTube Music <-> Spotify";
|
|
||||||
enable = true;
|
|
||||||
script = ''
|
|
||||||
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-streaming-link
|
|
||||||
'';
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-streaming-link.path}";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.telegram-betacode = {
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
description = "Telegram beta code bot";
|
|
||||||
enable = true;
|
|
||||||
script = ''
|
|
||||||
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-betacode
|
|
||||||
'';
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-betacode.path}";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.telegram-proverb = {
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
description = "Telegram proverb bot";
|
|
||||||
enable = true;
|
|
||||||
script = ''
|
|
||||||
TELEGRAM_BOT_TOKEN="$(cat "$CREDENTIALS_DIRECTORY/token")" ${telebots}/bin/telegram-proverb
|
|
||||||
'';
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
serviceConfig.WorkingDirectory = proverbDirectory;
|
|
||||||
serviceConfig.LoadCredential = "token:${config.age.secrets.telegram-token-proverb.path}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
{
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
{
|
|
||||||
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.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
nachtischsatan-bot = {tokenFile}:
|
|
||||||
pkgs.writers.writePython3 "nachtischsatan-bot" {
|
|
||||||
libraries = [pkgs.python3Packages.python-telegram-bot];
|
|
||||||
} ''
|
|
||||||
from telegram.ext import Application, ContextTypes, MessageHandler, filters
|
|
||||||
from telegram import Update
|
|
||||||
import random
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
async def flubber(update: Update, context: ContextTypes.DEFAULT_TYPE):
|
|
||||||
time.sleep(random.randrange(4000) / 1000)
|
|
||||||
await update.message.reply_text("*flubberflubber*")
|
|
||||||
|
|
||||||
|
|
||||||
with open('${tokenFile}', 'r') as tokenFile:
|
|
||||||
token = tokenFile.read().strip()
|
|
||||||
application = Application.builder().token(token).build()
|
|
||||||
application.add_handler(MessageHandler(filters.ALL, flubber))
|
|
||||||
application.run_polling()
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
systemd.services.telegram-nachtischsatan = {
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
description = "*flubberflubber*";
|
|
||||||
enable = true;
|
|
||||||
script = toString (nachtischsatan-bot {
|
|
||||||
tokenFile = config.age.secrets.telegram-token-nachtischsatan.path;
|
|
||||||
});
|
|
||||||
serviceConfig.Restart = "always";
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets.telegram-token-nachtischsatan.file = ../../secrets/telegram-token-nachtischsatan.age;
|
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Nachtischsatan-Bot";
|
|
||||||
link = "https://t.me/NachtischsatanBot";
|
|
||||||
description = "*flubberflubber*";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
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;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
niveum.bots.smyth = {
|
|
||||||
enable = true;
|
|
||||||
time = "08:00";
|
|
||||||
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
|
|
||||||
|
|
||||||
RANDOM_SECTION=$(
|
|
||||||
${pkgs.curl}/bin/curl -sSL http://www.perseus.tufts.edu/hopper/xmltoc?doc=Perseus%3Atext%3A1999.04.0007%3Asmythp%3D1 \
|
|
||||||
| ${pkgs.gnugrep}/bin/grep -o 'ref="[^"]*"' \
|
|
||||||
| ${pkgs.coreutils}/bin/shuf -n1 \
|
|
||||||
| ${pkgs.gnused}/bin/sed 's/^ref="//;s/"$//'
|
|
||||||
)
|
|
||||||
|
|
||||||
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.bot-smyth.timerConfig.RandomizedDelaySec = "10h";
|
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
mastodon-token-smyth.file = ../../secrets/mastodon-token-smyth.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Herbert Weir Smyth Bot";
|
|
||||||
description = "sends a random section from Smyth's Ancient Greek grammar to Telegram.";
|
|
||||||
link = "https://t.me/HerbertWeirSmyth";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,163 +0,0 @@
|
|||||||
{
|
|
||||||
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";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
toSymbols = pkgs.writers.writeDash "to-symbols" ''
|
|
||||||
${pkgs.gnused}/bin/sed '
|
|
||||||
s/\bTri\b/△/;
|
|
||||||
s/\bOpp\b/☍/;
|
|
||||||
s/\bSqu\b/□/;
|
|
||||||
s/\bSex\b/⚹/;
|
|
||||||
s/\bCon\b/☌/;
|
|
||||||
s/Sun/☉/g;
|
|
||||||
s/Moon/☽/g;
|
|
||||||
s/Mercury/☿/g;
|
|
||||||
s/Venus/♀/g;
|
|
||||||
s/Mars/♂/g;
|
|
||||||
s/Jupiter/♃/g;
|
|
||||||
s/Saturn/♄/g;
|
|
||||||
s/Uranus/♅/g;
|
|
||||||
s/Neptune/♆/g;
|
|
||||||
s/Pluto/♇/g;
|
|
||||||
s/North Node/☊/g;
|
|
||||||
s/\bLeo\b/♌/g;
|
|
||||||
s/\bCan\(cer\)\?\b/♋/g;
|
|
||||||
s/\bGem\(ini\)\?\b/♊/g;
|
|
||||||
s/\bVir\(go\)\?\b/♍/g;
|
|
||||||
s/\bLib\(ra\)\?\b/♎/g;
|
|
||||||
s/\bTau\(rus\)\?\b/♉/g;
|
|
||||||
s/\bAri\(es\)\?\b/♈/g;
|
|
||||||
s/\bSco\(rpio\)\?\b/♏/g;
|
|
||||||
s/\bPis\(ces\)\?\b/♓/g;
|
|
||||||
s/\bSag\(ittarius\)\?\b/♐/g;
|
|
||||||
s/\bAqu\(arius\)\?\b/♒/g;
|
|
||||||
s/\bCap\(ricorn\)\?\b/♑/g;
|
|
||||||
s/-->/⟶/g;
|
|
||||||
s/\s\+/ /g; # replace multiple spaces by one
|
|
||||||
s/^.*\([ 0-9]\{2\}:[0-9]\{2\}\) /\1 /; # remove date at beginning of line (but not everything up to v/c X:XX)
|
|
||||||
s/^\s*//
|
|
||||||
'
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
niveum.bots.transits = {
|
|
||||||
enable = true;
|
|
||||||
time = "*:0/1";
|
|
||||||
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')
|
|
||||||
(
|
|
||||||
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,86 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
niveumPackages,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
environment.systemPackages = [
|
|
||||||
niveumPackages.cro
|
|
||||||
pkgs.tor-browser-bundle-bin
|
|
||||||
pkgs.firefox
|
|
||||||
pkgs.brave
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
|
||||||
programs.firefox = {
|
|
||||||
enable = true;
|
|
||||||
profiles = let
|
|
||||||
defaultSettings = {
|
|
||||||
"beacon.enabled" = false;
|
|
||||||
"browser.bookmarks.showMobileBookmarks" = true;
|
|
||||||
"browser.newtab.preload" = false;
|
|
||||||
"browser.search.isUS" = false;
|
|
||||||
"browser.search.region" = "DE";
|
|
||||||
"browser.send_pings" = false;
|
|
||||||
"browser.shell.checkDefaultBrowser" = false;
|
|
||||||
"browser.startup.homepage" = "chrome://browser/content/blanktab.html";
|
|
||||||
"browser.uidensity" = 1;
|
|
||||||
"browser.urlbar.placeholderName" = "Search";
|
|
||||||
"datareporting.healthreport.service.enabled" = false;
|
|
||||||
"datareporting.healthreport.uploadEnabled" = false;
|
|
||||||
"datareporting.policy.dataSubmissionEnabled" = false;
|
|
||||||
"datareporting.sessions.current.clean" = true;
|
|
||||||
"distribution.searchplugins.defaultLocale" = "de-DE";
|
|
||||||
"general.smoothScroll" = true;
|
|
||||||
"identity.fxaccounts.account.device.name" = config.networking.hostName;
|
|
||||||
"network.cookie.cookieBehavior" = 1;
|
|
||||||
"privacy.donottrackheader.enabled" = true;
|
|
||||||
"privacy.trackingprotection.enabled" = true;
|
|
||||||
"privacy.trackingprotection.pbmode.enabled" = true;
|
|
||||||
"privacy.trackingprotection.socialtracking.enabled" = true;
|
|
||||||
"services.sync.declinedEngines" = "passwords";
|
|
||||||
"services.sync.engine.passwords" = false;
|
|
||||||
"signon.autofillForms" = false;
|
|
||||||
"signon.rememberSignons" = false;
|
|
||||||
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
|
|
||||||
"toolkit.telemetry.archive.enabled" = false;
|
|
||||||
"toolkit.telemetry.bhrPing.enabled" = false;
|
|
||||||
"toolkit.telemetry.cachedClientID" = "";
|
|
||||||
"toolkit.telemetry.enabled" = false;
|
|
||||||
"toolkit.telemetry.firstShutdownPing.enabled" = false;
|
|
||||||
"toolkit.telemetry.hybridContent.enabled" = false;
|
|
||||||
"toolkit.telemetry.newProfilePing.enabled" = false;
|
|
||||||
"toolkit.telemetry.prompted" = 2;
|
|
||||||
"toolkit.telemetry.rejected" = true;
|
|
||||||
"toolkit.telemetry.server" = "";
|
|
||||||
"toolkit.telemetry.shutdownPingSender.enabled" = false;
|
|
||||||
"toolkit.telemetry.unified" = false;
|
|
||||||
"toolkit.telemetry.unifiedIsOptIn" = false;
|
|
||||||
"toolkit.telemetry.updatePing.enabled" = false;
|
|
||||||
"ui.prefersReducedMotion" = 1;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
default = {
|
|
||||||
id = 0;
|
|
||||||
isDefault = true;
|
|
||||||
settings = defaultSettings;
|
|
||||||
# extensions = with pkgs.nur.repos.rycee.firefox-addons; [
|
|
||||||
# ublock-origin
|
|
||||||
# darkreader
|
|
||||||
# sponsorblock
|
|
||||||
# consent-o-matic
|
|
||||||
# i-dont-care-about-cookies
|
|
||||||
# # auto-tab-discard TODO what is this
|
|
||||||
# ];
|
|
||||||
userChrome = ''
|
|
||||||
#TabsToolbar {
|
|
||||||
visibility: collapse !important;
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.variables.BROWSER = "firefox";
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{pkgs, ...}:
|
|
||||||
# https://paste.sr.ht/~erictapen/11716989e489b600f237041b6d657fdf0ee17b34
|
|
||||||
let
|
|
||||||
certificate = pkgs.stdenv.mkDerivation rec {
|
|
||||||
name = "dst-root-ca-x3.pem";
|
|
||||||
src = builtins.toFile "${name}.sed" ''
|
|
||||||
1,/DST Root CA X3/d
|
|
||||||
1,/-----END CERTIFICATE-----/p
|
|
||||||
'';
|
|
||||||
nativeBuildInputs = with pkgs; [cacert gnused];
|
|
||||||
phases = "installPhase";
|
|
||||||
installPhase = ''
|
|
||||||
${pkgs.gnused}/bin/sed -n -f $src ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt > $out
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
networking.wireless.networks."36C3" = {
|
|
||||||
auth = ''
|
|
||||||
key_mgmt=WPA-EAP
|
|
||||||
eap=TTLS
|
|
||||||
identity="kmein"
|
|
||||||
password=" "
|
|
||||||
ca_cert="${certificate}"
|
|
||||||
altsubject_match="DNS:radius.c3noc.net"
|
|
||||||
phase2="auth=PAP"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
17
configs/chromium.nix
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
|
programs.chromium = {
|
||||||
|
enable = true;
|
||||||
|
extensions = [
|
||||||
|
"hdokiejnpimakedhajhdlcegeplioahd" # LastPass
|
||||||
|
"ihlenndgcmojhcghmfjfneahoeklbjjh" # cVim
|
||||||
|
"fpnmgdkabkmnadcjpehmlllkndpkmiak" # Wayback Machine
|
||||||
|
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
|
||||||
|
"iaalpfgpbocpdfblpnhhgllgbdbchmia" # asciidoctor
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.chromium ];
|
||||||
|
|
||||||
|
niveum.applications.browser = "chromium";
|
||||||
|
}
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.clipmenu.enable = true;
|
|
||||||
}
|
|
||||||
@@ -1,142 +1,48 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
imports = [
|
||||||
lib,
|
<modules/seafile.nix>
|
||||||
pkgs,
|
<modules/google-drive.nix>
|
||||||
...
|
<modules/dropbox.nix>
|
||||||
}: let
|
<stockholm/krebs/3modules/syncthing.nix>
|
||||||
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";
|
|
||||||
mode = "0755";
|
|
||||||
age = "7d";
|
|
||||||
path = "${config.users.users.me.home}/sync/Downloads";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "d";
|
|
||||||
mode = "0755";
|
|
||||||
age = "7d";
|
|
||||||
path = "${config.users.users.me.home}/cloud/nextcloud/tmp";
|
|
||||||
}
|
|
||||||
] ++ map (path: tmpfilesConfig {
|
|
||||||
type = "L+";
|
|
||||||
user = config.users.users.me.name;
|
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "0755";
|
|
||||||
argument = "${config.users.users.me.home}/sync/${path}";
|
|
||||||
path = "${config.users.users.me.home}/${path}";
|
|
||||||
}) [".ssh" ".gnupg" ".pki" ".local/share/aerc"];
|
|
||||||
|
|
||||||
services.gnome.gnome-keyring.enable = true;
|
|
||||||
security.pam.services.lightdm.enableGnomeKeyring = true;
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
|
||||||
services.nextcloud-client = {
|
|
||||||
enable = true;
|
|
||||||
startInBackground = true;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.user.services.nextcloud-syncer = {
|
|
||||||
enable = false;
|
|
||||||
wants = ["network-online.target"];
|
|
||||||
wantedBy = ["default.target"];
|
|
||||||
startAt = "*:00/10";
|
|
||||||
script = let
|
|
||||||
kieran = {
|
|
||||||
user = "kieran";
|
|
||||||
passwordFile = config.age.secrets.nextcloud-password-kieran.path;
|
|
||||||
endpoint = "https://cloud.kmein.de";
|
|
||||||
target = "${config.users.users.me.home}/notes";
|
|
||||||
};
|
|
||||||
in ''
|
|
||||||
mkdir -p ${lib.escapeShellArg kieran.target}
|
|
||||||
${pkgs.nextcloud-client}/bin/nextcloudcmd --non-interactive --user ${kieran.user} --password "$(cat ${kieran.passwordFile})" --path /Notes ${lib.escapeShellArg kieran.target} ${kieran.endpoint}
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
Restart = "on-failure";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
(pkgs.writers.writeDashBin "book" ''
|
|
||||||
set -efu
|
|
||||||
book="$({
|
|
||||||
${pkgs.findutils}/bin/find ${config.users.users.me.home}/cloud/syncthing/library -type f
|
|
||||||
${pkgs.findutils}/bin/find ${config.users.users.me.home}/cloud/nextcloud/Books -type f
|
|
||||||
} | ${pkgs.fzf}/bin/fzf)"
|
|
||||||
exec ${pkgs.zathura}/bin/zathura "$book"
|
|
||||||
'')
|
|
||||||
(let
|
|
||||||
kieran = {
|
|
||||||
user = "kieran.meinhardt@gmail.com";
|
|
||||||
passwordFile = config.age.secrets.mega-password.path;
|
|
||||||
};
|
|
||||||
megatools = command: ''${pkgs.megatools}/bin/megatools ${command} --username ${lib.escapeShellArg kieran.user} --password "$(cat ${kieran.passwordFile})"'';
|
|
||||||
in
|
|
||||||
pkgs.writers.writeDashBin "book-mega" ''
|
|
||||||
set -efu
|
|
||||||
selection="$(${megatools "ls"} | ${pkgs.fzf}/bin/fzf)"
|
|
||||||
test -n "$selection" || exit 1
|
|
||||||
|
|
||||||
tmpdir="$(mktemp -d)"
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm -rf "$tmpdir"
|
|
||||||
}
|
|
||||||
|
|
||||||
(
|
|
||||||
cd "$tmpdir"
|
|
||||||
${megatools "get"} "$selection"
|
|
||||||
exec ${pkgs.zathura}/bin/zathura "$(basename "$selection")"
|
|
||||||
)
|
|
||||||
'')
|
|
||||||
];
|
];
|
||||||
|
|
||||||
age.secrets.mega-password = {
|
niveum.dropbox = {
|
||||||
file = ../secrets/mega-password.age;
|
enable = true;
|
||||||
owner = config.users.users.me.name;
|
user = config.users.users.me;
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "400";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
services.syncthing = {
|
niveum.seafile = {
|
||||||
|
enable = true;
|
||||||
|
user = config.users.users.me;
|
||||||
|
};
|
||||||
|
|
||||||
|
niveum.google-drive = rec {
|
||||||
|
enable = true;
|
||||||
|
directory = "${user.home}/cloud/gdrive";
|
||||||
|
user = config.users.users.me;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.syncthing = rec {
|
||||||
enable = true;
|
enable = true;
|
||||||
user = "kfm";
|
user = "kfm";
|
||||||
openDefaultPorts = true;
|
openDefaultPorts = true;
|
||||||
configDir = "/home/kfm/.config/syncthing";
|
configDir = "/home/kfm/.config/syncthing";
|
||||||
dataDir = "/home/kfm/.config/syncthing";
|
dataDir = "/home/kfm/.config/syncthing";
|
||||||
cert = config.age.secrets.syncthing-cert.path;
|
};
|
||||||
key = config.age.secrets.syncthing-key.path;
|
|
||||||
settings = {
|
krebs.syncthing = rec {
|
||||||
inherit ((import ../lib).syncthing) devices;
|
enable = true;
|
||||||
folders = {
|
key = toString <secrets/syncthing/key.pem>;
|
||||||
"${config.users.users.me.home}/sync" = {
|
cert = toString <secrets/syncthing/cert.pem>;
|
||||||
devices = ["kabsa" "manakish" "fatteh"];
|
peers = {
|
||||||
label = "sync";
|
homeros.id = "HSOL72W-MMN346W-C3WCWCH-OTRKJYG-MY2WWV6-P7JUHN7-5WYYYRV-ZMH4KAA";
|
||||||
versioning.type = "trashcan";
|
scardanelli.id = "7CZYHEX-3CSFDQU-PEEMYHG-6XGQ2ZD-KGVUWH5-GFRB2XK-FP57ERX-7APZUQU";
|
||||||
versioning.params.cleanoutDays = 100;
|
rilke.id = "NYNNHXP-7JMSTXG-SVNOPWD-RWXCCCL-CBOVBEI-X4QPLF4-NJA5G2P-RSGYRQQ";
|
||||||
};
|
wilde.id = "R6DEBD7-G5RYDKN-VFA3HPO-WX4DNVI-373F7OQ-AW5MZTT-3L4BDVW-Y6ROEAF";
|
||||||
"${config.users.users.me.home}/mobile" = {
|
|
||||||
devices = ["kabsa" "manakish" "fatteh" "kibbeh"];
|
|
||||||
id = "mobile";
|
|
||||||
label = "mobile";
|
|
||||||
versioning.type = "trashcan";
|
|
||||||
versioning.params.cleanoutDays = 100;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
folders."${config.users.users.me.home}/cloud/syncthing/common".peers = [ "homeros" "scardanelli" "wilde" ];
|
||||||
|
folders."${config.users.users.me.home}/cloud/syncthing/library".peers = lib.attrNames peers;
|
||||||
|
folders."${config.users.users.me.home}/cloud/syncthing/mundoiu".peers = lib.attrNames peers;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
8
configs/compton.nix
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
services.compton = {
|
||||||
|
enable = true;
|
||||||
|
shadow = true;
|
||||||
|
menuOpacity = "0.9";
|
||||||
|
shadowOpacity = "0.3";
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,301 +1,273 @@
|
|||||||
{
|
{ pkgs, lib, config, ... }:
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
niveumPackages,
|
|
||||||
unstablePackages,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
|
||||||
inherit (lib.strings) makeBinPath;
|
|
||||||
inherit (import ../lib) localAddresses kieran remoteDir;
|
|
||||||
defaultApplications = (import ../lib).defaultApplications { inherit pkgs; };
|
|
||||||
in
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
inputs.self.nixosModules.system-dependent
|
<modules/constants.nix>
|
||||||
inputs.self.nixosModules.power-action
|
|
||||||
{
|
{
|
||||||
boot.supportedFilesystems = [ "ntfs" ];
|
services.dbus.packages = [ pkgs.gnome3.dconf ];
|
||||||
|
}
|
||||||
|
<home-manager/nixos>
|
||||||
|
# <configs/mopidy.nix>
|
||||||
|
<configs/bash.nix>
|
||||||
|
<configs/bluetooth.nix>
|
||||||
|
<configs/chromium.nix>
|
||||||
|
<configs/cloud.nix>
|
||||||
|
<configs/compton.nix>
|
||||||
|
<configs/default.nix>
|
||||||
|
# <configs/home-assistant.nix>
|
||||||
|
<configs/distrobump.nix>
|
||||||
|
<configs/docker.nix>
|
||||||
|
<configs/dunst.nix>
|
||||||
|
<configs/fonts.nix>
|
||||||
|
<configs/git.nix>
|
||||||
|
<configs/haskell>
|
||||||
|
<configs/hledger.nix>
|
||||||
|
<configs/htop.nix>
|
||||||
|
<configs/hu-berlin.nix>
|
||||||
|
<configs/i3.nix>
|
||||||
|
<configs/kdeconnect.nix>
|
||||||
|
<configs/keybase.nix>
|
||||||
|
<configs/keyboard.nix>
|
||||||
|
<configs/mail.nix>
|
||||||
|
<configs/mpv.nix>
|
||||||
|
<configs/nano.nix>
|
||||||
|
<configs/neovim.nix>
|
||||||
|
<configs/nixpkgs-unstable.nix>
|
||||||
|
<configs/packages>
|
||||||
|
<configs/printing.nix>
|
||||||
|
<configs/python.nix>
|
||||||
|
<configs/random-background.nix>
|
||||||
|
<configs/redshift.nix>
|
||||||
|
<configs/retiolum.nix>
|
||||||
|
<configs/rofi.nix>
|
||||||
|
<configs/sncli.nix>
|
||||||
|
<configs/ssh.nix>
|
||||||
|
<configs/sudo.nix>
|
||||||
|
<configs/themes/owickstrom-dark.nix>
|
||||||
|
<configs/theming.nix>
|
||||||
|
<configs/tmux.nix>
|
||||||
|
<configs/todo-txt.nix>
|
||||||
|
<configs/traadfri.nix>
|
||||||
|
<configs/unclutter.nix>
|
||||||
|
<configs/urxvt.nix>
|
||||||
|
<configs/vscode.nix>
|
||||||
|
<configs/xautolock.nix>
|
||||||
|
<configs/xresources.nix>
|
||||||
|
<configs/zsh.nix>
|
||||||
|
{
|
||||||
|
niveum.user = {
|
||||||
|
github = "kmein";
|
||||||
|
email = "kieran.meinhardt@gmail.com";
|
||||||
|
name = "Kierán Meinhardt";
|
||||||
|
};
|
||||||
|
|
||||||
|
niveum.applications = rec {
|
||||||
|
fileManager = "${config.niveum.applications.terminal} -e ${pkgs.ranger}/bin/ranger";
|
||||||
|
};
|
||||||
|
|
||||||
|
niveum.theme = {
|
||||||
|
gtk = { name = "Arc"; package = pkgs.arc-theme; };
|
||||||
|
icon = { name = "Arc"; package = pkgs.arc-icon-theme; };
|
||||||
|
cursor = { name = "capitaine-cursors"; package = pkgs.capitaine-cursors; };
|
||||||
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nixpkgs = {
|
nixpkgs.config = {
|
||||||
config = {
|
allowUnfree = true;
|
||||||
allowUnfree = true;
|
packageOverrides = pkgs: {
|
||||||
packageOverrides = pkgs: {
|
python3Packages = pkgs.python3Packages.override {
|
||||||
dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.wofi}/bin/wofi -dmenu "$@"'';
|
overrides = new: old: {
|
||||||
|
spotify-cli-linux = new.callPackage <packages/spotify-cli-linux.nix> {};
|
||||||
|
instaloader = new.callPackage <packages/instaloader.nix> {};
|
||||||
|
sncli = new.callPackage <packages/sncli.nix> {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
haskellPackages = pkgs.haskellPackages.override {
|
||||||
|
overrides = new: old: {
|
||||||
|
blessings = new.callPackage <packages/blessings.nix> {};
|
||||||
|
scanner = new.callPackage <stockholm/krebs/5pkgs/haskell/scanner.nix> {};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
git-quick-stats = pkgs.callPackage <packages/git-quick-stats.nix> {};
|
||||||
|
writeDash = pkgs.writers.writeDash;
|
||||||
|
writeDashBin = pkgs.writers.writeDashBin;
|
||||||
|
iolanguage = pkgs.callPackage <packages/iolanguage.nix> {};
|
||||||
|
nix-git = pkgs.callPackage <packages/nix-git.nix> {};
|
||||||
|
|
||||||
|
kmein = {
|
||||||
|
autorenkalender = pkgs.callPackage <packages/autorenkalender.nix> {};
|
||||||
|
bvg = pkgs.callPackage <packages/bvg.nix> {};
|
||||||
|
daybook = pkgs.callPackage <packages/daybook.nix> {};
|
||||||
|
font-size = pkgs.callPackage <packages/font-size.nix> { font = config.niveum.fonts.terminal; };
|
||||||
|
genius = pkgs.callPackage <packages/genius.nix> {};
|
||||||
|
instaget = pkgs.callPackage <packages/instaget.nix> {};
|
||||||
|
literature-quote = pkgs.callPackage <packages/literature-quote.nix> {};
|
||||||
|
n = pkgs.callPackage <packages/n.nix> {};
|
||||||
|
depp = pkgs.callPackage <packages/depp.nix> {};
|
||||||
|
odyssey = pkgs.callPackage <packages/odyssey.nix> {};
|
||||||
|
wttr = pkgs.callPackage <packages/wttr.nix> {};
|
||||||
|
nav = pkgs.callPackage <packages/nav.nix> {};
|
||||||
|
slide =
|
||||||
|
let slide-package = pkgs.fetchFromGitHub {
|
||||||
|
owner = "kmein";
|
||||||
|
repo = "slide";
|
||||||
|
rev = "0470583d22212745eab4f46076267addf4d2346c";
|
||||||
|
sha256 = "0skcp3va9v4hmxy5ramghpz53gnyxv10wsacgmc2jr0v1wrqlzbh";
|
||||||
|
};
|
||||||
|
in pkgs.callPackage slide-package {};
|
||||||
|
haskellPackages.mnemosyne =
|
||||||
|
let mnemosyne-package = pkgs.fetchFromGitHub {
|
||||||
|
repo = "mnemosyne";
|
||||||
|
owner = "kmein";
|
||||||
|
rev = "6bfa13c88db176af80be90840ff03573d67d679f";
|
||||||
|
sha256 = "1rimv5c5q9602y501hbkgkfbimqnmdkcr5hp1434q06gcazhjhca";
|
||||||
|
};
|
||||||
|
in pkgs.haskellPackages.callPackage mnemosyne-package {};
|
||||||
};
|
};
|
||||||
permittedInsecurePackages = [
|
|
||||||
"qtwebkit-5.212.0-alpha4"
|
|
||||||
"zotero-6.0.26"
|
|
||||||
"electron-25.9.0"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
boot.tmp.cleanOnBoot = true;
|
boot.cleanTmpDir = true;
|
||||||
boot.loader.timeout = 1;
|
boot.loader.timeout = 1;
|
||||||
|
boot.extraModulePackages = [ config.boot.kernelPackages.exfat-nofuse ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
age.secrets = {
|
time.timeZone = "Europe/Berlin";
|
||||||
di-fm-key = {
|
|
||||||
file = ../secrets/di-fm-key.age;
|
|
||||||
owner = config.users.users.me.name;
|
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "400";
|
|
||||||
};
|
|
||||||
restic = {
|
|
||||||
file = ../secrets/restic.age;
|
|
||||||
owner = config.users.users.me.name;
|
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "400";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
programs.zathura = {
|
programs.zathura = {
|
||||||
enable = true;
|
enable = true;
|
||||||
options = {
|
options.selection-clipboard = "clipboard";
|
||||||
selection-clipboard = "clipboard";
|
|
||||||
# first-page-column = "1:1"; # makes side-by-side mode start on the left side
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
users.mutableUsers = false;
|
users.mutableUsers = false;
|
||||||
|
|
||||||
users.defaultUserShell = pkgs.zsh;
|
|
||||||
|
|
||||||
users.users.me = {
|
users.users.me = {
|
||||||
name = "kfm";
|
name = "kfm";
|
||||||
description = kieran.name;
|
description = config.niveum.user.name;
|
||||||
hashedPasswordFile = config.age.secrets.kfm-password.path;
|
home = "/home/kfm";
|
||||||
isNormalUser = true;
|
createHome = true;
|
||||||
uid = 1000;
|
group = "users";
|
||||||
extraGroups = [
|
hashedPassword = "$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/";
|
||||||
"pipewire"
|
shell = pkgs.zsh;
|
||||||
"audio"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
nix.settings.trusted-users = [ config.users.users.me.name ];
|
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
kfm-password.file = ../secrets/kfm-password.age;
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.me.xdg.enable = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
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.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" ];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
services.displayManager = {
|
sound.enable = true;
|
||||||
autoLogin = {
|
|
||||||
enable = true;
|
hardware.pulseaudio = {
|
||||||
user = config.users.users.me.name;
|
enable = true;
|
||||||
|
package = pkgs.pulseaudioFull; # for bluetooth sound output
|
||||||
|
};
|
||||||
|
|
||||||
|
users.users.me.extraGroups = [ "audio" ];
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.pavucontrol pkgs.pamixer ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
environment.systemPackages = [
|
||||||
|
(pkgs.writers.writeDashBin "niveum-deploy" ''
|
||||||
|
NIVEUM_DIR=/home/kfm/prog/git/niveum
|
||||||
|
|
||||||
|
[ $# -eq 1 ] || echo >&2 "Usage: niveum-deploy SYSTEM"
|
||||||
|
|
||||||
|
eval $(nix-build --no-out-link "$NIVEUM_DIR/deploy.nix" -A "$1")
|
||||||
|
'')
|
||||||
|
(pkgs.writers.writeDashBin "niveum-update" ''
|
||||||
|
NIVEUM_DIR=/home/kfm/prog/git/niveum
|
||||||
|
|
||||||
|
nix-prefetch-git --url https://github.com/NixOS/nixpkgs-channels --rev refs/heads/nixos-${config.system.stateVersion} > "$NIVEUM_DIR/nixpkgs.json"
|
||||||
|
'')
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
environment.interactiveShellInit = "export PATH=$PATH:$HOME/.cargo/bin";
|
||||||
|
environment.shellAliases = {
|
||||||
|
clipboard = "${pkgs.xclip}/bin/xclip -se c";
|
||||||
|
o = "${pkgs.xdg_utils}/bin/xdg-open";
|
||||||
|
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||||
|
ip = "${pkgs.iproute}/bin/ip -c";
|
||||||
|
ns = "nix-shell --run zsh";
|
||||||
|
nixi = ''nix repl "<nixpkgs>"'';
|
||||||
|
rm = "rm -i";
|
||||||
|
cp = "cp -i";
|
||||||
|
mv = "mv -i";
|
||||||
|
l = "${pkgs.exa}/bin/exa -a";
|
||||||
|
ls = "${pkgs.exa}/bin/exa";
|
||||||
|
ll = "${pkgs.exa}/bin/exa -l";
|
||||||
|
la = "${pkgs.exa}/bin/exa -la";
|
||||||
|
dig = "dig +short";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
networking.wireless = {
|
||||||
|
enable = true;
|
||||||
|
userControlled.enable = true;
|
||||||
|
networks = {
|
||||||
|
"Aether".pskRaw = "e1b18af54036c5c9a747fe681c6a694636d60a5f8450f7dec0d76bc93e2ec85a";
|
||||||
|
"Asoziales Netzwerk".pskRaw = "8e234041ec5f0cd1b6a14e9adeee9840ed51b2f18856a52137485523e46b0cb6";
|
||||||
|
"EasyBox-927376".pskRaw = "dbd490ab69b39bd67cfa06daf70fc3ef3ee90f482972a668ed758f90f5577c22";
|
||||||
|
"FlixBus Wi-Fi" = {};
|
||||||
|
"FlixBus" = {};
|
||||||
|
"FlixTrain" = {};
|
||||||
|
"Libertarian WiFi".pskRaw = "e9beaae6ffa55d10e80b8a2e7d997411d676a3cc6f1f29d0b080391f04555050";
|
||||||
|
"Ni/Schukajlow".pskRaw = "ffc47f6829da59c48aea878a32252223303f5c47a3859edc90971ffc63346781";
|
||||||
|
"WIFIonICE" = {};
|
||||||
|
"WLAN-914742".psk = "67647139648174545446";
|
||||||
|
"WLAN-XVMU6T".pskRaw = "46ea807283255a3d7029233bd79c18837df582666c007c86a8d591f65fae17cc";
|
||||||
|
"c-base-public" = {};
|
||||||
|
"discord".psk = "baraustrinken";
|
||||||
|
"security-by-obscurity".psk = "44629828256481964386";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.wpa_supplicant_gui ];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
networking.hosts = {
|
||||||
|
"192.168.178.1" = [ "fritz.box" ];
|
||||||
|
"192.168.178.21" = [ "scardanelli" ];
|
||||||
|
"192.168.178.22" = [ "homeros" ];
|
||||||
|
"192.168.178.24" = [ "catullus" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
i18n.defaultLocale = "en_GB.UTF-8";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
services.illum.enable = true;
|
||||||
|
}
|
||||||
|
{
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
displayManager.lightdm = {
|
displayManager.lightdm = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
autoLogin.enable = true;
|
||||||
|
autoLogin.user = config.users.users.me.name;
|
||||||
greeters.gtk = {
|
greeters.gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
indicators = [
|
indicators = [ "~spacer" "~host" "~spacer" "~session" "~power" ];
|
||||||
"~spacer"
|
|
||||||
"~host"
|
|
||||||
"~spacer"
|
|
||||||
"~session"
|
|
||||||
"~power"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
desktopManager.default = "none";
|
||||||
}
|
|
||||||
{ 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
|
|
||||||
]))
|
|
||||||
];
|
|
||||||
}
|
|
||||||
{
|
|
||||||
services.atd.enable = true;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
services.getty = {
|
|
||||||
greetingLine = lib.mkForce "";
|
|
||||||
helpLine = lib.mkForce "";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
networking.hosts = lib.mapAttrs' (name: address: {
|
security.wrappers = {
|
||||||
name = address;
|
pmount.source = "${pkgs.pmount}/bin/pmount";
|
||||||
value = [ "${name}.local" ];
|
pumount.source = "${pkgs.pmount}/bin/pumount";
|
||||||
}) 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" ];
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = "${pkgs.udiskie}/bin/udiskie --verbose --no-config --notify";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
services.udisks2.enable = true;
|
|
||||||
programs.dconf.enable = true;
|
|
||||||
home-manager.users.me = {
|
|
||||||
dconf.enable = true;
|
|
||||||
dconf.settings = {
|
|
||||||
# Change the default terminal for Nemo
|
|
||||||
"org/cinnamon/desktop/applications/terminal".exec = defaultApplications.terminal;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
./android.nix
|
|
||||||
./admin-essentials.nix
|
|
||||||
./stylix.nix
|
|
||||||
./alacritty.nix
|
|
||||||
./backup.nix
|
|
||||||
./bash.nix
|
|
||||||
./bluetooth.nix
|
|
||||||
./aerc.nix
|
|
||||||
./ccc.nix
|
|
||||||
./khal.nix
|
|
||||||
./browser.nix
|
|
||||||
./clipboard.nix
|
|
||||||
./cloud.nix
|
|
||||||
./direnv.nix
|
|
||||||
./docker.nix
|
|
||||||
./dunst.nix
|
|
||||||
./flix.nix
|
|
||||||
./fonts.nix
|
|
||||||
./fzf.nix
|
|
||||||
./git.nix
|
|
||||||
./hledger.nix
|
|
||||||
./htop.nix
|
|
||||||
./fu-berlin.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; }
|
|
||||||
{ services.upower.enable = true; }
|
|
||||||
./lb.nix
|
|
||||||
./mpv.nix
|
|
||||||
./mime.nix
|
|
||||||
./neovim.nix
|
|
||||||
./nix.nix
|
|
||||||
./newsboat.nix
|
|
||||||
./flameshot.nix
|
|
||||||
./fritzbox.nix
|
|
||||||
./packages.nix
|
|
||||||
./picom.nix
|
|
||||||
./stardict.nix
|
|
||||||
./polkit.nix
|
|
||||||
./printing.nix
|
|
||||||
./redshift.nix
|
|
||||||
./retiolum.nix
|
|
||||||
./rofi.nix
|
|
||||||
./spacetime.nix
|
|
||||||
./ssh.nix
|
|
||||||
./sshd.nix
|
|
||||||
./sound.nix
|
|
||||||
./sudo.nix
|
|
||||||
./tmux.nix
|
|
||||||
./unclutter.nix
|
|
||||||
./vscode.nix
|
|
||||||
./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
|
|
||||||
{
|
|
||||||
fileSystems."${remoteDir}/fritz" = {
|
|
||||||
device = "//192.168.178.1/FRITZ.NAS/Backup";
|
|
||||||
fsType = "cifs";
|
|
||||||
options = [
|
|
||||||
"username=ftpuser"
|
|
||||||
"password=ftppassword"
|
|
||||||
"noauto"
|
|
||||||
"nounix"
|
|
||||||
"rw"
|
|
||||||
# "noserverino" # ref https://askubuntu.com/a/1265165
|
|
||||||
"uid=${toString config.users.users.me.uid}"
|
|
||||||
"gid=${toString config.users.groups.users.gid}"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"x-systemd.device-timeout=1"
|
|
||||||
"x-systemd.idle-timeout=1min"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
home-manager.users.me = {
|
programs.command-not-found.enable = true;
|
||||||
xdg.userDirs = rec {
|
}
|
||||||
enable = true;
|
{
|
||||||
documents = "${config.users.users.me.home}/cloud/nextcloud/Documents";
|
programs.java = {
|
||||||
desktop = "/tmp";
|
enable = true;
|
||||||
download = "${config.users.users.me.home}/sync/Downloads";
|
package = pkgs.openjdk;
|
||||||
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";
|
|
||||||
videos = pictures;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,37 +0,0 @@
|
|||||||
{pkgs, ...}: let
|
|
||||||
nixify = pkgs.writers.writeDashBin "nixify" ''
|
|
||||||
set -efuC
|
|
||||||
|
|
||||||
if [ ! -e ./.envrc ]; then
|
|
||||||
echo use_nix > .envrc
|
|
||||||
direnv allow
|
|
||||||
fi
|
|
||||||
if [ ! -e shell.nix ]; then
|
|
||||||
cat > shell.nix <<'EOF'
|
|
||||||
{ pkgs ? import <nixpkgs> {} }:
|
|
||||||
pkgs.mkShell {
|
|
||||||
packages = [];
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
''${EDITOR:-vim} shell.nix
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
environment.systemPackages = [pkgs.direnv nixify];
|
|
||||||
|
|
||||||
home-manager.users.me.programs.direnv = {
|
|
||||||
enable = true;
|
|
||||||
stdlib = builtins.readFile "${
|
|
||||||
pkgs.fetchFromGitHub {
|
|
||||||
owner = "Mic92";
|
|
||||||
repo = "dotfiles";
|
|
||||||
rev = "a0a9b7e358fa70a85cd468f8ca1fbb02ae0a91df";
|
|
||||||
sha256 = "1y9h5s1lf59sczsm0ksq2x1yhl98ba9lwk5yil3q53rg7n4574pg";
|
|
||||||
}
|
|
||||||
}/home/.direnvrc";
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.zsh.interactiveShellInit = ''
|
|
||||||
eval "$(${pkgs.direnv}/bin/direnv hook zsh)"
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,15 +1,13 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
(import <stockholm/makefu/3modules/bump-distrowatch.nix> {
|
(import <stockholm/makefu/3modules/bump-distrowatch.nix> {
|
||||||
inherit lib config;
|
inherit lib config;
|
||||||
pkgs = pkgs // {writeDash = pkgs.writers.writeDash;};
|
pkgs = pkgs // {
|
||||||
|
writeDash = pkgs.writers.writeDash;
|
||||||
|
};
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
makefu.distrobump.enable = false;
|
makefu.distrobump.enable = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,6 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
lib,
|
virtualisation.docker.enable = true;
|
||||||
pkgs,
|
users.users.me.extraGroups = [ "docker" ];
|
||||||
...
|
environment.systemPackages = [ pkgs.docker pkgs.docker_compose ];
|
||||||
}: {
|
|
||||||
virtualisation.docker = {
|
|
||||||
enable = true;
|
|
||||||
# for ICE wifi, ref https://gist.github.com/sunsided/7840e89ff4e11b64a2d7503fafa0290c
|
|
||||||
extraOptions = lib.concatStringsSep " " [
|
|
||||||
"--bip=172.39.1.5/24"
|
|
||||||
"--fixed-cidr=172.39.1.0/25"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
users.users.me.extraGroups = ["docker"];
|
|
||||||
environment.systemPackages = [pkgs.docker pkgs.docker-compose];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,24 @@
|
|||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
with config.niveum; {
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import ../lib) defaultApplications theme;
|
|
||||||
sgr = code: string: ''\u001b[${code}m${string}\u001b[0m'';
|
|
||||||
in {
|
|
||||||
environment.systemPackages = [
|
|
||||||
(pkgs.writers.writeDashBin "notifications" ''
|
|
||||||
${pkgs.dunst}/bin/dunstctl history \
|
|
||||||
| ${pkgs.jq}/bin/jq -r '
|
|
||||||
.data[]
|
|
||||||
| map("${sgr "90" ''\(.appname.data)''} ${sgr "1" ''\(.summary.data)''} ${sgr "31" ''\(.body.data | gsub("\n"; " | "))''}")
|
|
||||||
| join("\n")'
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager.users.me.services.dunst = {
|
home-manager.users.me.services.dunst = {
|
||||||
enable = true;
|
enable = true;
|
||||||
iconTheme = (theme pkgs).icon;
|
iconTheme = theme.icon;
|
||||||
settings = {
|
settings = {
|
||||||
global = {
|
global = {
|
||||||
transparency = 10;
|
transparency = 10;
|
||||||
|
font = "${fonts.terminal.name} ${toString fonts.terminal.size}";
|
||||||
geometry = "200x5-30+20";
|
geometry = "200x5-30+20";
|
||||||
|
frame_color = colours.foreground;
|
||||||
follow = "mouse";
|
follow = "mouse";
|
||||||
indicate_hidden = true;
|
indicate_hidden = true;
|
||||||
notification_height = 0;
|
notification_height = 0;
|
||||||
separator_height = 2;
|
separator_height = 2;
|
||||||
padding = 8;
|
padding = 8;
|
||||||
horizontal_padding = 8;
|
horizontal_padding = 8;
|
||||||
|
separator_color = "auto";
|
||||||
sort = true;
|
sort = true;
|
||||||
markup = "full";
|
markup = "full";
|
||||||
format = "%a\\n<b>%s</b>\\n%b";
|
format = ''%a\n<b>%s</b>\n%b'';
|
||||||
alignment = "left";
|
alignment = "left";
|
||||||
show_age_threshold = 60;
|
show_age_threshold = 60;
|
||||||
bounce_freq = 0;
|
bounce_freq = 0;
|
||||||
@@ -44,20 +31,29 @@ in {
|
|||||||
sticky_history = true;
|
sticky_history = true;
|
||||||
history_length = 20;
|
history_length = 20;
|
||||||
dmenu = "${pkgs.rofi}/bin/rofi -display-run dunst -show run";
|
dmenu = "${pkgs.rofi}/bin/rofi -display-run dunst -show run";
|
||||||
browser = (defaultApplications pkgs).browser;
|
browser = applications.browser;
|
||||||
verbosity = "mesg";
|
verbosity = "mesg";
|
||||||
corner_radius = 0;
|
corner_radius = 0;
|
||||||
mouse_left_click = "do_action";
|
mouse_left_click = "do_action";
|
||||||
mouse_right_click = "close_current";
|
mouse_right_click = "close_current";
|
||||||
mouse_middle_click = "close_all";
|
mouse_middle_click = "close_all";
|
||||||
};
|
};
|
||||||
urgency_low = {
|
urgency_low = rec {
|
||||||
|
frame_color = background;
|
||||||
|
background = colours.foreground;
|
||||||
|
foreground = colours.background;
|
||||||
timeout = 5;
|
timeout = 5;
|
||||||
};
|
};
|
||||||
urgency_normal = {
|
urgency_normal = rec {
|
||||||
|
frame_color = background;
|
||||||
|
background = colours.foreground;
|
||||||
|
foreground = colours.background;
|
||||||
timeout = 10;
|
timeout = 10;
|
||||||
};
|
};
|
||||||
urgency_critical = {
|
urgency_critical = rec {
|
||||||
|
frame_color = background;
|
||||||
|
background = colours.red.dark;
|
||||||
|
foreground = colours.background;
|
||||||
timeout = 0;
|
timeout = 0;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
home-manager.users.me = {
|
|
||||||
services.flameshot = {
|
|
||||||
package = pkgs.flameshot.override { enableWlrSupport = true; };
|
|
||||||
enable = true;
|
|
||||||
settings.General = {
|
|
||||||
autoCloseIdleDaemon = true;
|
|
||||||
drawColor = "#ff0000";
|
|
||||||
drawThickness = 2;
|
|
||||||
showDesktopNotification = true;
|
|
||||||
disabledTrayIcon = true;
|
|
||||||
showHelp = false;
|
|
||||||
squareMagnifier = true;
|
|
||||||
uploadWithoutConfirmation = true;
|
|
||||||
buttons = ''@Variant(\0\0\0\x7f\0\0\0\vQList<int>\0\0\0\0\x10\0\0\0\x2\0\0\0\x5\0\0\0\x13\0\0\0\xa\0\0\0\x1\0\0\0\xc\0\0\0\xd\0\0\0\x6\0\0\0\x8\0\0\0\0\0\0\0\xf\0\0\0\x4\0\0\0\xb\0\0\0\x3\0\0\0\x12\0\0\0\x9)'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
flixLocation = "/media/flix";
|
|
||||||
flixLocationNew = "/media/flix-new";
|
|
||||||
cacheLocation = "/var/cache/flix";
|
|
||||||
indexFilename = "index";
|
|
||||||
indexFilenameNew = "index-new";
|
|
||||||
flixUser = "flix";
|
|
||||||
flixGroup = "users";
|
|
||||||
inherit (import ../lib) tmpfilesConfig;
|
|
||||||
in {
|
|
||||||
fileSystems.${flixLocation} = {
|
|
||||||
device = "prism.r:/export/download";
|
|
||||||
fsType = "nfs";
|
|
||||||
options = [
|
|
||||||
"noauto"
|
|
||||||
"noatime"
|
|
||||||
"nodiratime"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"x-systemd.device-timeout=1"
|
|
||||||
"x-systemd.idle-timeout=1min"
|
|
||||||
"x-systemd.requires=tinc.retiolum.service"
|
|
||||||
"user"
|
|
||||||
"_netdev"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
fileSystems.${flixLocationNew} = {
|
|
||||||
device = "//yellow.r/public";
|
|
||||||
fsType = "cifs";
|
|
||||||
options = [
|
|
||||||
"guest"
|
|
||||||
"nofail"
|
|
||||||
"noauto"
|
|
||||||
"ro"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"x-systemd.device-timeout=1"
|
|
||||||
"x-systemd.idle-timeout=1min"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
|
||||||
(tmpfilesConfig {
|
|
||||||
type = "d";
|
|
||||||
path = cacheLocation;
|
|
||||||
mode = "0750";
|
|
||||||
user = flixUser;
|
|
||||||
group = flixGroup;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.flix-index = {
|
|
||||||
description = "Flix indexing service";
|
|
||||||
wants = ["network-online.target"];
|
|
||||||
script = ''
|
|
||||||
cp ${flixLocation}/index ./${indexFilename}
|
|
||||||
cp ${flixLocationNew}/index ./${indexFilenameNew}
|
|
||||||
'';
|
|
||||||
startAt = "hourly";
|
|
||||||
serviceConfig = {
|
|
||||||
Type = "oneshot";
|
|
||||||
User = flixUser;
|
|
||||||
Group = flixGroup;
|
|
||||||
WorkingDirectory = cacheLocation;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.extraUsers.${flixUser} = {
|
|
||||||
isSystemUser = true;
|
|
||||||
createHome = true;
|
|
||||||
home = cacheLocation;
|
|
||||||
group = flixGroup;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
(pkgs.writers.writeDashBin "mpv-simpsons" ''
|
|
||||||
set -efu
|
|
||||||
cd "${flixLocation}/download"
|
|
||||||
[ -f "${cacheLocation}/${indexFilename}" ] || exit 1
|
|
||||||
|
|
||||||
cat "${cacheLocation}/${indexFilename}" \
|
|
||||||
| ${pkgs.gnugrep}/bin/grep -i 'simpsons.*mkv' \
|
|
||||||
| shuf \
|
|
||||||
| ${pkgs.findutils}/bin/xargs -d '\n' ${pkgs.mpv}/bin/mpv
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "flixmenu" ''
|
|
||||||
set -efu
|
|
||||||
(
|
|
||||||
${pkgs.gnused}/bin/sed 's#^\.#${flixLocation}#' ${cacheLocation}/${indexFilename}
|
|
||||||
${pkgs.gnused}/bin/sed 's#^\.#${flixLocationNew}#' ${cacheLocation}/${indexFilenameNew}
|
|
||||||
) | ${pkgs.dmenu}/bin/dmenu -i -p flix -l 5 "$@" \
|
|
||||||
| ${pkgs.findutils}/bin/xargs -I '{}' ${pkgs.util-linux}/bin/setsid ${pkgs.xdg-utils}/bin/xdg-open '{}'
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,142 +1,19 @@
|
|||||||
|
{ pkgs, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
niveum.fonts = {
|
||||||
config,
|
ui = {
|
||||||
niveumPackages,
|
name = "Sans";
|
||||||
...
|
size = 9;
|
||||||
}: let
|
|
||||||
zip-font = name: arguments: let
|
|
||||||
directory = pkgs.fetchzip arguments;
|
|
||||||
in
|
|
||||||
pkgs.runCommand name {} ''
|
|
||||||
mkdir -p $out/share/fonts/{truetype,opentype,woff}
|
|
||||||
${pkgs.findutils}/bin/find ${directory} -name '*.ttf' -exec install '{}' $out/share/fonts/truetype \;
|
|
||||||
${pkgs.findutils}/bin/find ${directory} -name '*.otf' -exec install '{}' $out/share/fonts/opentype \;
|
|
||||||
${pkgs.findutils}/bin/find ${directory} -name '*.woff' -exec install '{}' $out/share/fonts/woff \;
|
|
||||||
'';
|
|
||||||
simple-ttf = name: arguments: let
|
|
||||||
file = pkgs.fetchurl arguments;
|
|
||||||
in
|
|
||||||
pkgs.runCommand name {} ''
|
|
||||||
mkdir -p $out/share/fonts/truetype
|
|
||||||
install ${file} $out/share/fonts/truetype
|
|
||||||
'';
|
|
||||||
|
|
||||||
egyptianHiero = zip-font "EgyptianHiero" {
|
|
||||||
url = "https://github.com/MKilani/Djehuty/archive/master.zip";
|
|
||||||
sha256 = "sha256-S3vZxdeBj57KJsF+zaZw7sQw8T+z1aVC2CnpnZ0/x2c=";
|
|
||||||
};
|
|
||||||
antinoou = zip-font "Antinoou" {
|
|
||||||
url = "https://www.evertype.com/fonts/coptic/AntinoouFont.zip";
|
|
||||||
sha256 = "0jwihj08n4yrshcx07dnaml2x9yws6dgyjkvg19jqbz17drbp3sw";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
newGardiner = zip-font "NewGardiner" {
|
|
||||||
url = "https://mjn.host.cs.st-andrews.ac.uk/egyptian/fonts/NewGardiner.zip";
|
|
||||||
hash = "sha256-nP0y4ILt+0mlkDRdCNSeO2Gequ8wyix/qQdmujTNw3Y=";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
newAthenaUnicode = zip-font "NewAthenaUnicode" {
|
|
||||||
url = "https://classicalstudies.org/sites/default/files/userfiles/files/NAU5_005.zip";
|
|
||||||
sha256 = "1g7qk9gl4nq2dz41bvck1nzilhin44j8691cxax3dlp77bbn9bxr";
|
|
||||||
};
|
|
||||||
jsesh = simple-ttf "JSesh" {
|
|
||||||
url = "http://files.qenherkhopeshef.org/jsesh/JSeshFont.ttf";
|
|
||||||
sha256 = "1203jrk2xzvgckcc5hx88kja1i3h8gm1wiyla5j6gspc0hbv56ry";
|
|
||||||
};
|
|
||||||
egyptianTextBeta = simple-ttf "EgyptianText-1.0beta" {
|
|
||||||
url = "http://c.krebsco.de/EgyptianText-v1.0-beta.ttf";
|
|
||||||
sha256 = "0cfjbk7xxnxhlp6v922psm5j1xzrv6wfk226ji2wz2yfrnkbcbsv";
|
|
||||||
};
|
|
||||||
coranica = simple-ttf "Coranica" {
|
|
||||||
url = "https://corpuscoranicum.de/fonts/coranica_1164.ttf";
|
|
||||||
sha256 = "0igi8q8b2p38x9jq8c98afsl7bf8rj32zj2052yyjgj9r88y4yi5";
|
|
||||||
};
|
|
||||||
koineGreek = simple-ttf "KoineGreek.ttf" {
|
|
||||||
url = "https://github.com/Center-for-New-Testament-Restoration/font/raw/af83eed50105344edaa5e5eddaf87696e271468c/KoineGreek.ttf";
|
|
||||||
hash = "sha256-YtC+nj7+Jl8k00rqAAqySYc8iTAOL7PixXc+LfSmnS0=";
|
|
||||||
};
|
|
||||||
egyptianText = simple-ttf "EgyptianText" {
|
|
||||||
url = "https://github.com/microsoft/font-tools/raw/1092cb23520967830001a0807eb21d6a44dda522/EgyptianOpenType/font/eot.ttf";
|
|
||||||
sha256 = "1n294vhcx90270pnsw1dbk6izd61fjvbnjrh4hcf98ff3s540x0c";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
fonts = {
|
|
||||||
enableDefaultPackages = true;
|
|
||||||
fontDir.enable = true;
|
|
||||||
packages = with pkgs; [
|
|
||||||
alegreya
|
|
||||||
alegreya-sans
|
|
||||||
amiri
|
|
||||||
annapurna-sil
|
|
||||||
antinoou
|
|
||||||
cantarell-fonts
|
|
||||||
cardo
|
|
||||||
charis-sil
|
|
||||||
doulos-sil
|
|
||||||
newAthenaUnicode
|
|
||||||
coranica
|
|
||||||
corefonts
|
|
||||||
crimson
|
|
||||||
eb-garamond
|
|
||||||
ipaexfont
|
|
||||||
jsesh
|
|
||||||
egyptianHiero
|
|
||||||
egyptianText
|
|
||||||
egyptianTextBeta
|
|
||||||
font-awesome_6
|
|
||||||
etBook
|
|
||||||
newGardiner
|
|
||||||
junicode
|
|
||||||
koineGreek
|
|
||||||
# brill
|
|
||||||
ezra-sil
|
|
||||||
fira
|
|
||||||
font-awesome
|
|
||||||
galatia-sil
|
|
||||||
gentium
|
|
||||||
# niveumPackages.gfs-fonts
|
|
||||||
gyre-fonts
|
|
||||||
ibm-plex
|
|
||||||
jetbrains-mono
|
|
||||||
libertinus
|
|
||||||
libre-bodoni
|
|
||||||
lmodern
|
|
||||||
merriweather
|
|
||||||
ocr-a
|
|
||||||
roboto
|
|
||||||
roboto-mono
|
|
||||||
noto-fonts
|
|
||||||
noto-fonts-cjk-sans
|
|
||||||
noto-fonts-emoji
|
|
||||||
nerd-fonts.blex-mono
|
|
||||||
roboto-slab
|
|
||||||
scheherazade-new
|
|
||||||
source-code-pro
|
|
||||||
source-sans-pro
|
|
||||||
source-serif-pro
|
|
||||||
theano
|
|
||||||
niveumPackages.tocharian-font
|
|
||||||
vistafonts
|
|
||||||
vollkorn
|
|
||||||
zilla-slab
|
|
||||||
]; # google-fonts league-of-moveable-type
|
|
||||||
fontconfig.defaultFonts = rec {
|
|
||||||
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
|
terminal = {
|
||||||
# ref https://tex.stackexchange.com/questions/392144/xelatex-and-fontspec-crash-trying-to-find-woff-file-for-some-fonts-but-not-other
|
name = "Monospace";
|
||||||
fontconfig.localConf = ''
|
size = 9;
|
||||||
<fontconfig>
|
};
|
||||||
<!-- Reject WOFF fonts We don't register WOFF(2) fonts with fontconfig because of the W3C spec -->
|
};
|
||||||
<selectfont>
|
|
||||||
<rejectfont>
|
fonts = {
|
||||||
<glob>*.woff*</glob>
|
enableDefaultFonts = true;
|
||||||
</rejectfont>
|
enableFontDir = true;
|
||||||
</selectfont>
|
fonts = with pkgs; [ corefonts eb-garamond fira libertine lmodern noto-fonts roboto ubuntu_font_family ];
|
||||||
</fontconfig>
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
{ 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=";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,153 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
username = "meinhak99";
|
|
||||||
inherit (import ../lib/email.nix) defaults pronouns;
|
|
||||||
inherit (import ../lib) remoteDir;
|
|
||||||
fu-defaults = rec {
|
|
||||||
imap.host = "mail.zedat.fu-berlin.de";
|
|
||||||
imap.port = 993;
|
|
||||||
imap.tls.enable = true;
|
|
||||||
smtp.host = imap.host;
|
|
||||||
smtp.port = 465;
|
|
||||||
smtp.tls.enable = true;
|
|
||||||
folders.drafts = "Entwürfe";
|
|
||||||
folders.sent = "Gesendet";
|
|
||||||
folders.trash = "Papierkorb";
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
home-manager.users.me = {
|
|
||||||
programs.ssh = {
|
|
||||||
matchBlocks = {
|
|
||||||
fu-berlin = {
|
|
||||||
user = username;
|
|
||||||
hostname = "login.zedat.fu-berlin.de";
|
|
||||||
setEnv.TERM = "xterm";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
accounts.email.accounts = {
|
|
||||||
fu-student =
|
|
||||||
lib.recursiveUpdate defaults
|
|
||||||
(lib.recursiveUpdate fu-defaults
|
|
||||||
rec {
|
|
||||||
userName = "meinhak99";
|
|
||||||
address = "kieran.meinhardt@fu-berlin.de";
|
|
||||||
aliases = ["${userName}@fu-berlin.de"];
|
|
||||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhak99.path}";
|
|
||||||
aerc.extraAccounts.signature-file = toString (pkgs.writeText "signature" signature.text);
|
|
||||||
signature = {
|
|
||||||
showSignature = "append";
|
|
||||||
text = ''
|
|
||||||
${defaults.realName}
|
|
||||||
${pronouns}
|
|
||||||
|
|
||||||
---
|
|
||||||
Studentische Hilfskraft / ZODIAC
|
|
||||||
Freie Universität Berlin
|
|
||||||
|
|
||||||
Telefon: +49 30 838 58118
|
|
||||||
Arnimallee 10, Raum 106, 14195 Berlin
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
himalaya = {
|
|
||||||
enable = true;
|
|
||||||
settings.backend = "imap";
|
|
||||||
};
|
|
||||||
});
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
email-password-meinhak99 = {
|
|
||||||
file = ../secrets/email-password-meinhak99.age;
|
|
||||||
owner = config.users.users.me.name;
|
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "400";
|
|
||||||
};
|
|
||||||
fu-sftp-key = {
|
|
||||||
file = ../secrets/fu-sftp-key.age;
|
|
||||||
owner = "root";
|
|
||||||
group = "root";
|
|
||||||
mode = "400";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
# if it fails with "connection reset by peer" run `sudo sshfs ... ... -o ...` manually
|
|
||||||
# it needs to say 'yes' to the server's fingerprint
|
|
||||||
system.fsPackages = [ pkgs.sshfs ];
|
|
||||||
|
|
||||||
# https://www.zedat.fu-berlin.de/tip4u_157.pdf
|
|
||||||
fileSystems = let
|
|
||||||
fu-berlin-cifs-options = [
|
|
||||||
"uid=${toString config.users.users.me.uid}"
|
|
||||||
"gid=${toString config.users.groups.users.gid}"
|
|
||||||
"rw"
|
|
||||||
"nounix"
|
|
||||||
"domain=fu-berlin"
|
|
||||||
"noauto"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"x-systemd.device-timeout=1"
|
|
||||||
"x-systemd.idle-timeout=1min"
|
|
||||||
];
|
|
||||||
|
|
||||||
firstCharacter = lib.strings.substring 0 1;
|
|
||||||
|
|
||||||
home-directory-mount = user: {
|
|
||||||
"${remoteDir}/fu/${user}/home" = {
|
|
||||||
device = "${user}@login.zedat.fu-berlin.de:/home/${firstCharacter user}/${user}";
|
|
||||||
fsType = "sshfs";
|
|
||||||
options = [
|
|
||||||
"allow_other"
|
|
||||||
"_netdev"
|
|
||||||
"x-systemd.automount"
|
|
||||||
"reconnect"
|
|
||||||
"ServerAliveInterval=15"
|
|
||||||
"IdentityFile=${config.age.secrets.fu-sftp-key.path}"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
"${remoteDir}/fu/zodiac" = {
|
|
||||||
device = "//trove.storage.fu-berlin.de/GESCHKULT";
|
|
||||||
fsType = "cifs";
|
|
||||||
options =
|
|
||||||
fu-berlin-cifs-options
|
|
||||||
++ [
|
|
||||||
"credentials=${config.age.secrets.cifs-credentials-zodiac.path}"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
} // home-directory-mount "meinhak99"
|
|
||||||
// home-directory-mount "xm7234fu";
|
|
||||||
|
|
||||||
age.secrets = {
|
|
||||||
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 = false;
|
|
||||||
wants = ["network-online.target"];
|
|
||||||
serviceConfig.LoadCredential = "password:${config.age.secrets.email-password-meinhak99.path}";
|
|
||||||
script = ''
|
|
||||||
if ${pkgs.wirelesstools}/bin/iwgetid | ${pkgs.gnugrep}/bin/grep --invert-match eduroam
|
|
||||||
then
|
|
||||||
cat "$CREDENTIALS_DIRECTORY/password" | ${pkgs.openconnect}/bin/openconnect vpn.fu-berlin.de --user ${username} --passwd-on-stdin
|
|
||||||
fi
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import ../lib/email.nix) defaults;
|
|
||||||
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
|
|
||||||
in {
|
|
||||||
age.secrets = {
|
|
||||||
email-password-fysi = {
|
|
||||||
file = ../secrets/email-password-fysi.age;
|
|
||||||
owner = config.users.users.me.name;
|
|
||||||
group = config.users.users.me.group;
|
|
||||||
mode = "400";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
|
||||||
accounts.email.accounts = {
|
|
||||||
fysi =
|
|
||||||
lib.recursiveUpdate defaults
|
|
||||||
rec {
|
|
||||||
address = "kieran@fysi.tech";
|
|
||||||
userName = address;
|
|
||||||
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-fysi.path}";
|
|
||||||
flavor = "fastmail.com";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.ssh.matchBlocks = rec {
|
|
||||||
"nextcloud.fysi.dev" = {
|
|
||||||
hostname = "116.203.82.203";
|
|
||||||
user = "root";
|
|
||||||
};
|
|
||||||
"lingua.miaengiadina.ch" = {
|
|
||||||
hostname = "135.181.85.233";
|
|
||||||
user = "root";
|
|
||||||
};
|
|
||||||
"cms-dev.woc2023.app".identityFile = sshIdentity "fysiweb";
|
|
||||||
"cms-master.woc2023.app".identityFile = sshIdentity "fysiweb";
|
|
||||||
"fysi-dev1" = {
|
|
||||||
hostname = "94.130.229.139";
|
|
||||||
user = "root";
|
|
||||||
identityFile = sshIdentity "fysiweb";
|
|
||||||
};
|
|
||||||
${fysi-dev1.hostname} = fysi-dev1;
|
|
||||||
"fysi-shared0" = {
|
|
||||||
hostname = "49.12.205.235";
|
|
||||||
user = "root";
|
|
||||||
identityFile = sshIdentity "fysiweb";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
programs.fzf = {
|
|
||||||
fuzzyCompletion = true;
|
|
||||||
keybindings = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
|
||||||
programs.fzf = rec {
|
|
||||||
enable = true;
|
|
||||||
defaultCommand = "${pkgs.fd}/bin/fd --type f --strip-cwd-prefix --follow --no-ignore-vcs --exclude .git";
|
|
||||||
defaultOptions = ["--height=40%"];
|
|
||||||
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
|
|
||||||
changeDirWidgetOptions = [
|
|
||||||
"--preview='${pkgs.tree}/bin/tree -L 1 {}'"
|
|
||||||
"--bind=space:toggle-preview"
|
|
||||||
"--preview-window=hidden"
|
|
||||||
];
|
|
||||||
fileWidgetCommand = defaultCommand;
|
|
||||||
fileWidgetOptions = ["--preview='head -$LINES {}'"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,36 +1,25 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
inputs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import ../lib) kieran ignorePaths;
|
|
||||||
in {
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.mr
|
pkgs.mr
|
||||||
pkgs.gitFull
|
pkgs.git
|
||||||
pkgs.git-crypt
|
pkgs.gitAndTools.hub
|
||||||
pkgs.gitflow
|
pkgs.gitAndTools.git-extras
|
||||||
pkgs.gh
|
|
||||||
pkgs.git-extras
|
|
||||||
# pkgs.git-trim
|
|
||||||
pkgs.git-absorb
|
|
||||||
pkgs.gitstats
|
pkgs.gitstats
|
||||||
pkgs.patch
|
pkgs.patch
|
||||||
pkgs.patchutils
|
pkgs.patchutils
|
||||||
inputs.self.packages.${pkgs.system}.git-preview
|
pkgs.git-quick-stats
|
||||||
|
pkgs.git-preview
|
||||||
];
|
];
|
||||||
|
|
||||||
environment.shellAliases = {
|
|
||||||
gf = "git-flow";
|
|
||||||
g = "git";
|
|
||||||
};
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
|
home.file.".mrconfig".text = builtins.readFile <dot/mrconfig.ini>;
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.gitFull;
|
package = pkgs.gitAndTools.gitFull;
|
||||||
userName = kieran.name;
|
userName = config.niveum.user.name;
|
||||||
userEmail = kieran.email;
|
userEmail = config.niveum.user.email;
|
||||||
aliases = {
|
aliases = {
|
||||||
br = "branch";
|
br = "branch";
|
||||||
co = "checkout";
|
co = "checkout";
|
||||||
@@ -44,20 +33,7 @@ in {
|
|||||||
logs = "log --pretty=oneline";
|
logs = "log --pretty=oneline";
|
||||||
graph = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
|
graph = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
|
||||||
};
|
};
|
||||||
ignores = ignorePaths;
|
ignores = config.niveum.ignore;
|
||||||
extraConfig = {
|
|
||||||
pull.ff = "only";
|
|
||||||
rebase.autoStash = true;
|
|
||||||
merge.autoStash = true;
|
|
||||||
push.autoSetupRemote = true;
|
|
||||||
|
|
||||||
# # ref https://github.com/dandavison/delta
|
|
||||||
# core.pager = "${pkgs.delta}/bin/delta";
|
|
||||||
# interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
|
|
||||||
# delta.navigate = true;
|
|
||||||
# merge.conflictStyle = "diff3";
|
|
||||||
# diff.colorMoved = "default";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
services.xserver.enable = true;
|
|
||||||
services.xserver.displayManager.lightdm.enable = true;
|
|
||||||
services.xserver.desktopManager.gnome.enable = true;
|
|
||||||
}
|
|
||||||
5
configs/gollum.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
services.gollum = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||
46
configs/haskell/default.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
home-manager.users.me.home.file = {
|
||||||
|
".ghc/ghci.conf".text = ''
|
||||||
|
:set editor vim
|
||||||
|
:def hoogle \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --count=15 \"" ++ s ++ "\""
|
||||||
|
:def doc \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --info \"" ++ s ++ "\""
|
||||||
|
:def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\""
|
||||||
|
:set prompt "\o033[1m%s\o033[1;34m λ\o033[0m "
|
||||||
|
:set -Wall
|
||||||
|
'';
|
||||||
|
# :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\""
|
||||||
|
".stack/config.yaml".text = let user = config.niveum.user; in ''
|
||||||
|
templates:
|
||||||
|
params:
|
||||||
|
author-name: ${user.name}
|
||||||
|
author-email: ${user.email}
|
||||||
|
copyright: 'Copyright: (c) 2019 ${user.name}'
|
||||||
|
github-username: ${user.github}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.hoogle = {
|
||||||
|
enable = true;
|
||||||
|
packages = import ./packages.nix;
|
||||||
|
port = 8091;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
cabal2nix
|
||||||
|
stack2nix
|
||||||
|
cabal-install
|
||||||
|
hlint
|
||||||
|
# haskellPackages.brittany
|
||||||
|
(haskellPackages.ghcWithHoogle (import ./packages.nix))
|
||||||
|
] ++ map haskell.lib.justStaticExecutables [
|
||||||
|
haskellPackages.ghcid
|
||||||
|
haskellPackages.hakyll
|
||||||
|
# haskellPackages.hfmt
|
||||||
|
haskellPackages.hasktags
|
||||||
|
haskellPackages.hindent
|
||||||
|
haskellPackages.pointfree
|
||||||
|
# haskellPackages.pointful
|
||||||
|
haskellPackages.hpack
|
||||||
|
];
|
||||||
|
}
|
||||||
101
configs/haskell/packages.nix
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
haskellPackages:
|
||||||
|
with haskellPackages; [
|
||||||
|
blessings
|
||||||
|
scanner
|
||||||
|
HTTP
|
||||||
|
HUnit
|
||||||
|
MissingH
|
||||||
|
QuickCheck
|
||||||
|
ad
|
||||||
|
adjunctions
|
||||||
|
aeson
|
||||||
|
# algebra
|
||||||
|
ansi-terminal
|
||||||
|
async
|
||||||
|
attoparsec
|
||||||
|
base-orphans
|
||||||
|
bifunctors
|
||||||
|
binary
|
||||||
|
blaze-html
|
||||||
|
blaze-markup
|
||||||
|
brick
|
||||||
|
bytes
|
||||||
|
bytestring
|
||||||
|
case-insensitive
|
||||||
|
cassava
|
||||||
|
cereal
|
||||||
|
clock
|
||||||
|
comonad
|
||||||
|
comonad-transformers
|
||||||
|
conduit
|
||||||
|
conduit-extra
|
||||||
|
constraints
|
||||||
|
containers
|
||||||
|
contravariant
|
||||||
|
criterion
|
||||||
|
data-default
|
||||||
|
diagrams
|
||||||
|
directory
|
||||||
|
dlist
|
||||||
|
either
|
||||||
|
exceptions
|
||||||
|
extra
|
||||||
|
filepath
|
||||||
|
foundation
|
||||||
|
free
|
||||||
|
haskeline
|
||||||
|
hedgehog
|
||||||
|
hourglass
|
||||||
|
hspec
|
||||||
|
http-client
|
||||||
|
http-conduit
|
||||||
|
kan-extensions
|
||||||
|
lens
|
||||||
|
linear
|
||||||
|
lucid
|
||||||
|
megaparsec
|
||||||
|
microlens
|
||||||
|
monad-logger
|
||||||
|
mono-traversable
|
||||||
|
mtl
|
||||||
|
network
|
||||||
|
pandoc
|
||||||
|
parallel
|
||||||
|
parsec
|
||||||
|
persistent
|
||||||
|
pipes
|
||||||
|
pointed
|
||||||
|
pretty-show
|
||||||
|
primitive
|
||||||
|
process
|
||||||
|
profunctors
|
||||||
|
regex-tdfa
|
||||||
|
safe
|
||||||
|
scalpel
|
||||||
|
semigroupoids
|
||||||
|
semigroups
|
||||||
|
servant
|
||||||
|
servant-blaze
|
||||||
|
servant-client
|
||||||
|
servant-docs
|
||||||
|
servant-server
|
||||||
|
servant-swagger
|
||||||
|
split
|
||||||
|
stm
|
||||||
|
tagsoup
|
||||||
|
tasty
|
||||||
|
text
|
||||||
|
time
|
||||||
|
transformers
|
||||||
|
turtle
|
||||||
|
type-unary
|
||||||
|
unix-time
|
||||||
|
unordered-containers
|
||||||
|
vector
|
||||||
|
vinyl
|
||||||
|
void
|
||||||
|
vty
|
||||||
|
warp
|
||||||
|
wreq
|
||||||
|
yaml
|
||||||
|
]
|
||||||
@@ -1,26 +1,15 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
imports = [ <modules/hledger.nix> ];
|
||||||
...
|
|
||||||
}: let
|
niveum.hledger = {
|
||||||
ledgerDirectory = "/home/kfm/sync/src/ledger";
|
enable = true;
|
||||||
hora = pkgs.callPackage ../packages/hora.nix { timeLedger = "${ledgerDirectory}/time.timeclock"; };
|
ledgerFile = "$HOME/prog/git/ledger/current.journal";
|
||||||
in {
|
server = {
|
||||||
environment.systemPackages = let
|
enable = false;
|
||||||
git = "${pkgs.git}/bin/git -C ${ledgerDirectory}";
|
user = config.users.users.me;
|
||||||
in [
|
package = pkgs.unstable.hledger-web;
|
||||||
hora
|
};
|
||||||
pkgs.hledger
|
package = pkgs.unstable.hledger;
|
||||||
(pkgs.writers.writeDashBin "hledger-git" ''
|
};
|
||||||
if [ "$1" = entry ]; then
|
|
||||||
${pkgs.hledger}/bin/hledger balance -V > "${ledgerDirectory}/balance.txt"
|
|
||||||
${git} add balance.txt
|
|
||||||
${git} commit --all --message="$(date -Im)"
|
|
||||||
else
|
|
||||||
${git} $*
|
|
||||||
fi
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "hledger-edit" ''
|
|
||||||
$EDITOR ${ledgerDirectory}/current.journal
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
7
configs/home-assistant.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
services.home-assistant = {
|
||||||
|
enable = true;
|
||||||
|
configWritable = true;
|
||||||
|
lovelaceConfigWritable = true;
|
||||||
|
};
|
||||||
|
}
|
||||||