1
0
mirror of https://github.com/kmein/niveum synced 2026-03-18 11:01:07 +01:00

86 Commits

Author SHA1 Message Date
248ebea28e wip: flakes 2021-12-29 15:15:02 +01:00
2a98e680c2 feat(streams): add rc3 radio 2021-12-29 10:29:33 +01:00
d5087c40b2 feat: use flake nix 2021-12-28 23:24:30 +01:00
23fb65ce1e chore(retiolum): update 2021-12-28 20:49:43 +01:00
c49a5a4187 feat(retiolum): use ed25519 keys 2021-12-28 17:04:54 +01:00
42df2c032e derp 2021-12-28 17:04:54 +01:00
86d6943dd2 feat(kabsa): disable zramfs 2021-12-28 17:04:54 +01:00
6f10cd277d fix(weechat): matrix server 2021-12-28 15:39:56 +01:00
869c6e6a08 fix(vim): make a tiny bit faster 2021-12-28 14:48:29 +01:00
5b131a5a30 feat: flameshot -> flameshot-once 2021-12-28 14:48:09 +01:00
0423429e02 fix: send transits at correct time 2021-12-27 10:40:51 +01:00
f451cc5028 feat(astrolog): configure 2021-12-27 10:29:11 +01:00
8f9e8db71e fix(traadfri): dont timeout 2021-12-25 18:03:57 +01:00
81e6b5c9f6 feat: transits telegram bot 2021-12-25 08:31:11 +01:00
50d8788088 chore: update 2021-12-25 08:31:11 +01:00
805b46ffb1 feat: remove nur-packages 2021-12-25 08:31:10 +01:00
bc9217ba3e feat(weechat): improve zero covid 2021-12-22 23:08:58 +01:00
db2ec25bc1 feat: remove praesenzlehre-berlin.org 2021-12-22 23:06:54 +01:00
33b960143b feat: remove nur-packages 2021-12-22 22:55:43 +01:00
f02225d1e9 feat: use upstream astrolog 2021-12-22 10:19:16 +01:00
9c2e2df05a feat: astrolog 2021-12-21 18:17:37 +01:00
aaeef41f55 feat: anki# 2021-12-21 07:39:23 +01:00
0787da719e fix(retiolum-map): also update index.html 2021-12-20 15:10:19 +01:00
e225a7d451 feat(tinc-graph): update 2021-12-18 10:48:38 +01:00
9d3b29add2 chore: update 2021-12-17 19:02:32 +01:00
5792224240 Revert "feat(shell.nix): colourful parallel"
This reverts commit 5ade0a7011.
2021-12-17 19:02:22 +01:00
ecadc12c9f feat(zaatar): disable tuna 2021-12-16 08:46:02 +01:00
4ecc34b63e feat(tarot): update key file 2021-12-16 00:19:28 +01:00
48e2be7427 feat(tarot): serve files and waites key 2021-12-15 15:01:19 +01:00
296a3a9c9f feat(tarot): occasionally reverse 2021-12-15 15:00:46 +01:00
0136215a4a feat(tarot): run at tarot.kmein.de 2021-12-15 13:54:51 +01:00
dd8a885e81 feat: add transits script 2021-12-15 13:54:51 +01:00
e755ee06e2 feat(makanek): run tarot service on tarot.kmein.r 2021-12-15 12:38:09 +01:00
5ade0a7011 feat(shell.nix): colourful parallel 2021-12-15 12:38:09 +01:00
bed0795a04 fix(monitoring): probe alew.hu-berlin.de every 5 min 2021-12-14 19:20:11 +01:00
31d59aba6a feat(monitoring): probe alew.hu-berlin.de 2021-12-14 19:20:10 +01:00
08c04462a7 feat(monitoring): probe alew.hu-berlin.de 2021-12-13 17:29:09 +01:00
7d00a2e896 fix(pmount): setuid root 2021-12-13 11:58:00 +01:00
1027a850fb feat: add bvg disruptions script 2021-12-13 11:57:42 +01:00
314134d861 feat(hu-berlin): reenable forti vpn 2021-12-13 11:57:27 +01:00
143b2f1a06 Revert "feat(nextcloud): move to cloud.kmein.de"
This reverts commit 8a45abae35.
2021-12-11 09:45:25 +01:00
02cc600c68 feat: install pandoc users guide as man page 2021-12-10 20:25:07 +01:00
25c48354f7 feat: add csv2json and json2csv scripts 2021-12-10 19:43:06 +01:00
5b2c2c7709 feat(scripts): add auc roman calendar 2021-12-10 19:42:52 +01:00
e55cc77825 feat(readme): add attribution 2021-12-09 12:59:19 +01:00
8a45abae35 feat(nextcloud): move to cloud.kmein.de 2021-12-09 07:14:35 +01:00
e046c74539 chore(retiolum): update 2021-12-08 13:11:07 +01:00
9dae3e2d1a feat(weechat): add weechat-matrix 2021-12-08 12:15:14 +01:00
0fea7ba938 feat(moodle-dl): serve via retiolum 2021-12-08 11:39:19 +01:00
edcbe19fb2 feat: add rudimentary readme 2021-12-08 11:03:48 +01:00
ee573e13fc fix(kabsa, manakish): disable illum, hardware does it by itself 2021-12-07 20:09:22 +01:00
83d23f8b55 feat(zaatar): add gaslight 2021-12-07 20:00:10 +01:00
addd7077ed fix(khal): restore cloud address 2021-12-07 20:00:10 +01:00
ec175ef3d7 feat(khal): config format changed with 4.0.0 2021-12-07 20:00:10 +01:00
a7a103c853 feat(urlwatch): add zeno ebooks site 2021-12-04 11:35:36 +01:00
2105a5a0fe feat(weechat): #home-manager 2021-12-04 11:35:36 +01:00
d5a71770a6 feat: kierán.de -> kmein.de 2021-12-03 12:17:36 +01:00
bff6ede4c1 feat(ssh): add alew machine 2021-12-02 14:19:14 +01:00
5a82328b37 feat: make work with 21.11 2021-12-01 17:38:47 +01:00
b3871ba6aa feat(graph.r): use geoip from updater, share with retiolum 2021-12-01 12:04:26 +01:00
9b68ac87d8 chore(nextcloud): create password files 2021-12-01 12:03:55 +01:00
bbc50f3642 feat(radio, urlwatch): create groups 2021-12-01 12:03:33 +01:00
fc067a8493 feat(retiolum-map): use 21.11 geoipupdate 2021-12-01 09:58:46 +01:00
4ac499530d chore(names): update 2021-12-01 09:47:51 +01:00
078b3f6183 chore(tinc-graph): update 2021-12-01 09:47:45 +01:00
ca0267ce22 fix(tuna): new syncthing syntax 2021-12-01 09:47:14 +01:00
10d003371e fix(tuna, moodle-dl): create groups for users 2021-12-01 08:14:18 +01:00
33da8389f5 chore: update to 21.11 2021-12-01 08:14:05 +01:00
707e1f1565 chore(retiolum): update 2021-12-01 07:42:22 +01:00
312dd27f02 feat: add service to supersede graph.r 2021-11-30 22:31:19 +01:00
5a0f6d3035 feat(weechat): new variant 2021-11-30 22:31:19 +01:00
77bd1116ea chore: update 2021-11-30 22:31:19 +01:00
8d4362d903 feat(khal): configure more 2021-11-25 08:25:47 +01:00
bc4e25a42d feat(i3status-rust): increase rate 2021-11-24 18:20:04 +01:00
96627b6f50 feat(weechat): improve zero-covid 2021-11-24 11:12:34 +01:00
6f2a824d8b fix(pls): skip/like before reporting in IRC 2021-11-24 11:11:46 +01:00
a65a4b28da feat: copyq 2021-11-23 21:48:00 +01:00
41f87bdc37 feat(pls): add recent command 2021-11-23 21:47:30 +01:00
85ab948ccd feat(zaatar): install ncmpcpp 2021-11-21 11:55:04 +01:00
9f834e742e chore: update 2021-11-21 11:40:52 +01:00
416d3ab277 feat(i3status-rust): show moon fullness percentage 2021-11-20 09:40:32 +01:00
82b9bb2a4c feat(sa): add possibility of devanagari output 2021-11-20 09:39:57 +01:00
82b650bdbf fix: book reading script cannot be named "read" 2021-11-20 09:39:27 +01:00
06125303b8 feat: add some scripts for reading pdfs 2021-11-19 13:40:32 +01:00
c0efacd6ce chore: update 2021-11-19 13:40:19 +01:00
2aff28c6ed feat: astrological info script 2021-11-19 08:09:08 +01:00
101 changed files with 1762 additions and 444 deletions

46
.bin/bvg.sh Executable file
View File

@@ -0,0 +1,46 @@
#!/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")
))
'

14
.bin/csv2json Executable file
View File

@@ -0,0 +1,14 @@
#!/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)

7
.bin/elm-publish-private Executable file
View File

@@ -0,0 +1,7 @@
#! /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 "$@"

24
.bin/json2csv Executable file
View File

@@ -0,0 +1,24 @@
#!/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)

6
.bin/sample-pdf.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/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"

3
.gitmodules vendored
View File

@@ -4,3 +4,6 @@
[submodule "submodules/menstruation-backend"]
path = submodules/menstruation-backend
url = https://github.com/kmein/menstruation.rs
[submodule "submodules/nur-packages"]
path = submodules/nur-packages
url = git@github.com:kmein/nur-packages.git

View File

@@ -1,9 +1,10 @@
{
"url": "https://github.com/nix-community/home-manager.git",
"rev": "ff2bed9dac84fb202bbb3c49fdcfe30c29d0b12f",
"date": "2021-10-18T10:01:08+02:00",
"path": "/nix/store/3805vd4bp5q28c83ik33c2vangq42lbd-home-manager",
"sha256": "122azyrkbp508a1yrhnq2ja2kj9whdmpb1qwgnmdaz87l02m0m26",
"rev": "697cc8c68ed6a606296efbbe9614c32537078756",
"date": "2021-12-19T00:59:29+01:00",
"path": "/nix/store/fb46bv10azrag2jjlzhil6j11f4x8glw-home-manager",
"sha256": "1c8gxm86zshr2zj9dvr02qs7y3m46gqavr6wyv01r09jfd99dxz9",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View File

@@ -4,6 +4,7 @@
"date": "2021-03-23T22:47:37+01:00",
"path": "/nix/store/mz13xxnil35lwsf90hwnrm2agir7hb51-krops",
"sha256": "07mg3iaqjf1w49vmwfchi7b1w55bh7rvsbgicp2m47gnj9alwdb6",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View File

@@ -0,0 +1,11 @@
{
"url": "https://cgit.krebsco.de/nix-writers",
"rev": "c528cf970e292790b414b4c1c8c8e9d7e73b2a71",
"date": "2019-04-02T20:05:33+02:00",
"path": "/nix/store/wm5zhsha1a2iy0d582nlfi7604ayd1vz-nix-writers",
"sha256": "0xdivaca1hgbxs79jw9sv4gk4f81vy8kcyaff56hh2dgq2awyvw4",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View File

@@ -1,9 +1,10 @@
{
"url": "https://github.com/mozilla/nixpkgs-mozilla",
"rev": "4c8fc3d7b625d2d34bfb5aedf03c131aef2f87f8",
"date": "2021-11-15T17:16:09+01:00",
"path": "/nix/store/cln0xias9nmrlqn290x3535hav2z7kl1-nixpkgs-mozilla",
"sha256": "0xp4wwzglgs5pw5fb2ryywqiq1cw3ji0zn701nn6ndxbfjsc2l1p",
"rev": "7c1e8b1dd6ed0043fb4ee0b12b815256b0b9de6f",
"date": "2021-12-07T09:28:33-05:00",
"path": "/nix/store/pqwcw589i2y2w2116wn3ifl834adjsa0-nixpkgs-mozilla",
"sha256": "1a71nfw7d36vplf89fp65vgj3s66np1dc0hqnqgj5gbdnpm1bihl",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View File

@@ -1,9 +1,10 @@
{
"url": "https://github.com/NixOS/nixpkgs.git",
"rev": "b0657ddc91101c625d2cba64b6b3d22350062f39",
"date": "2021-11-15T18:36:38+01:00",
"path": "/nix/store/vidd1nazd9m2v9djh8z1m7jc9c3dg91l-nixpkgs",
"sha256": "173klgdxj086iz8477kvq5y95f3hix87ra8v3xs4ddg66sm12nrp",
"rev": "f01adc7b35a8f80e82f3466e6d873b8b9c8f1b28",
"date": "2021-12-22T23:05:28+01:00",
"path": "/nix/store/zhfrvg77dzpc3hq02v9zv20dfgqwpzk6-nixpkgs",
"sha256": "17iyf2iiizi7c1wr71day3wvgalbkkm2zgc9lpy7y42rl4frq9sf",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View File

@@ -1,9 +1,10 @@
{
"url": "https://github.com/NixOS/nixpkgs.git",
"rev": "46251a79f752ae1d46ef733e8e9760b6d3429da4",
"date": "2021-11-14T21:40:46-05:00",
"path": "/nix/store/4j2xxc8kqvnif4nhsd0f58dymj3ckryd-nixpkgs",
"sha256": "1xsp0xyrf8arjkf4wi09n96kbg0r8igsmzx8bhc1nj4nr078p0pg",
"rev": "9ab7d12287ced0e1b4c03b61c781901f178d9d77",
"date": "2021-12-21T10:09:48+01:00",
"path": "/nix/store/minmlh0avkwvvc3p7flhpbglp13kr585-nixpkgs",
"sha256": "0bbd2pgcyavqn5wgq0xp8p67lha0kv9iqnh49i9w5fb5g29q7i30",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View File

@@ -1,10 +0,0 @@
{
"url": "https://github.com/nix-community/NUR",
"rev": "ebf5ede213705809cb41ddb0cd4a2568b18c3d23",
"date": "2021-11-15T17:11:02+00:00",
"path": "/nix/store/n08kjjjsx193myprd029rgmwavgqqj2g-NUR",
"sha256": "02h737vr8r32kbqmm0z4fqc7pwkrjdj6q0mg5gzfjqqgyni75g2h",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View File

@@ -1,9 +1,10 @@
{
"url": "https://github.com/krebs/retiolum",
"rev": "3fc3147ef4c644b4008f1425fae701f2d371db52",
"date": "2021-10-30T16:02:13+02:00",
"path": "/nix/store/ybc3zn2ql3ml9mfxdlvya71pz5hjvkh2-retiolum",
"sha256": "1vh8s0dknnsy9c68l807difjnar2m6xbbwj51f308bl8wyjyq4y5",
"rev": "b72b0a987767b587c79cba8499b5114d69fceeef",
"date": "2021-12-28T19:46:45+00:00",
"path": "/nix/store/kyaqwf89v6id9mda92x4b0hf778j987x-retiolum",
"sha256": "19hjzzlfk1m9ign33w4ppqgmg23v7c6k8l0fm7f33spq8982w7rb",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View File

@@ -1,9 +1,10 @@
{
"url": "https://cgit.krebsco.de/stockholm",
"rev": "c979f7009f5ff1b2d25158aff1bca0f5be2dba54",
"date": "2021-11-08T05:14:49+01:00",
"path": "/nix/store/shz2yw0p30ibmw3lgr11ckzz0y4kmz4y-stockholm",
"sha256": "13yds6hwh6ah4mks8jrg7syigfmp17ylr7706jpvdzfy9ihj81wh",
"url": "https://cgit.lassul.us/stockholm",
"rev": "576c05cf3a0ceddefa29c2d0073108177c3cfa52",
"date": "2021-12-22T13:59:46+01:00",
"path": "/nix/store/yx1j5pardgd9114f0cf3c4xjfq6r4yfv-stockholm",
"sha256": "18napi4k8i2iizrismlp9ha3ga6c3n2dvrhijy59kl1jxqrsaq9l",
"fetchLFS": false,
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

10
README.md Normal file
View File

@@ -0,0 +1,10 @@
# 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 —[xkey](https://github.com/riotbib)

View File

@@ -1,12 +1,4 @@
{ config, lib, pkgs, ... }: {
imports = [
<niveum/modules/dropbox.nix>
];
niveum = {
dropbox.enable = false;
};
system.activationScripts.home-symlinks = ''
ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/mahlzeit ${config.users.users.me.home}/mahlzeit
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Wiki ${config.users.users.me.home}/notes
@@ -17,6 +9,17 @@
services.nextcloud-client.enable = true;
};
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/Seafile/Books -type f
} | ${pkgs.fzf}/bin/fzf)"
${pkgs.zathura}/bin/zathura "$book"
'')
];
fileSystems."/media/moodle" = {
device = "zaatar.r:/moodle";
fsType = "nfs";
@@ -33,21 +36,19 @@
openDefaultPorts = true;
configDir = "/home/kfm/.config/syncthing";
dataDir = "/home/kfm/.config/syncthing";
declarative = rec {
cert = toString <system-secrets/syncthing/cert.pem>;
key = toString <system-secrets/syncthing/key.pem>;
inherit ((import <niveum/lib>).syncthing) devices;
folders =
let cloud-dir = "${config.users.users.me.home}/cloud";
in {
"${cloud-dir}/syncthing/common".devices = [ "kabsa" "manakish" ];
"${cloud-dir}/syncthing/library".devices = [ "kabsa" "manakish" "heym" ];
"${cloud-dir}/syncthing/mundoiu".devices = [ "kabsa" "manakish" "heym" ];
"${cloud-dir}/syncthing/music" = {
devices = [ "kabsa" "manakish" "heym" "zaatar" ];
id = "music";
};
cert = toString <system-secrets/syncthing/cert.pem>;
key = toString <system-secrets/syncthing/key.pem>;
inherit ((import ../lib).syncthing) devices;
folders =
let cloud-dir = "${config.users.users.me.home}/cloud";
in {
"${cloud-dir}/syncthing/common".devices = [ "kabsa" "manakish" ];
"${cloud-dir}/syncthing/library".devices = [ "kabsa" "manakish" "heym" ];
"${cloud-dir}/syncthing/mundoiu".devices = [ "kabsa" "manakish" "heym" ];
"${cloud-dir}/syncthing/music" = {
devices = [ "kabsa" "manakish" "heym" "zaatar" ];
id = "music";
};
};
};
};
}

37
configs/copyq.nix Normal file
View File

@@ -0,0 +1,37 @@
{ config, pkgs, ... }:
let
copyqConfig = pkgs.writers.writeDash "copyq-config" ''
${pkgs.copyq}/bin/copyq config check_clipboard true
${pkgs.copyq}/bin/copyq config check_selection false
${pkgs.copyq}/bin/copyq config copy_clipboard true
${pkgs.copyq}/bin/copyq config copy_selection false
${pkgs.copyq}/bin/copyq config activate_closes true
${pkgs.copyq}/bin/copyq config clipboard_notification_lines 0
${pkgs.copyq}/bin/copyq config clipboard_tab \&clipboard
${pkgs.copyq}/bin/copyq config disable_tray false
${pkgs.copyq}/bin/copyq config hide_tabs false
${pkgs.copyq}/bin/copyq config hide_toolbar false
${pkgs.copyq}/bin/copyq config item_popup_interval true
${pkgs.copyq}/bin/copyq config maxitems 1000
${pkgs.copyq}/bin/copyq config move true
${pkgs.copyq}/bin/copyq config text_wrap true
'';
in {
environment.systemPackages = [ pkgs.copyq ];
systemd.user.services.copyq = {
wantedBy = [ "graphical-session.target" ];
environment = {
DISPLAY = ":${toString config.services.xserver.display}";
};
serviceConfig = {
SyslogIdentifier = "copyq";
ExecStart = "${pkgs.copyq}/bin/copyq";
ExecStartPost = copyqConfig;
Restart = "always";
RestartSec = "15s";
StartLimitBurst = 0;
};
};
}

View File

@@ -1,11 +1,10 @@
{ pkgs, lib, config, options, ... }:
let
inherit (lib.strings) makeBinPath;
inherit (import <niveum/lib>) localAddresses kieran;
inherit (import ../lib) localAddresses kieran;
in {
imports = [
<home-manager/nixos>
<niveum/modules/system-dependent.nix>
../modules/system-dependent.nix
{
boot.supportedFilesystems = [ "ntfs" ];
}
@@ -15,13 +14,11 @@ in {
"nixpkgs-overlays=${toString ../overlays}"
];
}
{ services.dbus.packages = [ pkgs.gnome3.dconf ]; }
{
nixpkgs = {
config = {
allowUnfree = true;
packageOverrides = pkgs: {
nur = import <nur> { inherit pkgs; };
writeDashBin = pkgs.writers.writeDashBin;
writeDash = pkgs.writers.writeDash;
gfs-fonts = pkgs.callPackage <niveum/packages/gfs-fonts.nix> {};
@@ -30,9 +27,8 @@ in {
};
};
overlays = [
(import <stockholm/krebs/5pkgs>)
(self: super: {
scripts = import <niveum/packages/scripts> { pkgs = super; lib = super.lib; };
scripts = import ../packages/scripts { pkgs = super; lib = super.lib; };
})
];
};
@@ -67,6 +63,7 @@ in {
};
home-manager.users.me.xdg.enable = true;
home-manager.users.me.dconf.enable = false;
}
{
sound.enable = true;
@@ -140,7 +137,6 @@ in {
};
}
{ i18n.defaultLocale = "en_GB.UTF-8"; }
{ services.illum.enable = true; }
{
services.xserver = {
enable = true;
@@ -161,8 +157,16 @@ in {
}
{
security.wrappers = {
pmount.source = "${pkgs.pmount}/bin/pmount";
pumount.source = "${pkgs.pmount}/bin/pumount";
pmount = {
owner = "root";
group = "users";
source = "${pkgs.pmount}/bin/pmount";
};
pumount = {
owner = "root";
group = "users";
source = "${pkgs.pmount}/bin/pumount";
};
};
}
{ programs.command-not-found.enable = true; }
@@ -196,12 +200,11 @@ in {
./ccc.nix
# ./kleiter.nix
./khal.nix
./engiadina.nix
./chromium.nix
./cloud.nix
./copyq.nix
./compton.nix
./direnv.nix
./distrobump.nix
./docker.nix
./dunst.nix
./flix.nix
@@ -220,14 +223,13 @@ in {
./nano.nix
./neovim.nix
./neomutt.nix
./nix.nix
./newsboat.nix
./flameshot-once.nix
./packages
./power-action.nix
# ./power-action.nix
./printing.nix
./openweathermap.nix
./wallpaper.nix
# ./wallpaper.nix
./redshift.nix
./retiolum.nix
./rofi.nix

View File

@@ -1,10 +0,0 @@
{ lib, config, pkgs, ... }: {
imports = [
(import <stockholm/makefu/3modules/bump-distrowatch.nix> {
inherit lib config;
pkgs = pkgs // { writeDash = pkgs.writers.writeDash; };
})
];
makefu.distrobump.enable = false;
}

View File

@@ -1,6 +1,6 @@
{ config, pkgs, ... }:
let
inherit (import <niveum/lib>) defaultApplications colours theme;
inherit (import ../lib) defaultApplications colours theme;
in {
home-manager.users.me.services.dunst = {
enable = true;

View File

@@ -1,30 +0,0 @@
{ config, pkgs, ... }:
let
inherit (import <niveum/lib>) tmpfilesConfig;
cdnRoot = "/var/lib/engiadina";
in
{
imports = [ <stockholm/krebs/3modules/permown.nix> ];
krebs.permown.${cdnRoot} = {
owner = config.users.users.me.name;
group = "users";
umask = "0002";
};
services.nginx = {
enable = true;
virtualHosts.default = {
root = cdnRoot;
listen = [{
addr = "0.0.0.0";
port = 3333;
}];
};
};
environment.shellAliases = {
engiadina-watch = "${pkgs.findutils}/bin/find extra-src src | ${pkgs.entr}/bin/entr -s 'build-component && ${pkgs.rsync}/bin/rsync -avu dist/*.js ${cdnRoot}/'";
engiadina-edit = "$EDITOR ${cdnRoot}/index.html";
};
}

View File

@@ -1,26 +1,24 @@
{ config, lib, pkgs, ... }:
{
home-manager.users.me = {
services.flameshot.enable = true;
{ lib, pkgs, ... }:
let
inherit (import <niveum/lib>) defaultApplications;
flameshot-once = pkgs.callPackage <stockholm/krebs/5pkgs/simple/flameshot-once> {};
in {
nixpkgs.overlays = [
(self: super: {
write =
super.callPackage <stockholm/krebs/5pkgs/simple/xwaitforwindow.nix> { };
})
];
xdg.configFile."flameshot/flameshot.ini".source = (pkgs.formats.ini {}).generate "flameshot.ini" {
General = {
disabledTrayIcon = true;
checkForUpdates = false;
contrastOpacity = 188;
savePath = "/tmp";
savePathFixed = true;
drawThickness = 0;
showStartupLaunchMessage = false;
filenamePattern = "shot_%F_%T";
environment.systemPackages = [
(flameshot-once.override {
config.imgur = {
enable = true;
createUrl = "http://p.r/image";
deleteUrl = "http://p.r/image/delete/%1";
xdg-open.browser = (defaultApplications pkgs).browser;
};
};
systemd.user.services.flameshot.Unit.Requires = lib.mkForce [];
systemd.user.services.flameshot.Environment = {
# IMGUR_CREATE_URL = "https://p.krebsco.de/image";
# IMGUR_DELETE_URL = "https://p.krebsco.de/image/delete/%1";
PATH = "${config.home-manager.users.me.home.profileDirectory}/bin";
};
};
config.timeout = 1000;
})
];
}

View File

@@ -51,7 +51,7 @@ in {
isSystemUser = true;
createHome = true;
home = cacheLocation;
extraGroups = [ flixGroup ];
group = flixGroup;
};
environment.systemPackages = [

View File

@@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }:
let
inherit (import <niveum/lib>) kieran ignorePaths;
inherit (import ../lib) kieran ignorePaths;
in
{
environment.systemPackages = [

View File

@@ -2,10 +2,10 @@
services.gitea = {
enable = true;
disableRegistration = true;
rootUrl = "https://code.xn--kiern-0qa.de";
appName = "code.kierán.de";
rootUrl = "https://code.kmein.de";
appName = "code.kmein.de";
};
services.nginx.virtualHosts."code.xn--kiern-0qa.de" = {
services.nginx.virtualHosts."code.kmein.de" = {
forceSSL = true;
enableACME = true;
locations."/".extraConfig = "proxy_pass http://localhost:3000;";

View File

@@ -3,7 +3,7 @@ let
backupLocation = "/var/lib/codimd-backup";
stateLocation = "/var/lib/codimd/state.sqlite";
nixpkgs-unstable = import <nixpkgs-unstable> {};
domain = "pad.xn--kiern-0qa.de";
domain = "pad.kmein.de";
in
{
imports = [ <stockholm/krebs/3modules/permown.nix> ];

View File

@@ -1,5 +1,5 @@
{ config, pkgs, ... }: {
imports = [ <niveum/modules/hledger.nix> ];
imports = [ ../modules/hledger.nix ];
niveum.hledger = {
enable = true;

View File

@@ -32,6 +32,16 @@ in {
options = hu-berlin-cifs-options;
};
home-manager.users.me.programs.ssh = {
matchBlocks = {
"alew.hu-berlin.de" = {
user = "centos";
hostname = "141.20.187.219";
};
};
};
environment.systemPackages = [
(pkgs.writers.writeDashBin "hu-ip" ''
${pkgs.w3m}/bin/w3m -dump meineip.hu-berlin.de | head --lines=-4 | tail --lines=+3
@@ -49,7 +59,7 @@ in {
];
systemd.services.hu-vpn = {
enable = false;
enable = true;
wants = [ "network-online.target" ];
conflicts = [ "openvpn-hu-berlin.service" ];
script = ''

View File

@@ -1,7 +1,7 @@
{ config, pkgs, lib, ... }:
{ inputs, config, pkgs, lib, ... }:
let
inherit (import <niveum/lib>) defaultApplications colours;
klem = import <niveum/packages/scripts/klem.nix> {
inherit (import ../lib) defaultApplications colours;
klem = import ../packages/scripts/klem.nix {
inherit pkgs lib;
config.scripts = {
"p.r" = pkgs.writers.writeDash "p.r" ''
@@ -146,7 +146,7 @@ in {
};
};
statusCommand = "${pkgs.i3status-rust}/bin/i3status-rs ${
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import <niveum/lib/i3status-rust.nix> {
(pkgs.formats.toml {}).generate "i3status-rust.toml" (import ../lib/i3status-rust.nix {
inherit (config.niveum) batteryName wirelessInterface;
inherit colours;
inherit pkgs;
@@ -213,7 +213,11 @@ in {
}
cd ~/notes
note_file=$(find . -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2 | dmenu -i)
note_file=$({
echo diary/$(date -I).md
echo diary/$(date -I -d yesterday).md
find . -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2
} | dmenu -i)
if test "$note_file"
then
i3-sensible-terminal -e "$EDITOR" "$note_file"
@@ -229,8 +233,7 @@ in {
"${modifier}+F10" = "exec ${pkgs.redshift}/bin/redshift -x";
"${modifier}+F11" = "exec ${pkgs.xcalib}/bin/xcalib -invert -alter";
"${modifier}+F12" = "exec ${klem}/bin/klem";
"Print" = "exec flameshot gui -p /tmp";
"Print" = "exec flameshot-once";
"XF86AudioLowerVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -d 5";
"XF86AudioMute" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -t";
"XF86AudioRaiseVolume" = "exec --no-startup-id ${pkgs.pamixer}/bin/pamixer -i 5";

View File

@@ -59,13 +59,12 @@ in
skip_unparsable = no
'';
"todoman/todoman.conf".text = ''
[main]
path = ${davHome}/calendar/*
date_format = %Y-%m-%d
time_format = %H:%M
"todoman/config.py".text = ''
path = "${davHome}/calendar/*"
date_format = "%Y-%m-%d"
time_format = "%H:%M"
default_due = 0
default_list = Personal
default_list = "Personal"
startable = True
'';
@@ -100,6 +99,8 @@ in
[default]
highlight_event_days = True
timedelta = 5d
print_new = path
default_calendar = personal
[locale]
timeformat = %H:%M

View File

@@ -0,0 +1,17 @@
# https://github.com/Fluepke/nix-files/blob/2be70b76a198afaa7763132fed645a3c19d5af6e/configuration/common/blackbox-exporter.yml
# https://github.com/xHain-hackspace/xhain-nixfiles/blob/0d6e3b87a07317c2d54cccabf4f90da589319e2c/common/prometheus/blackbox-exporter.yml
{
modules.http_2xx = {
http = {
fail_if_not_ssl = true;
ip_protocol_fallback = false;
method = "GET";
no_follow_redirects = false;
preferred_ip_protocol = "ip4";
valid_http_versions = [ "HTTP/1.1" "HTTP/2.0" ];
tls_config.insecure_skip_verify = true;
};
prober = "http";
timeout = "15s";
};
}

View File

@@ -1,6 +1,7 @@
{ lib, config, pkgs, ... }:
let
lokiConfig = import ./loki.nix;
blackboxConfig = import ./blackbox.nix;
in
{
services.grafana = {
@@ -78,6 +79,36 @@ in
expr = "time() - node_boot_time_seconds < 300";
annotations.summary = "{{$labels.job}}: Reboot";
}
{
alert = "ProbeFailed";
expr = "probe_success == 0";
for = "5m";
annotations.summary = "{{$labels.instance}}: probe failed";
}
{
alert = "SlowProbe";
expr = "avg_over_time(probe_http_duration_seconds[1m]) > 1";
for = "5m";
annotations.summary = "{{$labels.instance}}: HTTP probe slow";
}
{
alert = "HttpStatusCode";
expr = "probe_http_status_code != 0 AND (probe_http_status_code <= 199 OR probe_http_status_code >= 400)";
for = "5m";
annotations.summary = "{{$labels.instance}}: status code {{$value}}";
}
{
alert = "SslExpirySoon";
expr = "probe_ssl_earliest_cert_expiry - time() < 86400 * 30";
for = "5m";
annotations.summary = "{{$labels.instance}}: SSL certificate expires in 30 days";
}
{
alert = "SslExpiry";
expr = "probe_ssl_earliest_cert_expiry - time() <= 0";
for = "5m";
annotations.summary = "{{$labels.instance}}: SSL certificate has expired";
}
];
}];
})];
@@ -157,15 +188,36 @@ in
job_name = "makanek";
static_configs = [ { targets = [
"127.0.0.1:${toString config.services.prometheus.exporters.node.port}"
# "127.0.0.1:${toString config.services.prometheus.exporters.nginx.port}"
]; } ];
}
{
scrape_interval = "5m";
job_name = "blackbox";
metrics_path = "/probe";
params.module = [ "http_2xx" ];
relabel_configs = [
{ source_labels = ["__address__"]; target_label = "__param_target"; }
{ source_labels = ["__param_target"]; target_label = "instance"; }
{ replacement = "127.0.0.1:${toString config.services.prometheus.exporters.blackbox.port}"; target_label = "__address__"; }
];
static_configs = [{
targets = [
"alew.hu-berlin.de"
];
}];
}
{
job_name = "zaatar";
static_configs = [ { targets = [ "zaatar.r:${toString config.services.prometheus.exporters.node.port}" ]; } ];
}
];
services.prometheus.exporters.blackbox = {
enable = true;
configFile = (pkgs.formats.yaml {}).generate "blackbox.yaml" blackboxConfig;
};
networking.firewall.allowedTCPPorts = [
lokiConfig.server.http_listen_port
];

View File

@@ -82,6 +82,21 @@ in
networking.firewall.allowedTCPPorts = [ 2049 ];
services.nginx.virtualHosts."moodle.kmein.r" =
let
identity = lib.strings.fileContents <secrets/eduroam/identity>;
password = lib.strings.fileContents <secrets/eduroam/password>;
in {
basicAuth."${identity}" = password;
locations."/" = {
root = config.services.moodle-dl.directory;
extraConfig = ''
autoindex on;
charset UTF-8;
'';
};
};
services.nfs.server = {
enable = true;
exports = let machines = with (import <niveum/lib>).retiolumAddresses; [kabsa manakish]; in ''

View File

@@ -1,6 +1,5 @@
{ pkgs, lib, ... }: let
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
in {
environment.shellAliases.smpv = swallow "mpv";
@@ -22,7 +21,7 @@ in {
"Alt+j" = "add video-pan-y -0.05";
};
scripts = [
nixpkgs-unstable.mpvScripts.youtube-quality
pkgs.unstable.mpvScripts.youtube-quality
];
};
};

View File

@@ -4,8 +4,8 @@ let
geogen = (pkgs.fetchFromGitHub {
owner = "kmein";
repo = "scripts";
rev = "c553c212efb04c300edf675c39a87fffd32d4def";
sha256 = "0b5xjr7qqgvwc76pqr84p81svzk6nqr5pdvc6daw94rcgdy02mva";
rev = "8945430f27a8c6fd632dd35382cb094abe3543ff";
sha256 = "1djyxkynypxsrmdf6idgjszqpcgqyq607rrsvl58p2bpymmwibzb";
}) + "/onomastics";
inherit (pkgs.callPackage geogen {}) dependencyEnv;
in

View File

@@ -25,18 +25,13 @@
customRC = builtins.readFile <niveum/lib/vim/init.vim>;
packages.nvim = with pkgs.vimPlugins; {
start = [
# cheat-sh-vim
# deoplete-nvim
# vim-abolish
ale
fzf-vim
fzfWrapper
goyo
supertab
undotree
tabular
vimwiki
vim-256noir
vim-colors-paramount
vim-commentary
vim-css-color
@@ -44,13 +39,9 @@
vim-fetch
vim-fugitive
vim-gitgutter
vim-pandoc
vim-pandoc-syntax # vim-pandoc-after
vim-repeat
vim-sensible
# vim-startify
vim-surround
vim-mail
];
opt = [
csv
@@ -72,6 +63,9 @@
vim-reason-plus
vim-toml
vimtex
vim-pandoc
vim-pandoc-syntax # vim-pandoc-after
vim-256noir
];
};
};

View File

@@ -1,6 +1,5 @@
{ lib, pkgs, ... }:
let
autowifi = pkgs.writers.writePython3Bin "autowifi" { flakeIgnore = [ "E501" ]; } <stockholm/lass/5pkgs/autowifi/autowifi.py>;
profile = name: custom: lib.recursiveUpdate {
connection.id = name;
connection.type = "wifi";
@@ -39,7 +38,7 @@ let
};
in
{
imports = [ <niveum/modules/networkmanager-declarative.nix> ];
imports = [ ../modules/networkmanager-declarative.nix ];
networking.networkmanager = {
enable = true;
@@ -83,22 +82,5 @@ in
users.users.me.extraGroups = [ "networkmanager" ];
systemd.services.autowifi = {
enable = false;
description = "Automatic wifi connector";
wantedBy = [ "multi-user.target" ];
path = [ pkgs.networkmanager ];
serviceConfig = {
Type = "simple";
Restart = "always";
RestartSec = "10s";
ExecStart = "${autowifi}/bin/autowifi";
};
};
networking.networkmanager.dispatcherScripts = [
{ source = "${pkgs.nur.repos.makefu.prison-break}/bin/prison-break"; }
];
environment.systemPackages = [ pkgs.speedtest-cli ];
}

View File

@@ -1,5 +1,6 @@
{ pkgs, lib, ... }:
let
passwordFile = path: toString (pkgs.writeText "password" (lib.strings.fileContents path));
inherit (import <niveum/lib>) localAddresses;
in
{
@@ -23,8 +24,8 @@ in
dbuser = "nextcloud";
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
dbname = "nextcloud";
dbpass = lib.strings.fileContents <system-secrets/nextcloud/database>;
adminpass = lib.strings.fileContents <system-secrets/nextcloud/admin>;
dbpassFile = passwordFile <system-secrets/nextcloud/database>;
adminpassFile = passwordFile <system-secrets/nextcloud/admin>;
adminuser = "admin";
# extraTrustedDomains = [ "toum.r" ];
};

View File

@@ -1,10 +0,0 @@
{ pkgs, ... }:
{
# enable `nix flake`
nix = {
package = pkgs.nix;
# extraOptions = ''
# experimental-features = nix-command
# '';
};
}

View File

@@ -6,6 +6,25 @@ let
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
astrolog = nixpkgs-unstable.astrolog.overrideAttrs (old: old // {
installPhase = ''
${old.installPhase}
# set sensible defaults
sed -i '
/^-z /s/8:00W/1:00E/ # timezone
/^-zl /s/122W19:59 47N36:35/13E22:42 52N27:42/ # default location
/^-zj /s/"Current moment now"/Now/ # default name
/^-zj /s/"Seattle, WA, USA"/Berlin/ # default location
/^_k/s/_k/=k/ # use color
/^_Yd/s/_Yd/=Yd/ # sensible date format
/^_Yt/s/_Yt/=Yt/ # sensible time format
/^_Yv/s/_Yv/=Yv/ # sensible length format
/^:Xbw/s/:Xbw/:Xbn/ # set X11 bitmap format
/^:I /s/80/120/ # wider text output
' $out/astrolog/astrolog.as
'';
});
recht = pkgs.callPackage (pkgs.fetchFromGitHub {
owner = "kmein";
repo = "recht";
@@ -52,7 +71,6 @@ in {
wget
whois
ix
nur.repos.kmein.python3Packages.instaloader
dnsutils
# mtr # my traceroute
# FILE MANAGERS
@@ -108,6 +126,8 @@ in {
audacity
calibre
inkscape
astrolog # astrolog
anki # flashcards
nixpkgs-unstable.zoom-us # video conferencing
pdfgrep # search in pdf
pdftk # pdf toolkit
@@ -119,6 +139,7 @@ in {
youtubeDL
bc # calculator
pari # gp -- better calculator
scripts.auc
scripts.infschmv
scripts.qrpaste
scripts.new-mac # get a new mac address
@@ -133,10 +154,9 @@ in {
scripts.devanagari
scripts.betacode # ancient greek betacode to unicode converter
scripts.meteo
nur.repos.kmein.mahlzeit
scripts.mahlzeit
recht
# nur.repos.kmein.slide
nur.repos.kmein.vimv
scripts.vimv
scripts.swallow # window swallowing
scripts.genius
scripts.instaget
@@ -157,6 +177,7 @@ in {
scripts.wttr
scripts.sanskrit-dictionary
scripts.unicodmenu
scripts.horoscope
scripts.closest
scripts.trans
scripts.liddel-scott-jones

View File

@@ -2,10 +2,10 @@
environment.systemPackages = [
(pkgs.python3.withPackages (py: [
py.black
py.python-language-server
py.pyls-mypy
py.pyls-black
py.pyls-isort
# py.python-language-server
# py.pyls-mypy
# py.pyls-black
# py.pyls-isort
py.flake8
py.pygments
py.schema

View File

@@ -1,5 +1,7 @@
{ pkgs, lib, config, ... }:
let
pandoc-doc = pkgs.callPackage <niveum/packages/man/pandoc.nix> {};
zoteroStyle = { name, sha256 }: {
name = "${name}.csl";
path = pkgs.fetchurl {
@@ -63,13 +65,14 @@ in {
latexrun
(aspellWithDicts (dict: [ dict.de dict.en dict.en-computers ]))
# haskellPackages.pandoc-citeproc
nur.repos.kmein.text2pdf
scripts.text2pdf
lowdown
glow # markdown to term
libreoffice
# gnumeric
dia
pandoc
pandoc-doc
# proselint
asciidoctor
wordnet

View File

@@ -1,6 +1,6 @@
{ pkgs, ... }:
let
inherit (import <niveum/lib>) localAddresses;
inherit (import ../lib) localAddresses;
hp-driver = pkgs.hplipWithPlugin;
in {
services.printing = {

View File

@@ -63,7 +63,11 @@ in
})
];
users.extraUsers.radio.isSystemUser = true;
users.extraUsers.radio = {
isSystemUser = true;
group = "radio";
};
users.groups.radio = {};
krebs.htgen.radio = {
port = htgenPort;
@@ -192,7 +196,7 @@ in
};
services.nginx.virtualHosts."radio.xn--kiern-0qa.de" = {
services.nginx.virtualHosts."radio.kmein.de" = {
enableACME = true;
forceSSL = true;
locations = lib.mkMerge (

69
configs/retiolum-map.nix Normal file
View File

@@ -0,0 +1,69 @@
{ config, pkgs, lib, ... }:
let
network = "retiolum";
stateDirectory = "retiolum-map";
geo-ip-database = "${lib.head config.services.geoipupdate.settings.EditionIDs}.mmdb";
geo-ip-database-path = "${config.services.geoipupdate.settings.DatabaseDirectory}/${geo-ip-database}";
tinc-graph-source = pkgs.fetchFromGitHub {
owner = "kmein";
repo = "tinc-graph";
rev = "1b9c69ffdbdab82d30a23e44f739feea63d94163";
sha256 = "0bk4x9l399f80lmz4asx7s5fcsgrfdb6xyymbq884621x4z3d2vp";
};
tinc-graph = pkgs.callPackage tinc-graph-source {};
in
{
systemd.services.retiolum-index = {
description = "Retiolum indexing service";
wants = [ "tinc.${network}.service" ];
script = ''
${tinc-graph}/bin/tinc-graph --geoip-file ${geo-ip-database-path} --network ${network} \
| ${pkgs.coreutils}/bin/tee network.json \
| ${tinc-graph}/bin/tinc-statistics > statistics.json
cp ${tinc-graph}/static/map.html map.html
cp ${tinc-graph}/static/map.html index.html
cp ${tinc-graph}/static/graph.html graph.html
'';
startAt = "hourly";
path = [ pkgs.coreutils pkgs.jq pkgs.tinc_pre ];
serviceConfig = {
Type = "oneshot";
User = "root";
StateDirectory = stateDirectory;
WorkingDirectory = "/var/lib/${stateDirectory}";
};
};
services.geoipupdate = {
enable = true;
settings = {
AccountID = 608777;
LicenseKey = toString <system-secrets/maxmind/license.key>;
EditionIDs = [ "GeoLite2-City" ];
};
};
services.nginx = {
enable = true;
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
virtualHosts."graph.r".locations."/".root = "/var/lib/${stateDirectory}";
};
systemd.services.geoip-share = {
after = [ "geoipupdate.service" ];
script = let
cyberlocker-tools = pkgs.callPackage <stockholm/krebs/5pkgs/simple/cyberlocker-tools> {};
in "${cyberlocker-tools}/bin/cput ${geo-ip-database} < ${geo-ip-database-path}";
serviceConfig = {
Type = "oneshot";
DynamicUser = true;
};
};
}

View File

@@ -1,6 +1,6 @@
{ config, pkgs, ... }: {
imports = [
<niveum/modules/retiolum.nix>
../modules/retiolum.nix
];
networking.hosts = { "42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ]; };

View File

@@ -4,46 +4,6 @@ let
in{
home-manager.users.me.programs.rofi = {
enable = true;
separator = "solid";
scrollbar = false;
borderWidth = 0;
lines = 5;
font = "Monospace 10";
colors = rec {
window = rec {
background = colours.foreground;
border = background;
separator = colours.black.bright;
};
rows = {
normal = {
background = window.background;
backgroundAlt = window.background;
foreground = colours.background;
highlight = {
foreground = colours.cyan.dark;
inherit (window) background;
};
};
active = {
background = window.background;
backgroundAlt = window.background;
foreground = colours.yellow.dark;
highlight = {
foreground = colours.green.dark;
inherit (window) background;
};
};
urgent = {
background = window.background;
backgroundAlt = window.background;
foreground = colours.red.dark;
highlight = {
foreground = colours.magenta.dark;
inherit (window) background;
};
};
};
};
};
}

View File

@@ -1,6 +1,6 @@
{ pkgs, config, lib, ... }:
let
inherit (import <niveum/lib>) sshPort kieran;
inherit (import ../lib) sshPort kieran;
in {
services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add";

View File

@@ -1,6 +1,6 @@
{ config, lib, pkgs, ... }:
let
inherit (import <niveum/lib>) sshPort kieran;
inherit (import ../lib) sshPort kieran;
in
{
users.motd = "Welcome to ${config.networking.hostName}!";

61
configs/tarot.nix Normal file
View File

@@ -0,0 +1,61 @@
{ config, pkgs, lib, ... }:
let
tarotPort = 7407;
tarotFiles = pkgs.fetchzip {
url = "https://c.krebsco.de/tarot.zip";
sha256 = "0jl5vdwlj17pqp94yj02xgsb1gyvs9i08m83kac0jdnhfjl2f75a";
stripRoot = false;
};
tarotKey = builtins.fetchurl {
url = "http://c.krebsco.de/tarot.pdf";
sha256 = "1n2m53kjg2vj9dbr70b9jrsbqwdfrcb48l4wswn21549fi24g6dx";
};
in
{
krebs.htgen.tarot = {
port = tarotPort;
user.name = "radio";
script = ''. ${pkgs.writers.writeDash "tarot" ''
case "$Method $Request_URI" in
"GET /")
if item=$(${pkgs.findutils}/bin/find ${toString tarotFiles} -type f | ${pkgs.coreutils}/bin/shuf -n1); then
card=$(mktemp --tmpdir tarot.XXX)
trap 'rm $card' EXIT
reverse=$(${pkgs.coreutils}/bin/shuf -i0-1 -n1)
if [ "$reverse" -eq 1 ]; then
${pkgs.imagemagick}/bin/convert -rotate 180 "$item" "$card"
else
${pkgs.coreutils}/bin/cp "$item" "$card"
fi
printf 'HTTP/1.1 200 OK\r\n'
printf 'Content-Type: %s\r\n' "$(${pkgs.file}/bin/file -ib "$card")"
printf 'Server: %s\r\n' "$Server"
printf 'Connection: close\r\n'
printf 'Content-Length: %d\r\n' $(${pkgs.coreutils}/bin/wc -c < "$card")
printf '\r\n'
cat "$card"
exit
fi
;;
esac
''}'';
};
services.nginx.virtualHosts."tarot.kmein.de" = {
enableACME = true;
forceSSL = true;
locations = {
"/".proxyPass = "http://127.0.0.1:${toString tarotPort}";
"/files/" = {
root = pkgs.linkFarm "tarot" [
{ name = "files/key.pdf"; path = tarotKey; }
{ name = "files/cards"; path = tarotFiles; }
];
extraConfig = ''
autoindex on;
charset UTF-8;
'';
};
};
};
}

View File

@@ -0,0 +1,53 @@
{ pkgs, lib, ... }:
let
nixpkgs-unstable = import <nixpkgs-unstable> {};
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.telegramBots.transits = {
enable = true;
time = "4:00";
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
chatIds = [ "18980945" ];
command = toString (pkgs.writers.writeDash "common-transits" ''
{
${nixpkgs-unstable.astrolog}/bin/astrolog -n -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto
${nixpkgs-unstable.astrolog}/bin/astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $(${pkgs.coreutils}/bin/date +'%m %d %Y') -R Uranus Neptune Pluto
} | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n
'');
};
}

View File

@@ -14,6 +14,7 @@ let
in {
imports = [
./literature-quote.nix
./astrology.nix
./autorenkalender.nix
./nachtischsatan.nix
./tlg-wotd.nix

View File

@@ -1,6 +1,6 @@
{ lib, config, pkgs, ... }:
let
theme = (import <niveum/lib>).theme pkgs;
theme = (import ../lib).theme pkgs;
in {
environment.systemPackages =
[ theme.gtk.package theme.icon.package theme.cursor.package ];

View File

@@ -4,7 +4,7 @@ let
living-room-id = 131090;
in
{
imports = [ <niveum/modules/traadfri.nix> ];
imports = [ ../modules/traadfri.nix ];
environment.systemPackages = [
(pkgs.writers.writeDashBin "traadfri-party" ''

View File

@@ -19,17 +19,15 @@ in
openDefaultPorts = true;
configDir = "${mpd-directory}/.config/syncthing";
dataDir = "${mpd-directory}/.config/syncthing";
declarative = rec {
cert = toString <system-secrets/syncthing/cert.pem>;
key = toString <system-secrets/syncthing/key.pem>;
devices = {
inherit ((import <niveum/lib>).syncthing.devices) kabsa manakish heym;
};
folders.${config.services.mpd.musicDirectory} = {
devices = [ "heym" "kabsa" "manakish" ];
id = "music";
type = "receiveonly";
};
cert = toString <system-secrets/syncthing/cert.pem>;
key = toString <system-secrets/syncthing/key.pem>;
devices = {
inherit ((import <niveum/lib>).syncthing.devices) kabsa manakish heym;
};
folders.${config.services.mpd.musicDirectory} = {
devices = [ "heym" "kabsa" "manakish" ];
id = "music";
type = "receiveonly";
};
};
@@ -97,6 +95,7 @@ in
};
/*
services.nginx = {
enable = true;
recommendedGzipSettings = true;
@@ -111,4 +110,5 @@ in
};
};
};
*/
}

View File

@@ -40,6 +40,11 @@ let
url = "https://kratylos.reichert-online.org/current_issue/KRATYLOS";
filter = [ { element-by-id = "content"; } "html2text" "strip" ];
}
{
name = "Zeno Free E-Books";
url = "http://www.zeno.org/Lesesaal/M/E-Books";
filter = [ { element-by-class = "zenoCOMain"; } "html2text" "strip" ];
}
{
name = "Indogermanische Forschungen";
url = "https://www.degruyter.com/journal/key/INDO/html";
@@ -128,8 +133,11 @@ in
home = urlwatchDir;
createHome = true;
isSystemUser = true;
group = "urlwatch";
};
users.groups.urlwatch = {};
systemd.services.urlwatch = {
enable = true;
startAt = "*-*-* 05:00:00";
@@ -140,6 +148,7 @@ in
'';
serviceConfig = {
User = config.users.extraUsers.urlwatch.name;
Group = config.users.groups.urlwatch.name;
WorkingDirectory = config.users.extraUsers.urlwatch.home;
PermissionsStartOnly = "true";
PrivateTmp = "true";

View File

@@ -23,7 +23,7 @@ in {
'';
weechat = pkgs.weechat.override {
configure = { ... }: {
scripts = [ pkgs.weechatScripts.weechat-autosort pkgs.weechatScripts.colorize_nicks ];
scripts = [ pkgs.weechatScripts.weechat-autosort pkgs.weechatScripts.colorize_nicks pkgs.weechatScripts.weechat-matrix ];
init = let
coolColors = lib.lists.subtractLists (lib.range 52 69 ++ lib.range 231 248) (lib.range 31 254);
nick = "kmein";
@@ -43,14 +43,18 @@ in {
/server add oftc irc.oftc.net/6697 -ssl -ipv6
/server add retiolum irc.r
/server add news news.r
/matrix server add nibbana nibbana.jp
/alias add mod /quote omode $channel +o $nick
/relay add weechat 9000
/set relay.network.password ${relayPassword}
/set matrix.server.nibbana.username ${nick}
/set matrix.server.nibbana.password "${lib.strings.fileContents <system-secrets/matrix/nibbana>}"
/set irc.server.oftc.command /msg nickserv IDENTIFY ${lib.strings.fileContents <system-secrets/irc/oftc>};/msg nickserv SET CLOAK ON
/set irc.server.oftc.autojoin "#osm,#osm-de"
/set irc.server.oftc.autojoin "#osm,#osm-de,#home-manager"
/set irc.server.hackint.autojoin "#krebs,#nixos,#the_playlist"
/set irc.server.hackint.sasl_mechanism plain
@@ -68,7 +72,7 @@ in {
/set irc.server.news.command "/oper aids balls"
/set logger.level.irc.news 0
/filter addreplace zerocovid * * [kc]orona|[kc]ovid|virus|lockdown|va[kc][sc]in|mutante|mutation|impf|pandemi|κορ[ωο]ν[αο]ϊό|корона|expert|infe[ck]t|infizi|in[cz]iden[cz]|sars-cov|drosten|virolog|lauterbach|delta
/filter addreplace zerocovid * * [kc]orona|💉|🤒|😷|[kc]ovid|virus|lockdown|va[kc][sc]in|mutante|mutation|impf|pandemi|κορ[ωο]ν[αο]ϊό|корона|expert|infe[ck]t|infizi|in[cz]iden[cz]|sars-cov|drosten|virolog|lauterbach|delta|omi[ck]ron|epidemi|booster|r-wert
/filter addreplace joinquit * irc_join,irc_part,irc_quit,irc_nick *
/filter addreplace playlist_topic irc.*.#the_playlist irc_topic *
/filter addreplace brockman_notice irc.news.* irc_notice *
@@ -80,6 +84,7 @@ in {
/connect hackint
/connect retiolum
/connect news
/matrix connect nibbana
'';
};
};

View File

@@ -1,68 +1,40 @@
{ pkgs, secrets, writeCommand, lib, nixosRebuildCommand ? "switch" }:
let
inherit (import ./lib/default.nix) sshPort;
sshPort = 22022;
gitFromJson = path:
let object = importJson path;
in {
inherit (object) url;
ref = object.rev;
# command that ensures we use flake.nix during switch
command = targetPath:
let
commandLine = "TMPDIR=/tmp nixos-rebuild ${nixosRebuildCommand} --flake ${targetPath} -L --keep-going";
in
''
echo '${commandLine}'
nix-shell \
-E "with import <nixpkgs> {}; mkShell { buildInputs = [ git (nixos { nix.package = nixFlakes; }).nixos-rebuild ]; }" \
--run '${commandLine}'
'';
source = name: {
niveum.file = toString ./.;
system-secrets.pass = {
dir = secrets;
name = "systems/${name}";
};
secrets.pass = {
dir = secrets;
name = "shared";
};
krops = builtins.fetchGit (gitFromJson .versions/krops.json);
lib = import "${krops}/lib";
pkgs = import "${krops}/pkgs" { };
importJson = (import <nixpkgs> { }).lib.importJSON;
regularSystem = { path, name, address }: {
source = lib.evalSource [{
niveum.file = toString ./.;
system.file = toString path;
nixos-config.symlink = "system/configuration.nix";
nixpkgs.git = gitFromJson .versions/nixpkgs.json // { shallow = true; };
nixpkgs-unstable.git = gitFromJson .versions/nixpkgs-unstable.json // { shallow = true; };
home-manager.git = gitFromJson .versions/home-manager.json;
stockholm.git = gitFromJson .versions/stockholm.json;
retiolum.git = gitFromJson .versions/retiolum.json;
nur.git = gitFromJson .versions/nur.json;
nixpkgs-mozilla.git = gitFromJson .versions/nixpkgs-mozilla.json;
system-secrets.pass = {
dir = toString ~/.password-store;
name = "systems/${name}";
};
secrets.pass = {
dir = toString ~/.password-store;
name = "shared";
};
}];
target = "root@${address}:${toString sshPort}";
};
inherit (pkgs.krops) writeDeploy;
deploy = {name, host}: writeCommand "/bin/system" {
source = lib.evalSource [ (source name) ];
force = true;
target = lib.mkTarget "root@${host}:${toString sshPort}/var/krops/niveum";
inherit command;
};
in {
zaatar = writeDeploy "deploy-zaatar" (regularSystem {
path = systems/zaatar;
name = "zaatar";
address = "zaatar.r";
});
kabsa = writeDeploy "deploy-kabsa" (regularSystem {
path = systems/kabsa;
name = "kabsa";
address = "kabsa.r";
});
toum = writeDeploy "deploy-toum" (regularSystem {
path = systems/toum;
name = "toum";
address = "toum.r";
}) // {
buildTarget = "${builtins.getEnv "USER"}@localhost/${builtins.getEnv "HOME"}/.cache/krops";
};
makanek = writeDeploy "deploy-makanek" (regularSystem {
path = systems/makanek;
name = "makanek";
address = "makanek.r";
});
manakish = writeDeploy "deploy-manakish" (regularSystem {
path = systems/manakish;
name = "manakish";
address = "manakish.r";
});
zaatar = deploy { name = "zaatar"; host = "zaatar.r"; };
kabsa = deploy { name = "kabsa"; host = "kabsa.r"; };
manakish = deploy { name = "manakish"; host = "manakish.r"; };
makanek = deploy { name = "makanek"; host = "makanek.r"; };
}

174
flake.lock generated Normal file
View File

@@ -0,0 +1,174 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1638122382,
"narHash": "sha256-sQzZzAbvKEqN9s0bzWuYmRaA03v40gaJ4+iL1LXjaeI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "74f7e4319258e287b0f9cb95426c9853b282730b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1639871969,
"narHash": "sha256-6feWUnMygRzA9tzkrfAzpA5/NBYg75bkFxnqb1DtD7E=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "697cc8c68ed6a606296efbbe9614c32537078756",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "release-21.11",
"repo": "home-manager",
"type": "github"
}
},
"krops": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1632420452,
"narHash": "sha256-ncK6vABW/Ku9XI0kqj1otarUfblryoQzSaOCnaZ0oSs=",
"owner": "Mic92",
"repo": "krops",
"rev": "0388970c568905fedcbf429e5745aacd4f7a6633",
"type": "github"
},
"original": {
"owner": "Mic92",
"repo": "krops",
"type": "github"
}
},
"nix-writers": {
"flake": false,
"locked": {
"lastModified": 1554228333,
"narHash": "sha256-hG/PlcCvCQhNcU55NpHfATkyH9k6cZmO7uvBoJjasXU=",
"ref": "master",
"rev": "c528cf970e292790b414b4c1c8c8e9d7e73b2a71",
"revCount": 32,
"type": "git",
"url": "https://cgit.krebsco.de/nix-writers"
},
"original": {
"type": "git",
"url": "https://cgit.krebsco.de/nix-writers"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1640759603,
"narHash": "sha256-k4d7oC6GvDV1OKxG325JUDpKtZcDUPEiddnJMOQQ/x8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "e101dc111ac1e5a21efca7822417acc1cb92013a",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "release-21.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1640540585,
"narHash": "sha256-cCmknKFjWgam9jq+58wSd0Z4REia8mjBP65kXcL3ki8=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "ac169ec6371f0d835542db654a65e0f2feb07838",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"retiolum": {
"flake": false,
"locked": {
"lastModified": 1640734423,
"narHash": "sha256-i/M1nyPnIEqV7K5dn0Q7V5mRtfzspH+AM6HbgPYGreI=",
"owner": "krebs",
"repo": "retiolum",
"rev": "0e11e0119f330ea103a44e3502149ae50c1a299d",
"type": "github"
},
"original": {
"owner": "krebs",
"repo": "retiolum",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"home-manager": "home-manager",
"krops": "krops",
"nix-writers": "nix-writers",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"retiolum": "retiolum",
"secrets": "secrets",
"stockholm": "stockholm"
}
},
"secrets": {
"flake": false,
"locked": {
"lastModified": 1640701876,
"narHash": "sha256-2vQ32k/z0Jh+Ade32mRA6tENetvWI6SNNrR5DJiBuWw=",
"ref": "master",
"rev": "120635422c7fb78c94e6a182fc384c98fb5cf4ce",
"revCount": 170,
"type": "git",
"url": "file:///home/kfm/projects/sphinx"
},
"original": {
"type": "git",
"url": "file:///home/kfm/projects/sphinx"
}
},
"stockholm": {
"flake": false,
"locked": {
"lastModified": 1640733142,
"narHash": "sha256-HzSEyYTGPoGAfgl+lZLb/DDUCQRoZ2iN7oTLhl+1KTQ=",
"ref": "master",
"rev": "687948cfe5154e03f93886dd27dc30c7910ba754",
"revCount": 10222,
"type": "git",
"url": "https://cgit.krebsco.de/stockholm"
},
"original": {
"type": "git",
"url": "https://cgit.krebsco.de/stockholm"
}
}
},
"root": "root",
"version": 7
}

99
flake.nix Normal file
View File

@@ -0,0 +1,99 @@
{
description = "niveum systems";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/release-21.11";
nixpkgs-unstable.url = "github:nixos/nixpkgs/nixos-unstable";
secrets = {
url = "/home/kfm/.password-store";
flake = false;
};
flake-utils = {
url = "github:numtide/flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
home-manager = {
url = "github:nix-community/home-manager/release-21.11";
inputs.nixpkgs.follows = "nixpkgs";
};
retiolum = {
url = "github:krebs/retiolum";
flake = false;
};
nix-writers = {
url = "git+https://cgit.krebsco.de/nix-writers";
flake = false;
};
stockholm = {
url = "git+https://cgit.krebsco.de/stockholm";
flake = false;
};
krops = {
url = "github:Mic92/krops";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, stockholm, secrets, nixpkgs-unstable, home-manager, retiolum, krops, nix-writers, ... }@inputs:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
writeCommand = krops.packages.${system}.writeCommand;
niveumSystem = configuration: nixpkgs.lib.nixosSystem {
inherit system;
modules = defaultModules ++ [ configuration ];
};
defaultModules = [
{ _module.args.inputs = inputs; }
({ pkgs, ... }: {
nix = {
nixPath = [ "nixpkgs=${pkgs.path}" ];
package = pkgs.nixFlakes;
extraOptions = ''
experimental-features = nix-command flakes
'';
};
nixpkgs.overlays = [
(_self: _super: {
unstable = nixpkgs-unstable.legacyPackages.${pkgs.system};
})
(import "${nix-writers}/pkgs")
# (import <stockholm/krebs/5pkgs>)
];
})
home-manager.nixosModules.home-manager
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
}
];
in
{
nixosConfigurations = {
kabsa = niveumSystem systems/kabsa/configuration.nix;
makanek = niveumSystem systems/makanek/configuration.nix;
manakish = niveumSystem systems/manakish/configuration.nix;
zaatar = niveumSystem systems/zaatar/configuration.nix;
};
apps.${system} = {
# nix run ".#deploy.kabsa"
deploy = pkgs.callPackage ./deploy.nix {
inherit secrets writeCommand;
inherit (krops) lib;
};
# nix run ".#test.kabsa"
test = pkgs.callPackage ./deploy.nix {
inherit secrets writeCommand;
inherit (krops) lib;
nixosRebuildCommand = "test";
};
};
};
}

View File

@@ -94,12 +94,18 @@ in {
}
{
block = "custom";
interval = 60 * 60;
interval = 60 * 5;
command = let inherit (import <niveum/configs/spacetime.nix>) location; in "${pkgs.scripts.horoscope}/bin/horoscope --latitude=${toString location.latitude} --longitude=${toString location.longitude}";
}
{
block = "custom";
interval = 60 * 5;
command = let spacetime = import <niveum/configs/spacetime.nix>; in pkgs.writers.writePython3 "sun.py" { libraries = [ pkgs.python3Packages.astral ]; flakeIgnore = [ "E121" "E501" ]; }
''
import astral
import astral.moon
import astral.sun
import math
moon_phases = {
0: "🌑",
@@ -115,10 +121,12 @@ in {
current_phase = astral.moon.phase()
closest_phase = min(moon_phases.keys(), key=lambda x: abs(current_phase - x))
moon_percentage = round(100 * math.sin(current_phase / 28 * math.pi), 1)
city = astral.LocationInfo("Berlin", "Germany", "${spacetime.time.timeZone}", ${toString spacetime.location.latitude}, ${toString spacetime.location.longitude})
sun = astral.sun.sun(city.observer, date=astral.today(), tzinfo=city.timezone)
print("🌅 {} 🌇 {} {}".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), moon_phases[closest_phase]))
print("🌅 {} 🌇 {} {} {}%".format(sun["sunrise"].strftime("%R"), sun["sunset"].strftime("%R"), moon_phases[closest_phase], moon_percentage))
'';
}
{

View File

@@ -50,12 +50,20 @@ in [
desc = "Diminutive from lassus (weary, faint, tired). A programming human. Doing superior professional art.";
}
{
stream = "https://radio.xn--kiern-0qa.de/lyrik/listen.ogg";
stream = "https://cdn.c3voc.de/hls/abchillgleis/segment_Native.m3u8";
station = "RC3 Abchillgleis";
}
{
stream = "https://cdn.c3voc.de/hls/c3lounge/segment_Native.m3u8";
station = "RC3 Lounge";
}
{
stream = "https://radio.kmein.de/lyrik/listen.ogg";
station = "Lyrik";
desc = "Lyrik-Lesung rund um die Uhr.";
}
{
stream = "https://radio.xn--kiern-0qa.de/lyrikline/listen.ogg";
stream = "https://radio.kmein.de/lyrikline/listen.ogg";
station = "Lyrikline";
logo = "https://www.lyrikline.org/themes/lyrik/svg/Logo_lyrikline_pure.svg";
desc = "24/7 zufällige Wiedergaben von lyrikline.org.";

View File

@@ -132,6 +132,7 @@ if has("autocmd")
autocmd bufnewfile,bufread *.jq packadd jq.vim
autocmd bufnewfile,bufread *.re packadd vim-reason-plus | set filetype=reason
autocmd bufnewfile,bufread *.journal packadd vim-ledger | set filetype=ledger shiftwidth=4
autocmd bufnewfile,bufread *.md packadd vim-pandoc | packadd vim-pandoc-syntax
autocmd bufnewfile,bufread urls,config set filetype=conf
autocmd bufnewfile,bufread *.elm packadd elm-vim | set filetype=elm shiftwidth=4
autocmd bufnewfile,bufread *.dhall packadd dhall-vim | set filetype=dhall

View File

@@ -1,7 +1,6 @@
{
imports = [
./constants.nix
./dropbox.nix
./retiolum.nix
];
}

View File

@@ -1,29 +0,0 @@
{ pkgs, lib, config, ... }:
with lib;
let cfg = config.niveum.dropbox;
in {
options.niveum.dropbox = { enable = mkEnableOption "Dropbox"; };
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.dropbox-cli ];
networking.firewall = {
allowedTCPPorts = [ 17500 ];
allowedUDPPorts = [ 17500 ];
};
systemd.user.services.dropbox = {
description = "Dropbox synchronisation service";
wantedBy = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.dropbox.out}/bin/dropbox";
ExecReload = "${pkgs.coreutils.out}/bin/kill -HUP $MAINPID";
KillMode = "control-group"; # upstream recommends process
Restart = "on-failure";
PrivateTmp = true;
ProtectSystem = "full";
Nice = 10;
};
};
};
}

View File

@@ -56,6 +56,7 @@ in {
users.users.moodle-dl = {
isSystemUser = true;
home = cfg.directory;
group = "moodle-dl";
};
users.groups.moodle-dl = {};

View File

@@ -1,8 +1,9 @@
{ config, pkgs, lib, ... }:
{ inputs, config, pkgs, lib, ... }:
with lib;
let
netname = "retiolum";
cfg = config.networking.retiolum;
inherit (inputs) retiolum;
in {
options = {
networking.retiolum.ipv4 = mkOption {
@@ -31,16 +32,17 @@ in {
services.tinc.networks.${netname} = {
name = cfg.nodename;
hosts = builtins.mapAttrs
(name: _: builtins.readFile "${<retiolum/hosts>}/${name}")
(builtins.readDir <retiolum/hosts>);
(name: _: builtins.readFile "${retiolum}/hosts/${name}")
(builtins.readDir "${retiolum}/hosts");
rsaPrivateKeyFile = toString <system-secrets/retiolum.key>;
ed25519PrivateKeyFile = toString <system-secrets/retiolum.ed25519>;
extraConfig = ''
LocalDiscovery = yes
AutoConnect = yes
'';
};
networking.extraHosts = builtins.readFile (toString <retiolum/etc.hosts>);
networking.extraHosts = builtins.readFile (toString "${retiolum}/etc.hosts");
environment.systemPackages = [ config.services.tinc.networks.${netname}.package ];

View File

@@ -6,8 +6,8 @@ let
traadfri-package = pkgs.fetchFromGitHub {
owner = "kmein";
repo = "traadfri";
rev = "a55b778cf4c7f124e75070b056c90f5a8043bc45";
sha256 = "10ggqksdbgmcwc2f3xs6abjf9zpvv554xfl3b3bblmfijgr6srv9";
rev = "cf46bd09cd3263b90a09b0ca979aa705a4c3671c";
sha256 = "0az9q38pl8fqk00488blhn6rhvwsw2wky3dbdlyz7945ggvxnbyd";
};
in pkgs.callPackage traadfri-package {
libcoap = pkgs.callPackage <niveum/packages/libcoap.nix> { tls = true; };

View File

@@ -76,7 +76,11 @@ in {
};
config = mkIf cfg.enable {
users.extraUsers.tuna.isSystemUser = true;
users.users.tuna = {
isSystemUser = true;
group = "tuna";
};
users.groups.tuna = {};
# ref https://github.com/florianheinemann/MPD.FM/blob/9d037cf87597b26ae2f10ba9feea48946ad6cc68/service/MPD.FM.service
systemd.services.tuna = {
wantedBy = [ "multi-user.target" ];

27
packages/daybook.nix Normal file
View File

@@ -0,0 +1,27 @@
{ lib, stdenv, makeWrapper, pandoc, fetchFromGitHub }:
stdenv.mkDerivation {
name = "daybook";
src = fetchFromGitHub {
owner = "kmein";
repo = "daybook";
rev = "db2c34830e09183c80f3381bf5e4c44d52f05d53";
sha256 = "0nbsv8f12qh5spq7zhimhdf3p7msk33xrb0ilqvlc6jmlkpislmv";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ pandoc ];
buildPhase = ''
mkdir -p $out/man/man1
pandoc --standalone --to man daybook.1.md -o $out/man/man1/daybook.1
'';
installPhase = ''
mkdir -p $out/bin
install daybook $out/bin
wrapProgram $out/bin/daybook --prefix PATH ":" ${pandoc}/bin ;
'';
meta = with lib; {
homepage = https://github.com/kmein/daybook;
description = "A diary writing utility in sh";
license = licenses.mit;
platforms = platforms.linux;
};
}

29
packages/depp.nix Normal file
View File

@@ -0,0 +1,29 @@
{ lib, writeShellScriptBin }:
let
aliasFlag = name: value: "-c alias.${name}=${lib.escapeShellArg value}";
aliases = {
eroeffne = "init";
machnach = "clone";
zieh = "pull";
fueghinzu = "add";
drueck = "push";
pfusch = "push --force";
zweig = "branch";
verzweige = "branch";
uebergib = "commit";
erde = "rebase";
unterscheide = "diff";
vereinige = "merge";
bunkere = "stash";
markiere = "tag";
nimm = "checkout";
tagebuch = "log";
zustand = "status";
};
in writeShellScriptBin "depp" ''
if [ $# -gt 0 ]; then
git ${lib.concatStringsSep " " (lib.attrsets.mapAttrsToList aliasFlag aliases)} "$@"
else
printf "${lib.concatStringsSep "\n" (lib.attrsets.mapAttrsToList (n: v: n + " " + v) aliases)}\n"
fi
''

28
packages/devour.nix Normal file
View File

@@ -0,0 +1,28 @@
{ lib, stdenv, xdo, makeWrapper, fetchFromGitHub }:
stdenv.mkDerivation {
name = "devour";
version = "master";
src = fetchFromGitHub {
owner = "salman-abedin";
repo = "devour";
rev = "ceb871c3046ce290c27e2887365b9a19ca38113c";
sha256 = "0f2jb8knx7lqy6wmf3rchgq2n2dj496lm8vgcs58rppzrmsk59d5";
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ xdo ];
DESTDIR="$(out)";
fixupPhase = ''
wrapProgram $out/bin/devour --prefix PATH ":" ${xdo}/bin ;
'';
meta = with lib; {
homepage = "https://github.com/salman-abedin/devour";
description = "Window Manager agnostic swallowing feature for terminal emulators";
license = licenses.gpl3;
platforms = platforms.all;
};
}

30
packages/mahlzeit.nix Normal file
View File

@@ -0,0 +1,30 @@
{ lib, fetchFromGitHub, mkDerivation, ansi-terminal, base, directory, doctest, filepath
, megaparsec, optparse-applicative, prettyprinter, process
, raw-strings-qq, stdenv, tasty, tasty-hunit, text, yaml
}:
mkDerivation {
pname = "mahlzeit";
version = "0.1.0";
src = fetchFromGitHub {
owner = "kmein";
repo = "mahlzeit";
rev = "954c0fb3f45815999bc65d003794af6a850b069c";
sha256 = "046yrr40hjmxkjmwzcvmwb39fxx2v2i6hgdxrjfiwilzvhikarrg";
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
ansi-terminal base directory filepath megaparsec prettyprinter text
yaml
];
executableHaskellDepends = [
ansi-terminal base directory filepath optparse-applicative process
text yaml
];
testHaskellDepends = [
base doctest megaparsec raw-strings-qq tasty tasty-hunit
];
homepage = "https://github.com/kmein/mahlzeit";
description = "Recipe toolkit";
license = lib.licenses.mit;
}

14
packages/man/pandoc.nix Normal file
View File

@@ -0,0 +1,14 @@
{ stdenv, pandoc, lib, fetchgit }:
stdenv.mkDerivation {
name = "pandoc-doc";
version = pandoc.version;
src = fetchgit {
url = "https://github.com/jgm/pandoc";
rev = pandoc.version;
sha256 = "0s4mczbql35wh6bhyi542yln24f530rlsw6akcv7lmp083rrlpy4";
};
buildPhase = ''
mkdir -p $out/man/man1
${pandoc}/bin/pandoc -V section=1 --standalone --write=man $src/MANUAL.txt -o $out/man/man1/pandoc.1
'';
}

26
packages/opustags.nix Normal file
View File

@@ -0,0 +1,26 @@
{ lib, stdenv, cmake, pkgconfig, libogg, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "opustags";
version = "1.3.0";
src = fetchFromGitHub {
owner = "fmang";
repo = "opustags";
rev = version;
sha256 = "09z0cdg20algaj2yyhfz3hxh1biwjjvzx1pc2vdc64n8lkswqsc1";
};
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX=$out"
];
buildInputs = [ libogg ];
nativeBuildInputs = [ cmake pkgconfig ];
meta = with lib; {
homepage = "https://github.com/fmang/opustags";
description = "Ogg Opus tags editor";
platforms = platforms.all;
};
}

View File

@@ -0,0 +1,12 @@
{ fetchPypi, buildPythonPackage, pygtrie, ... }:
buildPythonPackage rec {
pname = "betacode";
version = "0.2";
src = fetchPypi {
inherit pname version;
sha256 = "08fnjzjvnm9m6p4ddyr8qgfb9bs2nipv4ls50784v0xazgxx7siv";
};
preBuild = ''echo > README.rst'';
propagatedBuildInputs = [ pygtrie ];
doCheck = false;
}

View File

@@ -0,0 +1,14 @@
{ fetchFromGitHub, buildPythonPackage, backports_functools_lru_cache, selenium, regex, ... }:
buildPythonPackage rec {
pname = "indic_transliteration";
version = "unstable-2020-12-15";
src = fetchFromGitHub {
repo = pname;
owner = "sanskrit-coders";
rev = "2ea25a03af15937916b6768835e056166986c567";
sha256 = "1pcf800hl0zkcffc47mkjq9mizsxdi0hwxlnij5bvbqdshd3w9ll";
};
patches = [ ./regex-version.patch ];
propagatedBuildInputs = [ backports_functools_lru_cache selenium regex ];
doCheck = false;
}

View File

@@ -0,0 +1,9 @@
diff --git a/requirements.txt b/requirements.txt
index 76b12d7..27fdc79 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
backports.functools_lru_cache==1.6.1
selenium==3.141.0
-regex==2020.10.11
+regex>=2020.7.14

View File

@@ -0,0 +1,12 @@
{ buildPythonApplication, fetchPypi, requests }:
let
in buildPythonApplication rec {
pname = "instaloader";
version = "4.2.4";
src = fetchPypi {
inherit pname version;
sha256 = "02zqb02idk2pzks7dv42vigcmmpjpfhfdyjp911yr0ix7dy3q0b9";
};
propagatedBuildInputs = [ requests ];
doCheck = false;
}

View File

@@ -0,0 +1,10 @@
{ fetchPypi, buildPythonPackage, ... }:
buildPythonPackage rec {
pname = "pygtrie";
version = "2.3";
src = fetchPypi {
inherit pname version;
sha256 = "00x7q4p9r75zdnw3a8vd0d0w0i5l28w408g5bsfl787yv6b1h9i8";
};
doCheck = false;
}

View File

@@ -0,0 +1,23 @@
{ buildPythonPackage, buildPythonApplication, fetchPypi, pytestrunner, six, beautifulsoup4, requests, dbus-python }:
let
lyricwikia = buildPythonPackage rec {
pname = "lyricwikia";
version = "0.1.9";
src = fetchPypi {
inherit pname version;
sha256 = "0sa5wkbgp5bpgkl8hgn7byyz9zj0786647ikf2l0k8m4fimq623y";
};
buildInputs = [ pytestrunner ];
propagatedBuildInputs = [ six beautifulsoup4 requests ];
doCheck = false;
};
in buildPythonApplication rec {
pname = "spotify-cli-linux";
version = "1.4.2";
src = fetchPypi {
inherit pname version;
sha256 = "1gxich3v2i4lmh60abbw3mw15399afvvqflv8g6plvvbmvxmbgp0";
};
propagatedBuildInputs = [ lyricwikia dbus-python ];
doCheck = false;
}

31
packages/scripts/auc.nix Normal file
View File

@@ -0,0 +1,31 @@
{ stdenv, fetchFromGitHub, lib, pandoc }:
let
owner = "kamalist";
in
stdenv.mkDerivation rec {
pname = "auc";
version = "2019-04-02";
src = fetchFromGitHub {
inherit owner;
repo = "AUC";
rev = "66d1cd57472442b4bf3c1ed12ca5cadd57d076b3";
sha256 = "0gb4asmlfr19h42f3c5wg9c9i3014if3ymrqan6w9klgzgfyh2la";
};
installPhase = ''
mkdir -p $out/{bin,man/man1}
install auc $out/bin
${pandoc}/bin/pandoc -V title=${lib.escapeShellArg pname} -V section=1 $src/README.md -s -t man -o $out/man/man1/auc.1
'';
meta = with lib; {
description = "Command-line Roman calendar";
longDescription = ''
AUC (Ab Urbe condita) is a command-line Roman calendar tool. Currently it shows the specified date in the format of the Ancient Romans.
'';
license = licenses.mit;
maintainers = [ maintainers.kmein ];
platforms = platforms.all;
};
}

View File

@@ -1,6 +1,8 @@
{ pkgs, lib, ... }:
let
kpaste = pkgs.callPackage <stockholm/krebs/5pkgs/simple/kpaste> { };
opustags = pkgs.callPackage <niveum/packages/opustags.nix> { };
betacode = pkgs.callPackage <niveum/packages/python3Packages/betacode.nix> { };
wrapScript = { packages ? [ ], name, script }:
pkgs.writers.writeDashBin name ''
PATH=$PATH:${
@@ -15,6 +17,8 @@ let
sha256 = "0c4hkny4zkknlimc9yi9ljss2cws4zn8lzd8ip9b8mfsm094dlfl";
};
in rec {
auc = pkgs.callPackage ./auc.nix {};
instaget = wrapScript {
packages = [ pkgs.jq pkgs.curl pkgs.gnugrep ];
script = ./instaget.sh;
@@ -95,7 +99,7 @@ in rec {
'';
tag = wrapScript {
packages = [ pkgs.vorbisTools pkgs.python3Packages.eyeD3 pkgs.nur.repos.kmein.opustags ];
packages = [ pkgs.vorbisTools pkgs.python3Packages.eyeD3 opustags ];
script = "${voidrice}/.local/bin/tag";
name = "tag";
};
@@ -138,7 +142,7 @@ in rec {
set -efu
usage() {
echo "usage: $0 mw|mwe|boet|bopp|apte|boro TERM"
echo "usage: [OUTPUT=deva|roman] $0 mw|mwe|boet|bopp|apte|boro TERM"
exit 1
}
@@ -158,7 +162,7 @@ in rec {
input="$*"
${pkgs.curl}/bin/curl -sSL "https://www.sanskrit-lexicon.uni-koeln.de/scans/$id/2020/web/webtc/getword.php?key=$input&filter=roman&accent=yes&transLit=hk" \
${pkgs.curl}/bin/curl -sSL "https://www.sanskrit-lexicon.uni-koeln.de/scans/$id/2020/web/webtc/getword.php?key=$input&filter=''${OUTPUT-roman}&accent=yes&transLit=hk" \
| ${pkgs.pandoc}/bin/pandoc --standalone --variable=title:"$input" --from=html --to=man \
| ${pkgs.gnused}/bin/sed 's/\s\+\([:.,;]\)/\1/g;s/\s\+/ /g' \
| ${pkgs.man}/bin/man --local-file --pager="${pkgs.bat}/bin/bat -p" -
@@ -184,6 +188,8 @@ in rec {
}} "$@"
'';
horoscope = pkgs.callPackage ./horoscope {};
genius = wrapScript {
packages = [ pkgs.curl pkgs.gnused pkgs.pandoc ];
name = "genius";
@@ -291,7 +297,7 @@ in rec {
'';
betacode = pkgs.writers.writePython3Bin "betacode" {
libraries = [ pkgs.nur.repos.kmein.python3Packages.betacode ];
libraries = [ betacode ];
} ''
import betacode.conv
import sys
@@ -400,4 +406,12 @@ in rec {
curl -L "https://github.com/Mic92/nix-index-database/releases/download/$tag/files" -o $XDG_RUNTIME_DIR/files-$tag
mv $XDG_RUNTIME_DIR/files-$tag $HOME/.cache/nix-index/files
'';
} // {
devour = pkgs.callPackage <niveum/packages/devour.nix> { };
depp = pkgs.callPackage <niveum/packages/depp.nix> { };
text2pdf = pkgs.callPackage <niveum/packages/text2pdf.nix> { };
vimv = pkgs.callPackage <niveum/packages/vimv.nix> { };
when = pkgs.callPackage <niveum/packages/when.nix> { };
mahlzeit = pkgs.haskellPackages.callPackage <niveum/packages/mahlzeit.nix> { };
inherit opustags;
}

View File

@@ -0,0 +1,4 @@
{ poetry2nix }:
poetry2nix.mkPoetryApplication {
projectDir = ./.;
}

View File

@@ -0,0 +1,54 @@
from datetime import datetime
import click
from flatlib.datetime import Datetime
from flatlib.geopos import GeoPos
from flatlib.chart import Chart
import flatlib.const
sign_symbols = {
flatlib.const.ARIES: "",
flatlib.const.TAURUS: "",
flatlib.const.GEMINI: "",
flatlib.const.CANCER: "",
flatlib.const.LEO: "",
flatlib.const.VIRGO: "",
flatlib.const.LIBRA: "",
flatlib.const.SCORPIO: "",
flatlib.const.SAGITTARIUS: "",
flatlib.const.CAPRICORN: "",
flatlib.const.AQUARIUS: "",
flatlib.const.PISCES: "",
}
planet_symbols = {
flatlib.const.SUN: "",
flatlib.const.MOON: "",
flatlib.const.MERCURY: "",
flatlib.const.VENUS: "",
flatlib.const.MARS: "",
flatlib.const.JUPITER: "",
flatlib.const.SATURN: "",
}
def convert_into_stupid_flatlib_format(dt):
return Datetime(dt.strftime("%Y/%m/%d"), dt.strftime("%H:%M"))
@click.command()
@click.option("--latitude", type=click.FLOAT, required=True)
@click.option("--longitude", type=click.FLOAT, required=True)
@click.option("--date", type=click.DateTime(), default=datetime.now())
def main(latitude: float, longitude: float, date: datetime):
flatlib_datetime = convert_into_stupid_flatlib_format(date)
position = GeoPos(latitude, longitude)
chart = Chart(flatlib_datetime, position)
for planet in planet_symbols.keys():
planet_position = chart.getObject(planet)
print(
planet_symbols[planet],
sign_symbols[planet_position.sign],
"" if planet_position.movement() == flatlib.const.RETROGRADE else "",
end="",
)
print()

127
packages/scripts/horoscope/poetry.lock generated Normal file
View File

@@ -0,0 +1,127 @@
[[package]]
name = "click"
version = "8.0.3"
description = "Composable command line interface toolkit"
category = "main"
optional = false
python-versions = ">=3.6"
[package.dependencies]
colorama = {version = "*", markers = "platform_system == \"Windows\""}
[[package]]
name = "colorama"
version = "0.4.4"
description = "Cross-platform colored terminal text."
category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"
[[package]]
name = "flatlib"
version = "0.2.3"
description = "Python library for Traditional Astrology"
category = "main"
optional = false
python-versions = "*"
[package.dependencies]
pyswisseph = "2.08.00-1"
[[package]]
name = "numpy"
version = "1.21.1"
description = "NumPy is the fundamental package for array computing with Python."
category = "main"
optional = false
python-versions = ">=3.7"
[[package]]
name = "pyswisseph"
version = "2.08.00-1"
description = "Python extension to the Swiss Ephemeris"
category = "main"
optional = false
python-versions = "*"
[[package]]
name = "pytz"
version = "2021.3"
description = "World timezone definitions, modern and historical"
category = "main"
optional = false
python-versions = "*"
[[package]]
name = "timezonefinder"
version = "5.2.0"
description = "fast python package for finding the timezone of any point on earth (coordinates) offline"
category = "main"
optional = false
python-versions = ">=3.6"
[package.dependencies]
numpy = ">=1.16"
[package.extras]
numba = ["numba (>=0.48)"]
[metadata]
lock-version = "1.1"
python-versions = "^3.8"
content-hash = "657742383232643f2fa13df5686de0cc79c624f9ae9bdb2f0fc96c7a94b5b8bf"
[metadata.files]
click = [
{file = "click-8.0.3-py3-none-any.whl", hash = "sha256:353f466495adaeb40b6b5f592f9f91cb22372351c84caeb068132442a4518ef3"},
{file = "click-8.0.3.tar.gz", hash = "sha256:410e932b050f5eed773c4cda94de75971c89cdb3155a72a0831139a79e5ecb5b"},
]
colorama = [
{file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"},
{file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"},
]
flatlib = [
{file = "flatlib-0.2.3-py3-none-any.whl", hash = "sha256:c846d83c965db7588581bb65ac9a6668b9a190afcad5027269f7e9c75f467bcd"},
{file = "flatlib-0.2.3.tar.gz", hash = "sha256:46cc956b936aa31a96082cff23448a5c27dd6e5e434a6293bc9265336c00dd5d"},
]
numpy = [
{file = "numpy-1.21.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38e8648f9449a549a7dfe8d8755a5979b45b3538520d1e735637ef28e8c2dc50"},
{file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fd7d7409fa643a91d0a05c7554dd68aa9c9bb16e186f6ccfe40d6e003156e33a"},
{file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a75b4498b1e93d8b700282dc8e655b8bd559c0904b3910b144646dbbbc03e062"},
{file = "numpy-1.21.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1412aa0aec3e00bc23fbb8664d76552b4efde98fb71f60737c83efbac24112f1"},
{file = "numpy-1.21.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e46ceaff65609b5399163de5893d8f2a82d3c77d5e56d976c8b5fb01faa6b671"},
{file = "numpy-1.21.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:c6a2324085dd52f96498419ba95b5777e40b6bcbc20088fddb9e8cbb58885e8e"},
{file = "numpy-1.21.1-cp37-cp37m-win32.whl", hash = "sha256:73101b2a1fef16602696d133db402a7e7586654682244344b8329cdcbbb82172"},
{file = "numpy-1.21.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7a708a79c9a9d26904d1cca8d383bf869edf6f8e7650d85dbc77b041e8c5a0f8"},
{file = "numpy-1.21.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95b995d0c413f5d0428b3f880e8fe1660ff9396dcd1f9eedbc311f37b5652e16"},
{file = "numpy-1.21.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:635e6bd31c9fb3d475c8f44a089569070d10a9ef18ed13738b03049280281267"},
{file = "numpy-1.21.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4a3d5fb89bfe21be2ef47c0614b9c9c707b7362386c9a3ff1feae63e0267ccb6"},
{file = "numpy-1.21.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a326af80e86d0e9ce92bcc1e65c8ff88297de4fa14ee936cb2293d414c9ec63"},
{file = "numpy-1.21.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:791492091744b0fe390a6ce85cc1bf5149968ac7d5f0477288f78c89b385d9af"},
{file = "numpy-1.21.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0318c465786c1f63ac05d7c4dbcecd4d2d7e13f0959b01b534ea1e92202235c5"},
{file = "numpy-1.21.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a513bd9c1551894ee3d31369f9b07460ef223694098cf27d399513415855b68"},
{file = "numpy-1.21.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:91c6f5fc58df1e0a3cc0c3a717bb3308ff850abdaa6d2d802573ee2b11f674a8"},
{file = "numpy-1.21.1-cp38-cp38-win32.whl", hash = "sha256:978010b68e17150db8765355d1ccdd450f9fc916824e8c4e35ee620590e234cd"},
{file = "numpy-1.21.1-cp38-cp38-win_amd64.whl", hash = "sha256:9749a40a5b22333467f02fe11edc98f022133ee1bfa8ab99bda5e5437b831214"},
{file = "numpy-1.21.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d7a4aeac3b94af92a9373d6e77b37691b86411f9745190d2c351f410ab3a791f"},
{file = "numpy-1.21.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d9e7912a56108aba9b31df688a4c4f5cb0d9d3787386b87d504762b6754fbb1b"},
{file = "numpy-1.21.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:25b40b98ebdd272bc3020935427a4530b7d60dfbe1ab9381a39147834e985eac"},
{file = "numpy-1.21.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a92c5aea763d14ba9d6475803fc7904bda7decc2a0a68153f587ad82941fec1"},
{file = "numpy-1.21.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:05a0f648eb28bae4bcb204e6fd14603de2908de982e761a2fc78efe0f19e96e1"},
{file = "numpy-1.21.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f01f28075a92eede918b965e86e8f0ba7b7797a95aa8d35e1cc8821f5fc3ad6a"},
{file = "numpy-1.21.1-cp39-cp39-win32.whl", hash = "sha256:88c0b89ad1cc24a5efbb99ff9ab5db0f9a86e9cc50240177a571fbe9c2860ac2"},
{file = "numpy-1.21.1-cp39-cp39-win_amd64.whl", hash = "sha256:01721eefe70544d548425a07c80be8377096a54118070b8a62476866d5208e33"},
{file = "numpy-1.21.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2d4d1de6e6fb3d28781c73fbde702ac97f03d79e4ffd6598b880b2d95d62ead4"},
{file = "numpy-1.21.1.zip", hash = "sha256:dff4af63638afcc57a3dfb9e4b26d434a7a602d225b42d746ea7fe2edf1342fd"},
]
pyswisseph = [
{file = "pyswisseph-2.08.00-1.tar.gz", hash = "sha256:6b4818c0224d309c0b01f3c52df2432900dddcde345364408d99eafc9cdd1e71"},
]
pytz = [
{file = "pytz-2021.3-py2.py3-none-any.whl", hash = "sha256:3672058bc3453457b622aab7a1c3bfd5ab0bdae451512f6cf25f64ed37f5b87c"},
{file = "pytz-2021.3.tar.gz", hash = "sha256:acad2d8b20a1af07d4e4c9d2e9285c5ed9104354062f275f3fcd88dcef4f1326"},
]
timezonefinder = [
{file = "timezonefinder-5.2.0-py36.py37.py38-none-any.whl", hash = "sha256:4545533086eb25cd7ba10b97785059acbababf4577ab1b4d5c2ab56642eadfea"},
{file = "timezonefinder-5.2.0.tar.gz", hash = "sha256:a374570295a8dbd923630ce85f754e52578e288cb0a9cf575834415e84758352"},
]

View File

@@ -0,0 +1,21 @@
[tool.poetry]
name = "horoscope"
version = "0.1.0"
description = ""
authors = ["Kierán Meinhardt <kmein@posteo.de>"]
[tool.poetry.dependencies]
python = "^3.8"
flatlib = "^0.2.3"
click = "^8.0.3"
timezonefinder = "^5.2.0"
pytz = "^2021.3"
[tool.poetry.scripts]
horoscope = "horoscope:main"
transits-current = "transits:current"
transits-forecast = "transits:forecast"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

View File

@@ -0,0 +1,181 @@
from flatlib import aspects, const
from flatlib.chart import Chart
from flatlib.datetime import Datetime
import pytz
from flatlib.geopos import GeoPos
import timezonefinder
import operator
import click
import itertools
from datetime import datetime, timedelta
tf = timezonefinder.TimezoneFinder()
planets = [
const.SUN,
const.MOON,
const.MERCURY,
const.VENUS,
const.MARS,
const.JUPITER,
const.SATURN,
const.URANUS,
const.NEPTUNE,
const.PLUTO,
]
planet_symbols = {
const.SUN: "",
const.MOON: "",
const.MERCURY: "",
const.VENUS: "",
const.MARS: "",
const.JUPITER: "",
const.SATURN: "",
const.URANUS: "",
const.NEPTUNE: "",
const.PLUTO: "",
}
aspect_symbols = {
const.NO_ASPECT: " ",
const.CONJUNCTION: "",
const.SEXTILE: "",
const.SQUARE: "",
const.TRINE: "",
const.OPPOSITION: "",
}
def convert_into_stupid_flatlib_format(dt):
return Datetime(
dt.strftime("%Y/%m/%d"),
dt.strftime("%H:%M"),
dt.utcoffset().total_seconds() / 3600,
)
here_latitude = 52.52
here_longitude = 13.4
def get_aspects(chart1, chart2, *, threshold):
for planet1 in chart1.objects:
for planet2 in chart2.objects:
aspect = aspects.getAspect(planet1, planet2, const.MAJOR_ASPECTS)
if aspect.exists() and aspect.orb <= threshold:
yield aspect
def get_chart(position, dt_naive):
timezone = pytz.timezone(tf.timezone_at(lat=position.lat, lng=position.lon))
dt_aware = timezone.localize(dt_naive)
return Chart(convert_into_stupid_flatlib_format(dt_aware), position, IDs=planets)
def show_aspect(aspect):
return " ".join(
[
planet_symbols[aspect.active.id],
aspect_symbols[aspect.type],
planet_symbols[aspect.passive.id],
]
)
@click.command()
@click.option("--natal-latitude", type=click.FLOAT, default=here_latitude)
@click.option("--natal-longitude", type=click.FLOAT, default=here_longitude)
@click.option("--natal-date", type=click.DateTime(), default=datetime.now())
@click.option("--transit-latitude", type=click.FLOAT, default=here_latitude)
@click.option("--transit-longitude", type=click.FLOAT, default=here_longitude)
@click.option("--transit-date", type=click.DateTime(), default=datetime.now())
@click.option("--threshold", type=click.FLOAT, default=5)
def forecast(
natal_latitude: float,
natal_longitude: float,
natal_date: datetime,
transit_latitude: float,
transit_longitude: float,
transit_date: datetime,
threshold: float,
):
transit_position = GeoPos(transit_latitude, transit_longitude)
natal_position = GeoPos(natal_latitude, natal_longitude)
natal_chart = get_chart(natal_position, natal_date)
transit_chart = get_chart(transit_position, transit_date)
offset = 0
previous_aspects = set(
show_aspect(a)
for a in get_aspects(natal_chart, transit_chart, threshold=threshold)
)
while True:
then = transit_date + timedelta(minutes=offset)
current_chart = get_chart(transit_position, then)
current_aspects = set(
show_aspect(a)
for a in get_aspects(natal_chart, current_chart, threshold=threshold)
)
entered = current_aspects - previous_aspects
exited = previous_aspects - current_aspects
if entered or exited:
print(
then.strftime("%Y-%m-%d %H:%M"),
"".join([" | +" + a for a in entered] + [" | -" + a for a in exited]),
sep="",
)
previous_aspects = current_aspects
offset += 1
@click.command()
@click.option("--natal-latitude", type=click.FLOAT, default=here_latitude)
@click.option("--natal-longitude", type=click.FLOAT, default=here_longitude)
@click.option("--natal-date", "-D", type=click.DateTime(), default=datetime.now())
@click.option("--transit-latitude", type=click.FLOAT, default=here_latitude)
@click.option("--transit-longitude", type=click.FLOAT, default=here_longitude)
@click.option("--transit-date", "-d", type=click.DateTime(), default=datetime.now())
@click.option("--threshold", "-t", type=click.FLOAT, default=5)
def current(
natal_latitude: float,
natal_longitude: float,
natal_date: datetime,
transit_latitude: float,
transit_longitude: float,
transit_date: datetime,
threshold: float,
):
transit_position = GeoPos(transit_latitude, transit_longitude)
natal_position = GeoPos(natal_latitude, natal_longitude)
natal_chart = get_chart(natal_position, natal_date)
transit_chart = get_chart(transit_position, transit_date)
relevant_aspects = list(
get_aspects(natal_chart, transit_chart, threshold=threshold)
)
def aspect_switch_date(aspect, *, direction=1, threshold):
offset = 0
while True:
then = transit_date + direction * timedelta(days=offset)
current_chart = get_chart(transit_position, then)
aspects = [
show_aspect(a)
for a in get_aspects(natal_chart, current_chart, threshold=threshold)
]
if aspect not in aspects:
return then.date()
offset += 1
for aspect in sorted(relevant_aspects, key=operator.attrgetter("orb")):
aspect_string = show_aspect(aspect)
print(
aspect_switch_date(
aspect_string, direction=-1, threshold=threshold
).isoformat(),
aspect_switch_date(
aspect_string, direction=1, threshold=threshold
).isoformat(),
aspect_string,
)

View File

@@ -2,7 +2,7 @@
let
inherit (pkgs) lib;
playlistAPI = "prism.r:8001";
playlistAPI = "https://radio.lassul.us";
sendIRC = pkgs.writers.writeDash "send-irc" ''
${pkgs.ircaids}/bin/ircsink \
@@ -44,12 +44,15 @@ in
pkgs.writers.writeDashBin "pls" ''
case "$1" in
good|like|cool|nice|noice|top|yup|yass|yes|+)
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/good"
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.good)} | shuf -n1 | ${sendIRC}
;;
skip|next|bad|sucks|no|nope|flop|-)
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
${pkgs.curl}/bin/curl -sS -XPOST "${playlistAPI}/skip"
echo ${lib.escapeShellArg (lib.concatStringsSep "\n" messages.bad)} | shuf -n1 | ${sendIRC}
;;
recent)
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/recent" | tac | head
;;
*)
${pkgs.curl}/bin/curl -sS -XGET "${playlistAPI}/current" \

View File

@@ -1,2 +0,0 @@
{ pkgs, id, name }: pkgs.writeDashBin name ''
''

22
packages/sncli.nix Normal file
View File

@@ -0,0 +1,22 @@
{ buildPythonPackage, buildPythonApplication, fetchPypi, requests, urwid }:
let
Simperium3 = buildPythonPackage rec {
pname = "Simperium3";
version = "0.1.3";
src = fetchPypi {
inherit pname version;
sha256 = "1j1w4dji39v44l96qq9kbrxpcjkjmika8065gwy8bf847f9fa76p";
};
propagatedBuildInputs = [ requests ];
};
in buildPythonApplication rec {
pname = "sncli";
version = "0.3.0";
src = fetchPypi {
inherit pname version;
sha256 = "18s5a6s2z7k14cbiyfdf98kw92r2hf1xwaavx67dxhadxm18xr4v";
};
propagatedBuildInputs = [ requests urwid Simperium3 ];
}

15
packages/text2pdf.nix Normal file
View File

@@ -0,0 +1,15 @@
{ stdenv, fetchurl }:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "text2pdf";
version = "1.1";
src = fetchurl {
url = "http://www.eprg.org/pdfcorner/text2pdf/text2pdf.c";
sha256 = "002nyky12vf1paj7az6j6ra7lljwkhqzz238v7fyp7sfgxw0f7d1";
};
phases = [ "buildPhase" ];
buildPhase = ''
mkdir -p $out/bin
gcc -o $out/bin/text2pdf $src
'';
}

22
packages/vimv.nix Normal file
View File

@@ -0,0 +1,22 @@
{ lib, stdenv, bash, fetchFromGitHub }:
stdenv.mkDerivation {
name = "vimv";
src = fetchFromGitHub {
owner = "thameera";
repo = "vimv";
rev = "4152496c1946f68a13c648fb7e583ef23dac4eb8";
sha256 = "1fsrfx2gs6bqx7wk7pgcji2i2x4alqpsi66aif4kqvnpqfhcfzjd";
};
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
sed 's:#!/bin/bash:#!${bash}/bin/bash:' $src/vimv > $out/bin/vimv
chmod 755 $out/bin/vimv
'';
meta = with lib; {
homepage = https://github.com/thameera/vimv;
description = "Batch-rename files using Vim";
license = licenses.mit;
platforms = platforms.linux;
};
}

23
packages/when.nix Normal file
View File

@@ -0,0 +1,23 @@
{ lib, stdenv, perl, which }:
stdenv.mkDerivation {
name = "when";
version = "1.1.40";
src = builtins.fetchTarball {
url = "http://www.lightandmatter.com/when/when.tar.gz";
sha256 = "12d0zmvg66lwzr7q8zky0kz1x3w6q8dvyzm4x7lf1vy2z4pm4cvx";
};
nativeBuildInputs = [ which ];
buildInputs = [ perl ];
installFlags = [ "prefix=$(out)" ];
meta = with lib; {
homepage = "http://www.lightandmatter.com/when/when.html";
description = "An extremely simple personal calendar program";
longDescription = "When is an extremely simple personal calendar program, aimed at the Unix geek who wants something minimalistic.";
license = licenses.gpl2;
platforms = platforms.all;
};
}

View File

@@ -1,5 +1,5 @@
{ pkgs ? import <nixpkgs> { }
, release ? "21.05"
, release ? "21.11"
}:
let
inherit (pkgs) lib;
@@ -15,6 +15,11 @@ let
url = "https://github.com/NixOS/nixpkgs.git";
path = toString .versions/nixpkgs-unstable.json;
};
nix-writers = {
ref = "refs/heads/master";
url = "https://cgit.krebsco.de/nix-writers";
path = toString .versions/nix-writers.json;
};
home-manager = {
ref = "refs/heads/release-${release}";
url = "https://github.com/nix-community/home-manager.git";
@@ -27,7 +32,7 @@ let
};
stockholm = {
ref = "refs/heads/master";
url = "https://cgit.krebsco.de/stockholm";
url = "https://cgit.lassul.us/stockholm";
path = toString .versions/stockholm.json;
};
retiolum = {
@@ -35,11 +40,6 @@ let
url = "https://github.com/krebs/retiolum";
path = toString .versions/retiolum.json;
};
nur = {
ref = "refs/heads/master";
url = "https://github.com/nix-community/NUR";
path = toString .versions/nur.json;
};
nixpkgs-mozilla = {
ref = "refs/heads/master";
url = "https://github.com/mozilla/nixpkgs-mozilla";

View File

@@ -1,13 +1,13 @@
{ config, pkgs, lib, ... }:
let
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
inherit (import <niveum/lib>) retiolumAddresses;
inherit (import ../../lib) retiolumAddresses;
in
{
imports = [
<niveum/configs/default.nix>
<niveum/configs/battery.nix>
<niveum/configs/networkmanager.nix>
../../configs/default.nix
../../configs/battery.nix
../../configs/networkmanager.nix
./hardware-configuration.nix
# <stockholm/krebs/2configs/hw/x220.nix>
];

View File

@@ -1,5 +1,5 @@
{ config, lib, pkgs, ... }: {
imports = [ <nixpkgs/nixos/modules/installer/scan/not-detected.nix> ];
{ config, lib, pkgs, modulesPath, ... }: {
imports = [ "${modulesPath}/installer/scan/not-detected.nix" ];
boot.initrd.availableKernelModules = [ "ehci_pci" "ahci" "xhci_pci" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
@@ -18,7 +18,7 @@
fsType = "vfat";
};
zramSwap.enable = true;
zramSwap.enable = false;
nix.maxJobs = lib.mkDefault 4;
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";

View File

@@ -4,48 +4,6 @@ let
in
{
imports = [
{
systemd.services.praesenzlehre = {
description = "Live Ticker zu praesenzlehre-berlin.org";
wants = [ "network.target" ];
wantedBy = [ "multi-user.target" ];
startAt = "daily";
path = [ pkgs.curl pkgs.pup pkgs.bc ];
environment.BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
script = ''
set -efu
count_file=/tmp/praesenzlehre-berlin.org
set_count() {
echo $* > "$count_file"
}
get_count() {
cat "$count_file"
}
notify() {
curl -sSL -X POST -H 'Content-Type: application/json' \
-d "{\"chat_id\": \"@praesenzlehre_berlin\", \"text\": \"$*\"}" \
"https://api.telegram.org/bot$BOT_TOKEN/sendMessage"
}
test -f "$count_file" || set_count 0
count="$(get_count)"
new_count="$(curl -sSL https://praesenzlehre-berlin.org/ | pup '.dk-speakout-signature-count span text{}' | tr -dc 0-9)"
if [ "$new_count" -gt "$count" ]; then
diff="$(echo "$new_count - $count" | bc)"
echo "$new_count (+ $diff)"
notify "$new_count Unterzeichner:innen! (+ $diff)"
set_count "$new_count"
fi
'';
};
}
./hardware-configuration.nix
<niveum/configs/hedgedoc.nix>
<niveum/configs/spacetime.nix>
@@ -58,12 +16,15 @@ in
<niveum/configs/version.nix>
<niveum/configs/radio>
<niveum/configs/gitea.nix>
<niveum/configs/retiolum-map.nix>
<niveum/configs/names.nix>
<niveum/configs/menstruation.nix>
<niveum/configs/telegram-bots>
<niveum/configs/nix.nix>
<niveum/configs/weechat.nix>
<niveum/configs/urlwatch.nix>
<niveum/configs/matterbridge.nix>
<niveum/configs/tarot.nix>
<niveum/modules/retiolum.nix>
];

Some files were not shown because too many files have changed in this diff Show More