mirror of
https://github.com/kmein/niveum
synced 2026-03-17 10:41:06 +01:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 248ebea28e |
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
file="${1?please supply a poetry file}"
|
|
||||||
[ -f "$file" ] || {
|
|
||||||
echo "'$file' is no file"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
poem="$(mktemp)"
|
|
||||||
clean () {
|
|
||||||
rm "$poem"
|
|
||||||
}
|
|
||||||
trap clean EXIT
|
|
||||||
sed '/^$/d' "$file" > "$poem"
|
|
||||||
|
|
||||||
htmlize() {
|
|
||||||
awk 'ORS="<br/>"' \
|
|
||||||
| head -c -5 # remove final <br/> characters
|
|
||||||
}
|
|
||||||
|
|
||||||
for line_number in $(seq 1 "$(wc -l "$poem" | cut -d' ' -f1)"); do
|
|
||||||
if [ "$line_number" -gt 3 ] && [ "$line_number" -gt 1 ]; then
|
|
||||||
sed -n "$((line_number - 3)),$((line_number - 1))p" "$poem"
|
|
||||||
else
|
|
||||||
sed -n "1,$((line_number - 1))p" "$poem"
|
|
||||||
fi | htmlize
|
|
||||||
printf '\t'
|
|
||||||
sed -n "${line_number},+1p" "$poem" | htmlize
|
|
||||||
printf '\n'
|
|
||||||
done
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ssh mud@hotdog.r -t "MUD_NICKNAME=$LOGNAME mud"
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
import ephem
|
|
||||||
from datetime import datetime, date, timedelta
|
|
||||||
|
|
||||||
now = datetime.now()
|
|
||||||
limit = now + timedelta(days=365)
|
|
||||||
|
|
||||||
|
|
||||||
def events_until(limit):
|
|
||||||
initial_date = ephem.Date(datetime.now())
|
|
||||||
events = {}
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_full_moon(now)
|
|
||||||
events[now] = "🌕"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_new_moon(now)
|
|
||||||
events[now] = "🌑"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_vernal_equinox(now)
|
|
||||||
events[now] = "spring equinox"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_autumnal_equinox(now)
|
|
||||||
events[now] = "fall equinox"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_winter_solstice(now)
|
|
||||||
events[now] = "winter solstice"
|
|
||||||
|
|
||||||
now = initial_date
|
|
||||||
while ephem.localtime(now) <= limit:
|
|
||||||
now = ephem.next_summer_solstice(now)
|
|
||||||
events[now] = "summer solstice"
|
|
||||||
return events
|
|
||||||
|
|
||||||
|
|
||||||
events = events_until(limit)
|
|
||||||
|
|
||||||
|
|
||||||
for date, event in sorted(events.items(), key=lambda x: x[0]):
|
|
||||||
if ephem.localtime(date) < limit:
|
|
||||||
print(ephem.localtime(date), event)
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
project=Filli
|
|
||||||
year=2022
|
|
||||||
|
|
||||||
for month in Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec; do
|
|
||||||
from="$(date +%F -d "$month 1, $year")"
|
|
||||||
to="$(date +%F -d "$month 1, $year + 1 month")"
|
|
||||||
watson report --json --from "$from" --to "$to" --project "$project"
|
|
||||||
done | jq --slurp '
|
|
||||||
def in_array($arr):
|
|
||||||
. as $value | any($arr[]; . == $value);
|
|
||||||
|
|
||||||
map(
|
|
||||||
["engadin-app","fysiweb","val-muestair","mia-engiadina","ol"] as $official_projects
|
|
||||||
| (.timespan.from | .[0:7]) as $timespan
|
|
||||||
| .projects | .[0]
|
|
||||||
| .time as $total_time
|
|
||||||
| .tags
|
|
||||||
| select(. != null)
|
|
||||||
| map(select(.name | in_array($official_projects)))
|
|
||||||
| (map(.time)|add) as $official_time
|
|
||||||
| map({key:.name, value:.time}) | from_entries
|
|
||||||
| .other |= ($total_time - $official_time)
|
|
||||||
| map_values(. / (60*60) | ceil)
|
|
||||||
| .month |= $timespan
|
|
||||||
)
|
|
||||||
'
|
|
||||||
19
.github/workflows/flake.yml
vendored
19
.github/workflows/flake.yml
vendored
@@ -1,19 +0,0 @@
|
|||||||
name: Update flake.lock
|
|
||||||
on:
|
|
||||||
workflow_dispatch: # allows manual triggering
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * 0' # runs weekly on Sunday at 00:00
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lockfile:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
- name: Install Nix
|
|
||||||
uses: cachix/install-nix-action@v16
|
|
||||||
with:
|
|
||||||
extra_nix_config: |
|
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
|
||||||
- name: Update flake.lock
|
|
||||||
uses: DeterminateSystems/update-flake-lock@v3
|
|
||||||
14
.github/workflows/niveum.yml
vendored
14
.github/workflows/niveum.yml
vendored
@@ -1,14 +0,0 @@
|
|||||||
name: CI
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
system: [makanek,manakish,kabsa,zaatar,ful]
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- uses: cachix/install-nix-action@v16
|
|
||||||
- run: nix run .#build-${{matrix.system}}
|
|
||||||
9
.gitmodules
vendored
Normal file
9
.gitmodules
vendored
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
[submodule "submodules/menstruation-telegram"]
|
||||||
|
path = submodules/menstruation-telegram
|
||||||
|
url = https://github.com/kmein/menstruation-telegram
|
||||||
|
[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
|
||||||
11
.versions/home-manager.json
Normal file
11
.versions/home-manager.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "https://github.com/nix-community/home-manager.git",
|
||||||
|
"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
|
||||||
|
}
|
||||||
11
.versions/krops.json
Normal file
11
.versions/krops.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "https://cgit.krebsco.de/krops",
|
||||||
|
"rev": "cccebf3ff7a53336b3f106cb96dddd5892d427ed",
|
||||||
|
"date": "2021-03-23T22:47:37+01:00",
|
||||||
|
"path": "/nix/store/mz13xxnil35lwsf90hwnrm2agir7hb51-krops",
|
||||||
|
"sha256": "07mg3iaqjf1w49vmwfchi7b1w55bh7rvsbgicp2m47gnj9alwdb6",
|
||||||
|
"fetchLFS": false,
|
||||||
|
"fetchSubmodules": false,
|
||||||
|
"deepClone": false,
|
||||||
|
"leaveDotGit": false
|
||||||
|
}
|
||||||
11
.versions/nix-writers.json
Normal file
11
.versions/nix-writers.json
Normal 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
|
||||||
|
}
|
||||||
11
.versions/nixpkgs-mozilla.json
Normal file
11
.versions/nixpkgs-mozilla.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "https://github.com/mozilla/nixpkgs-mozilla",
|
||||||
|
"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
|
||||||
|
}
|
||||||
11
.versions/nixpkgs-unstable.json
Normal file
11
.versions/nixpkgs-unstable.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs.git",
|
||||||
|
"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
|
||||||
|
}
|
||||||
11
.versions/nixpkgs.json
Normal file
11
.versions/nixpkgs.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "https://github.com/NixOS/nixpkgs.git",
|
||||||
|
"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
|
||||||
|
}
|
||||||
11
.versions/retiolum.json
Normal file
11
.versions/retiolum.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"url": "https://github.com/krebs/retiolum",
|
||||||
|
"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
|
||||||
|
}
|
||||||
11
.versions/stockholm.json
Normal file
11
.versions/stockholm.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"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
|
||||||
|
}
|
||||||
94
ci.nix
94
ci.nix
@@ -1,94 +0,0 @@
|
|||||||
{
|
|
||||||
inputs,
|
|
||||||
system,
|
|
||||||
name,
|
|
||||||
}: let
|
|
||||||
nixpkgs = inputs.nixos-stable;
|
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
|
||||||
ensureFiles = paths:
|
|
||||||
pkgs.runCommand "directory" {} ''
|
|
||||||
set -efu
|
|
||||||
mkdir $out
|
|
||||||
cd $out
|
|
||||||
${
|
|
||||||
nixpkgs.lib.concatMapStringsSep "\n" (path: ''
|
|
||||||
mkdir -p "$(dirname ${nixpkgs.lib.escapeShellArg path})"
|
|
||||||
echo foo > ${nixpkgs.lib.escapeShellArg path}
|
|
||||||
'')
|
|
||||||
paths
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
nixPath = nixpkgs.lib.concatStringsSep ":" ([
|
|
||||||
"niveum=${toString ./.}"
|
|
||||||
"nixos-config=${toString ./.}/systems/${name}/configuration.nix"
|
|
||||||
"system-secrets=${systemSecrets}"
|
|
||||||
"secrets=${sharedSecrets}"
|
|
||||||
"nixpkgs=${
|
|
||||||
toString (
|
|
||||||
if name == "kabsa" || name == "manakish"
|
|
||||||
then inputs.nixos-unstable
|
|
||||||
else inputs.nixos-stable
|
|
||||||
)
|
|
||||||
}"
|
|
||||||
]
|
|
||||||
++ nixpkgs.lib.mapAttrsToList (name: value: "${name}=${value}") inputs);
|
|
||||||
# cd ~/.password-store/shared && find * -type f | sed 's/.gpg$//'
|
|
||||||
sharedSecrets = ensureFiles [
|
|
||||||
"di.fm/key"
|
|
||||||
"eduroam/identity"
|
|
||||||
"eduroam/password"
|
|
||||||
"github/notification.token"
|
|
||||||
"hass/token"
|
|
||||||
"mail/cock"
|
|
||||||
"mail/fastmail"
|
|
||||||
"mail/gmail/amroplay"
|
|
||||||
"mail/gmail/kieran.meinhardt"
|
|
||||||
"mail/meinhaki"
|
|
||||||
"mail/dslalewa"
|
|
||||||
"mail/posteo"
|
|
||||||
"nextcloud-fysi/password"
|
|
||||||
"nextcloud/password"
|
|
||||||
"openweathermap.key"
|
|
||||||
"restic/password"
|
|
||||||
"traadfri.key"
|
|
||||||
"wifi/Aether.psk"
|
|
||||||
"spotify/username"
|
|
||||||
"spotify/password"
|
|
||||||
];
|
|
||||||
systemSecrets = let
|
|
||||||
basic = ["retiolum.ed25519" "retiolum.key" "syncthing/cert.pem" "syncthing/key.pem"];
|
|
||||||
in
|
|
||||||
{
|
|
||||||
zaatar = ensureFiles (["moodle.token" "telegram/moodle-dl.token" "mpd-web.key"] ++ basic);
|
|
||||||
kabsa = ensureFiles basic;
|
|
||||||
manakish = ensureFiles basic;
|
|
||||||
tahina = ensureFiles basic;
|
|
||||||
ful = ensureFiles (["root.password"] ++ basic);
|
|
||||||
makanek = ensureFiles ([
|
|
||||||
"irc/retiolum"
|
|
||||||
"irc/hackint"
|
|
||||||
"irc/libera"
|
|
||||||
"irc/oftc"
|
|
||||||
"matrix/nibbana"
|
|
||||||
"maxmind/license.key"
|
|
||||||
"moodle-dl/faye.token"
|
|
||||||
"nextcloud/admin"
|
|
||||||
"nextcloud/database"
|
|
||||||
"telegram/nachtischsatan.token"
|
|
||||||
"telegram/reverse.token"
|
|
||||||
"telegram/odyssey.token"
|
|
||||||
"telegram/betacode.token"
|
|
||||||
"telegram/moodle-dl.token"
|
|
||||||
"telegram/proverb.token"
|
|
||||||
"telegram/menstruation.token"
|
|
||||||
"telegram/cool_village.token"
|
|
||||||
"telegram/kmein.token"
|
|
||||||
"telegram/krebs.token"
|
|
||||||
"telegram/prometheus.token"
|
|
||||||
"weechat/relay"
|
|
||||||
]
|
|
||||||
++ basic);
|
|
||||||
}
|
|
||||||
.${name};
|
|
||||||
in
|
|
||||||
toString (pkgs.writers.writeDash "build" "NIX_PATH=${nixPath} nix-build '<nixpkgs/nixos>' -A system --dry-run")
|
|
||||||
@@ -1,17 +1,28 @@
|
|||||||
|
{ pkgs, lib, config, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
environment.variables.TERMINAL = "alacritty";
|
||||||
lib,
|
|
||||||
config,
|
environment.systemPackages = [
|
||||||
...
|
pkgs.alacritty
|
||||||
}: let
|
];
|
||||||
alacritty-cfg = theme:
|
|
||||||
(pkgs.formats.yaml {}).generate "alacritty.yml" {
|
home-manager.users.me.xdg.configFile =
|
||||||
window.opacity = 0.95;
|
let
|
||||||
|
inherit (import <niveum/lib>) colours;
|
||||||
|
colourNames = [ "black" "red" "green" "yellow" "blue" "magenta" "cyan" "white" ];
|
||||||
|
colourPairs = lib.getAttrs colourNames colours;
|
||||||
|
in {
|
||||||
|
"alacritty/alacritty.yml".source = (pkgs.formats.yaml {}).generate "alacritty.yml" {
|
||||||
|
background_opacity = 0.9;
|
||||||
|
colors = {
|
||||||
|
primary = { inherit (colours) background foreground; };
|
||||||
|
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
||||||
|
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
||||||
|
};
|
||||||
font = {
|
font = {
|
||||||
normal.family = "Monospace";
|
normal.family = "Monospace";
|
||||||
size = 6;
|
size = 6;
|
||||||
};
|
};
|
||||||
live_config_reload = true;
|
|
||||||
key_bindings = [
|
key_bindings = [
|
||||||
{
|
{
|
||||||
key = "Plus";
|
key = "Plus";
|
||||||
@@ -29,34 +40,6 @@
|
|||||||
action = "ResetFontSize";
|
action = "ResetFontSize";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
colors = let
|
|
||||||
colourNames = ["black" "red" "green" "yellow" "blue" "magenta" "cyan" "white"];
|
|
||||||
colourPairs = lib.getAttrs colourNames theme;
|
|
||||||
in {
|
|
||||||
primary = {inherit (theme) background foreground;};
|
|
||||||
cursor = {inherit (theme) cursor;};
|
|
||||||
normal = lib.mapAttrs (_: colour: colour.dark) colourPairs;
|
|
||||||
bright = lib.mapAttrs (_: colour: colour.bright) colourPairs;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
alacritty-pkg = pkgs.symlinkJoin {
|
|
||||||
name = "alacritty";
|
|
||||||
paths = [
|
|
||||||
(pkgs.writeDashBin "alacritty" ''
|
|
||||||
${pkgs.alacritty}/bin/alacritty --config-file /var/theme/config/alacritty.yml "$@"
|
|
||||||
'')
|
|
||||||
pkgs.alacritty
|
|
||||||
];
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
environment.variables.TERMINAL = "alacritty";
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
alacritty-pkg
|
|
||||||
];
|
|
||||||
|
|
||||||
environment.etc = {
|
|
||||||
"themes/dark/alacritty.yml".source = alacritty-cfg (import <niveum/lib/colours/ayu-dark.nix>);
|
|
||||||
"themes/light/alacritty.yml".source = alacritty-cfg (import <niveum/lib/colours/ayu-light.nix>);
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) restic;
|
|
||||||
in {
|
|
||||||
services.restic.backups.niveum = {
|
|
||||||
initialize = true;
|
|
||||||
inherit (restic) repository;
|
|
||||||
timerConfig = {
|
|
||||||
OnCalendar = "8:00";
|
|
||||||
RandomizedDelaySec = "1h";
|
|
||||||
};
|
|
||||||
passwordFile = toString <secrets/restic/password>;
|
|
||||||
extraBackupArgs = [
|
|
||||||
"--exclude=/home/kfm/projects/nixpkgs/.git"
|
|
||||||
"--exclude=node_modules"
|
|
||||||
];
|
|
||||||
paths = [
|
|
||||||
"/home/kfm/work"
|
|
||||||
"/home/kfm/projects"
|
|
||||||
"/home/kfm/cloud"
|
|
||||||
"/home/kfm/.gnupg"
|
|
||||||
"/home/kfm/.ssh"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.restic-backups-niveum.serviceConfig = {
|
|
||||||
Restart = "on-failure";
|
|
||||||
RestartSec = "15s";
|
|
||||||
StartLimitIntervalSec = "1m"; # don't try more than 4 times
|
|
||||||
StartLimitBurst = 4;
|
|
||||||
};
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
(pkgs.writers.writeDashBin "restic-niveum" ''
|
|
||||||
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} "$@"
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "restic-mount" ''
|
|
||||||
mountdir=$(mktemp -d)
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm -r "$mountdir"
|
|
||||||
}
|
|
||||||
${pkgs.restic}/bin/restic -r ${restic.repository} -p ${<secrets/restic/password>} mount "$mountdir"
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@@ -1,14 +1,11 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
boot.extraModulePackages = with config.boot.kernelPackages; [
|
boot.extraModulePackages = with config.boot.kernelPackages; [
|
||||||
tp_smapi
|
tp_smapi
|
||||||
acpi_call
|
acpi_call
|
||||||
];
|
];
|
||||||
boot.kernelModules = ["tp_smapi" "acpi_call"];
|
boot.kernelModules = [ "tp_smapi" "acpi_call" ];
|
||||||
environment.systemPackages = [pkgs.tpacpi-bat pkgs.powertop];
|
environment.systemPackages = [ pkgs.tpacpi-bat ];
|
||||||
|
|
||||||
services.tlp = {
|
services.tlp = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,14 +1,11 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
{
|
{
|
||||||
lib,
|
environment.systemPackages = [ pkgs.beets ];
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
environment.systemPackages = [pkgs.beets];
|
|
||||||
home-manager.users.me.xdg.configFile = {
|
home-manager.users.me.xdg.configFile = {
|
||||||
"beets/config.yaml".source = (pkgs.formats.yaml {}).generate "config.yaml" {
|
"beets/config.yaml".source = (pkgs.formats.yaml {}).generate "config.yaml" {
|
||||||
directory = "~/cloud/syncthing/music";
|
directory = "~/cloud/syncthing/music";
|
||||||
library = "~/cloud/syncthing/common/music.db";
|
library = "~/cloud/syncthing/common/music.db";
|
||||||
plugins = toString ["fetchart" "lastgenre"];
|
plugins = toString [ "fetchart" "lastgenre" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,11 @@
|
|||||||
{
|
{ pkgs, lib, ... }: {
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings.General.Enable =
|
settings.General.Enable =
|
||||||
lib.concatStringsSep "," ["Source" "Sink" "Media" "Socket"];
|
lib.concatStringsSep "," [ "Source" "Sink" "Media" "Socket" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.blueman.enable = true;
|
environment.systemPackages = [ pkgs.blueman ];
|
||||||
|
|
||||||
# environment.systemPackages = [pkgs.blueman];
|
home-manager.users.me = { services.blueman-applet.enable = false; };
|
||||||
|
|
||||||
home-manager.users.me = {services.blueman-applet.enable = true;};
|
|
||||||
}
|
}
|
||||||
|
|||||||
57
configs/bvg.nix
Normal file
57
configs/bvg.nix
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (import <niveum/lib>) serveHtml;
|
||||||
|
stations = [
|
||||||
|
900068204 # A/M
|
||||||
|
900068302 # KAS
|
||||||
|
900068203 # B-P
|
||||||
|
];
|
||||||
|
fahrplan = pkgs.writeText "fahrplan.html" ''
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<title>Fahrplan</title>
|
||||||
|
<link
|
||||||
|
rel="icon"
|
||||||
|
type="image/x-icon"
|
||||||
|
href="https://mobil.bvg.de/Fahrinfo/img/ua_xhtml/logo.gif"
|
||||||
|
/>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
--bvg-yellow: #f0d722;
|
||||||
|
}
|
||||||
|
#fahrplan {
|
||||||
|
display: flex;
|
||||||
|
height: 100vh;
|
||||||
|
width: 100%;
|
||||||
|
flex-direction: row;
|
||||||
|
}
|
||||||
|
#fahrplan iframe {
|
||||||
|
flex-grow: 1;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
#fahrplan iframe + iframe {
|
||||||
|
border-left: 2px solid var(--bvg-yellow);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<body>
|
||||||
|
<div id="fahrplan">
|
||||||
|
${lib.concatMapStrings (station: ''
|
||||||
|
<iframe scrolling="no" src="https://mobil.bvg.de/Fahrinfo/bin/stboard.bin/dox?ld=0.1&input=${toString station}&boardType=depRT&start=yes"></iframe>
|
||||||
|
'') stations}
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."bvg.kmein.r" = {
|
||||||
|
locations."/".extraConfig = serveHtml fahrplan pkgs;
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{pkgs, ...}:
|
{ pkgs, ... }:
|
||||||
# https://paste.sr.ht/~erictapen/11716989e489b600f237041b6d657fdf0ee17b34
|
# https://paste.sr.ht/~erictapen/11716989e489b600f237041b6d657fdf0ee17b34
|
||||||
let
|
let
|
||||||
certificate = pkgs.stdenv.mkDerivation rec {
|
certificate = pkgs.stdenv.mkDerivation rec {
|
||||||
@@ -7,7 +7,7 @@ let
|
|||||||
1,/DST Root CA X3/d
|
1,/DST Root CA X3/d
|
||||||
1,/-----END CERTIFICATE-----/p
|
1,/-----END CERTIFICATE-----/p
|
||||||
'';
|
'';
|
||||||
nativeBuildInputs = with pkgs; [cacert gnused];
|
nativeBuildInputs = with pkgs; [ cacert gnused ];
|
||||||
phases = "installPhase";
|
phases = "installPhase";
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
${pkgs.gnused}/bin/sed -n -f $src ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt > $out
|
${pkgs.gnused}/bin/sed -n -f $src ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt > $out
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }: {
|
||||||
programs.chromium = {
|
programs.chromium = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extensions = [
|
extensions = [
|
||||||
|
"nngceckbapebfimnlniiiahkandclblb" # BitWarden
|
||||||
# "ihlenndgcmojhcghmfjfneahoeklbjjh" # cVim
|
# "ihlenndgcmojhcghmfjfneahoeklbjjh" # cVim
|
||||||
# "fpnmgdkabkmnadcjpehmlllkndpkmiak" # Wayback Machine
|
# "fpnmgdkabkmnadcjpehmlllkndpkmiak" # Wayback Machine
|
||||||
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
|
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
|
||||||
"pjjgklgkfeoeiebjogplpnibpfnffkng" # undistracted
|
"khncfooichmfjbepaaaebmommgaepoid" # Remove YouTube Recommended Videos
|
||||||
"nhdogjmejiglipccpnnnanhbledajbpd" # vuejs devtools
|
|
||||||
"eimadpbcbfnmbkopoojfekhnkhdbieeh" # dark reader
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.brave];
|
environment.systemPackages = [ pkgs.chromium pkgs.brave ];
|
||||||
|
|
||||||
environment.variables.BROWSER = "brave";
|
environment.variables.BROWSER = "brave";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,58 +1,12 @@
|
|||||||
{
|
{ config, lib, pkgs, ... }: {
|
||||||
config,
|
system.activationScripts.home-symlinks = ''
|
||||||
lib,
|
ln -sfn ${config.users.users.me.home}/cloud/syncthing/common/mahlzeit ${config.users.users.me.home}/mahlzeit
|
||||||
pkgs,
|
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Wiki ${config.users.users.me.home}/notes
|
||||||
...
|
ln -sfn ${config.users.users.me.home}/cloud/Seafile/Uni ${config.users.users.me.home}/uni
|
||||||
}: let
|
'';
|
||||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
|
||||||
in {
|
|
||||||
imports = [
|
|
||||||
<niveum/modules/dropbox.nix>
|
|
||||||
];
|
|
||||||
|
|
||||||
niveum = {
|
|
||||||
dropbox.enable = false;
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.tmpfiles.rules = map tmpfilesConfig [
|
|
||||||
{
|
|
||||||
type = "L+";
|
|
||||||
user = config.users.users.me.name;
|
|
||||||
group = "users";
|
|
||||||
mode = "0755";
|
|
||||||
argument = "${config.users.users.me.home}/cloud/Seafile/Wiki";
|
|
||||||
path = "${config.users.users.me.home}/notes";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "L+";
|
|
||||||
user = config.users.users.me.name;
|
|
||||||
group = "users";
|
|
||||||
mode = "0755";
|
|
||||||
argument = "${config.users.users.me.home}/cloud/Seafile/Uni";
|
|
||||||
path = "${config.users.users.me.home}/uni";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
type = "L+";
|
|
||||||
user = config.users.users.me.name;
|
|
||||||
group = "users";
|
|
||||||
mode = "0755";
|
|
||||||
argument = "${config.users.users.me.home}/cloud/syncthing/common/mahlzeit";
|
|
||||||
path = "${config.users.users.me.home}/mahlzeit";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
services.gnome-keyring.enable = true;
|
services.nextcloud-client.enable = true;
|
||||||
services.nextcloud-client = {
|
|
||||||
enable = true;
|
|
||||||
startInBackground = true;
|
|
||||||
};
|
|
||||||
systemd.user.services.nextcloud-client = {
|
|
||||||
Unit = {
|
|
||||||
Wants = ["gnome-keyring.service"];
|
|
||||||
After = ["gnome-keyring.service"];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
@@ -84,15 +38,15 @@ in {
|
|||||||
dataDir = "/home/kfm/.config/syncthing";
|
dataDir = "/home/kfm/.config/syncthing";
|
||||||
cert = toString <system-secrets/syncthing/cert.pem>;
|
cert = toString <system-secrets/syncthing/cert.pem>;
|
||||||
key = toString <system-secrets/syncthing/key.pem>;
|
key = toString <system-secrets/syncthing/key.pem>;
|
||||||
inherit ((import <niveum/lib>).syncthing) devices;
|
inherit ((import ../lib).syncthing) devices;
|
||||||
folders = let
|
folders =
|
||||||
cloud-dir = "${config.users.users.me.home}/cloud";
|
let cloud-dir = "${config.users.users.me.home}/cloud";
|
||||||
in {
|
in {
|
||||||
"${cloud-dir}/syncthing/common".devices = ["kabsa" "manakish"];
|
"${cloud-dir}/syncthing/common".devices = [ "kabsa" "manakish" ];
|
||||||
"${cloud-dir}/syncthing/library".devices = ["kabsa" "manakish" "heym"];
|
"${cloud-dir}/syncthing/library".devices = [ "kabsa" "manakish" "heym" ];
|
||||||
"${cloud-dir}/syncthing/mundoiu".devices = ["kabsa" "manakish" "heym"];
|
"${cloud-dir}/syncthing/mundoiu".devices = [ "kabsa" "manakish" "heym" ];
|
||||||
"${cloud-dir}/syncthing/music" = {
|
"${cloud-dir}/syncthing/music" = {
|
||||||
devices = ["kabsa" "manakish" "heym" "zaatar"];
|
devices = [ "kabsa" "manakish" "heym" "zaatar" ];
|
||||||
id = "music";
|
id = "music";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
copyqConfig = pkgs.writers.writeDash "copyq-config" ''
|
copyqConfig = pkgs.writers.writeDash "copyq-config" ''
|
||||||
${pkgs.copyq}/bin/copyq config check_clipboard true
|
${pkgs.copyq}/bin/copyq config check_clipboard true
|
||||||
${pkgs.copyq}/bin/copyq config check_selection false
|
${pkgs.copyq}/bin/copyq config check_selection false
|
||||||
@@ -21,10 +18,10 @@
|
|||||||
${pkgs.copyq}/bin/copyq config text_wrap true
|
${pkgs.copyq}/bin/copyq config text_wrap true
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = [pkgs.copyq];
|
environment.systemPackages = [ pkgs.copyq ];
|
||||||
|
|
||||||
systemd.user.services.copyq = {
|
systemd.user.services.copyq = {
|
||||||
wantedBy = ["graphical-session.target"];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
environment = {
|
environment = {
|
||||||
DISPLAY = ":${toString config.services.xserver.display}";
|
DISPLAY = ":${toString config.services.xserver.display}";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,18 +1,12 @@
|
|||||||
{
|
{ pkgs, lib, config, options, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
options,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.strings) makeBinPath;
|
inherit (lib.strings) makeBinPath;
|
||||||
inherit (import <niveum/lib>) localAddresses kieran;
|
inherit (import ../lib) localAddresses kieran;
|
||||||
in {
|
in {
|
||||||
imports = [
|
imports = [
|
||||||
<home-manager/nixos>
|
../modules/system-dependent.nix
|
||||||
<niveum/modules/system-dependent.nix>
|
|
||||||
{
|
{
|
||||||
boot.supportedFilesystems = ["ntfs"];
|
boot.supportedFilesystems = [ "ntfs" ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
nix.nixPath = [
|
nix.nixPath = [
|
||||||
@@ -25,25 +19,16 @@ in {
|
|||||||
config = {
|
config = {
|
||||||
allowUnfree = true;
|
allowUnfree = true;
|
||||||
packageOverrides = pkgs: {
|
packageOverrides = pkgs: {
|
||||||
dmenu = pkgs.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
|
writeDashBin = pkgs.writers.writeDashBin;
|
||||||
|
writeDash = pkgs.writers.writeDash;
|
||||||
gfs-fonts = pkgs.callPackage <niveum/packages/gfs-fonts.nix> {};
|
gfs-fonts = pkgs.callPackage <niveum/packages/gfs-fonts.nix> {};
|
||||||
tocharian-font = pkgs.callPackage <niveum/packages/tocharian-font.nix> {};
|
iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> { };
|
||||||
iolanguage = pkgs.callPackage <niveum/packages/iolanguage.nix> {};
|
ix = pkgs.callPackage <niveum/packages/ix.nix> { };
|
||||||
ix = pkgs.callPackage <niveum/packages/ix.nix> {};
|
|
||||||
rofi-pass = pkgs.rofi-pass.overrideAttrs (final: previous: {
|
|
||||||
patches = [
|
|
||||||
# password store androi
|
|
||||||
<niveum/packages/rofi-pass.patch>
|
|
||||||
];
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
overlays = [
|
overlays = [
|
||||||
(self: super: {
|
(self: super: {
|
||||||
scripts = import <niveum/packages/scripts> {
|
scripts = import ../packages/scripts { pkgs = super; lib = super.lib; };
|
||||||
pkgs = super;
|
|
||||||
lib = super.lib;
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
@@ -58,7 +43,6 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
options = {
|
options = {
|
||||||
selection-clipboard = "clipboard";
|
selection-clipboard = "clipboard";
|
||||||
recolor-keephue = true;
|
|
||||||
# first-page-column = "1:1"; # makes side-by-side mode start on the left side
|
# first-page-column = "1:1"; # makes side-by-side mode start on the left side
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -72,7 +56,8 @@ in {
|
|||||||
users.users.me = {
|
users.users.me = {
|
||||||
name = "kfm";
|
name = "kfm";
|
||||||
description = kieran.name;
|
description = kieran.name;
|
||||||
hashedPassword = "$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/";
|
hashedPassword =
|
||||||
|
"$6$w9hXyGFl/.IZBXk$5OiWzS1G.5hImhh1YQmZiCXYNAJhi3X6Y3uSLupJNYYXPLMsQpx2fwF4Xr2uYzGMV8Foqh8TgUavx1APD9rcb/";
|
||||||
isNormalUser = true;
|
isNormalUser = true;
|
||||||
uid = 1000;
|
uid = 1000;
|
||||||
};
|
};
|
||||||
@@ -86,27 +71,27 @@ in {
|
|||||||
hardware.pulseaudio = {
|
hardware.pulseaudio = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.pulseaudioFull;
|
package = pkgs.pulseaudioFull;
|
||||||
|
extraModules = [ pkgs.pulseaudio-modules-bt ];
|
||||||
# copy server:/run/pulse/.config/pulse/cookie to client:~/.config/pulse/cookie to authenticate a client machine
|
# copy server:/run/pulse/.config/pulse/cookie to client:~/.config/pulse/cookie to authenticate a client machine
|
||||||
zeroconf.discovery.enable = true;
|
zeroconf.discovery.enable = true;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
load-module ${
|
load-module ${toString [
|
||||||
toString [
|
|
||||||
"module-tunnel-sink-new"
|
"module-tunnel-sink-new"
|
||||||
"server=zaatar.r"
|
"server=zaatar.r"
|
||||||
"sink_name=zaatar"
|
"sink_name=zaatar"
|
||||||
"channels=2"
|
"channels=2"
|
||||||
"rate=44100"
|
"rate=44100"
|
||||||
]
|
]}
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.me.extraGroups = ["audio"];
|
users.users.me.extraGroups = [ "audio" ];
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.pavucontrol pkgs.ncpamixer pkgs.pamixer pkgs.pulsemixer];
|
environment.systemPackages = [ pkgs.pavucontrol pkgs.ncpamixer pkgs.pamixer pkgs.pulsemixer ];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
environment.interactiveShellInit = "export PATH=$PATH:$HOME/projects/niveum";
|
environment.interactiveShellInit =
|
||||||
|
"export PATH=$PATH:$HOME/projects/niveum";
|
||||||
environment.shellAliases = let
|
environment.shellAliases = let
|
||||||
wcd = pkgs.writers.writeDash "wcd" ''
|
wcd = pkgs.writers.writeDash "wcd" ''
|
||||||
cd "$(readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname)/.."
|
cd "$(readlink "$(${pkgs.which}/bin/which --skip-alias "$1")" | xargs dirname)/.."
|
||||||
@@ -117,15 +102,12 @@ in {
|
|||||||
take = pkgs.writers.writeDash "take" ''
|
take = pkgs.writers.writeDash "take" ''
|
||||||
mkdir "$1" && cd "$1"
|
mkdir "$1" && cd "$1"
|
||||||
'';
|
'';
|
||||||
cdt = pkgs.writers.writeDash "cdt" ''
|
|
||||||
cd "$(mktemp -d)"
|
|
||||||
pwd
|
|
||||||
'';
|
|
||||||
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
|
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
|
||||||
in {
|
in {
|
||||||
"ß" = "${pkgs.utillinux}/bin/setsid";
|
"ß" = "${pkgs.utillinux}/bin/setsid";
|
||||||
cat = "${pkgs.bat}/bin/bat --style=plain";
|
cat = "${pkgs.bat}/bin/bat --style=plain";
|
||||||
chromium-incognito = "chromium --user-data-dir=$(mktemp -d /tmp/chr.XXXXXX) --no-first-run --incognito";
|
chromium-incognito =
|
||||||
|
"chromium --user-data-dir=$(mktemp -d /tmp/chr.XXXXXX) --no-first-run --incognito";
|
||||||
cp = "cp --interactive";
|
cp = "cp --interactive";
|
||||||
ip = "${pkgs.iproute}/bin/ip -c";
|
ip = "${pkgs.iproute}/bin/ip -c";
|
||||||
l = "ls --color=auto --time-style=long-iso --almost-all";
|
l = "ls --color=auto --time-style=long-iso --almost-all";
|
||||||
@@ -141,25 +123,20 @@ in {
|
|||||||
rm = "rm --interactive";
|
rm = "rm --interactive";
|
||||||
s = "${pkgs.systemd}/bin/systemctl";
|
s = "${pkgs.systemd}/bin/systemctl";
|
||||||
take = "source ${take}";
|
take = "source ${take}";
|
||||||
cdt = "source ${cdt}";
|
|
||||||
vit = "$EDITOR $(mktemp)";
|
|
||||||
tmux = "${pkgs.tmux}/bin/tmux -2";
|
tmux = "${pkgs.tmux}/bin/tmux -2";
|
||||||
sxiv = swallow "${pkgs.nsxiv}/bin/nsxiv";
|
sxiv = swallow "${pkgs.sxiv}/bin/sxiv";
|
||||||
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
zathura = swallow "${pkgs.zathura}/bin/zathura";
|
||||||
us = "${pkgs.systemd}/bin/systemctl --user";
|
us = "${pkgs.systemd}/bin/systemctl --user";
|
||||||
wcd = "source ${wcd}";
|
wcd = "source ${wcd}";
|
||||||
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
|
im = "${pkgs.openssh}/bin/ssh weechat@makanek -t tmux attach-session -t IM";
|
||||||
where = "source ${where}";
|
where = "source ${where}";
|
||||||
yt = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -ic"; # Download video link
|
yt =
|
||||||
yta = "${pkgs.yt-dlp}/bin/yt-dlp --add-metadata -xic"; # Download with audio
|
"${pkgs.youtube-dl}/bin/youtube-dl --add-metadata -ic"; # Download video link
|
||||||
};
|
yta =
|
||||||
}
|
"${pkgs.youtube-dl}/bin/youtube-dl --add-metadata -xic"; # Download with audio
|
||||||
{
|
|
||||||
i18n = {
|
|
||||||
defaultLocale = "en_DK.UTF-8";
|
|
||||||
supportedLocales = ["all"];
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
{ i18n.defaultLocale = "en_GB.UTF-8"; }
|
||||||
{
|
{
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -172,7 +149,7 @@ in {
|
|||||||
enable = true;
|
enable = true;
|
||||||
greeters.gtk = {
|
greeters.gtk = {
|
||||||
enable = true;
|
enable = true;
|
||||||
indicators = ["~spacer" "~host" "~spacer" "~session" "~power"];
|
indicators = [ "~spacer" "~host" "~spacer" "~session" "~power" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -181,26 +158,24 @@ in {
|
|||||||
{
|
{
|
||||||
security.wrappers = {
|
security.wrappers = {
|
||||||
pmount = {
|
pmount = {
|
||||||
setuid = true;
|
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "users";
|
||||||
source = "${pkgs.pmount}/bin/pmount";
|
source = "${pkgs.pmount}/bin/pmount";
|
||||||
};
|
};
|
||||||
pumount = {
|
pumount = {
|
||||||
setuid = true;
|
|
||||||
owner = "root";
|
owner = "root";
|
||||||
group = "root";
|
group = "users";
|
||||||
source = "${pkgs.pmount}/bin/pumount";
|
source = "${pkgs.pmount}/bin/pumount";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{programs.command-not-found.enable = true;}
|
{ programs.command-not-found.enable = true; }
|
||||||
{
|
{
|
||||||
programs.gnupg.agent.enable = true;
|
programs.gnupg.agent.enable = true;
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.gnupg
|
pkgs.gnupg
|
||||||
(pkgs.pass.withExtensions (e: [e.pass-otp e.pass-import e.pass-genphrase]))
|
(pkgs.pass.withExtensions (e: [e.pass-otp]))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
@@ -213,34 +188,29 @@ in {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
networking.hosts =
|
networking.hosts = lib.mapAttrs' (name: address: {
|
||||||
lib.mapAttrs' (name: address: {
|
|
||||||
name = address;
|
name = address;
|
||||||
value = ["${name}.local"];
|
value = [ "${name}.local" ];
|
||||||
})
|
}) localAddresses;
|
||||||
localAddresses;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
home-manager.users.me.home.stateVersion = "22.05";
|
|
||||||
}
|
}
|
||||||
./alacritty.nix
|
./alacritty.nix
|
||||||
./backup.nix
|
|
||||||
./bash.nix
|
./bash.nix
|
||||||
./beets.nix
|
./beets.nix
|
||||||
./bluetooth.nix
|
./bluetooth.nix
|
||||||
./ccc.nix
|
./ccc.nix
|
||||||
|
# ./kleiter.nix
|
||||||
./khal.nix
|
./khal.nix
|
||||||
./chromium.nix
|
./chromium.nix
|
||||||
./cloud.nix
|
./cloud.nix
|
||||||
./copyq.nix
|
./copyq.nix
|
||||||
./compton.nix
|
./compton.nix
|
||||||
./direnv.nix
|
./direnv.nix
|
||||||
./distrobump.nix
|
|
||||||
./docker.nix
|
./docker.nix
|
||||||
./dunst.nix
|
./dunst.nix
|
||||||
./flix.nix
|
./flix.nix
|
||||||
./fonts.nix
|
./fonts.nix
|
||||||
./fzf.nix
|
./fzf.nix
|
||||||
|
./gaslight.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./hledger.nix
|
./hledger.nix
|
||||||
./htop.nix
|
./htop.nix
|
||||||
@@ -250,18 +220,16 @@ in {
|
|||||||
./lb.nix
|
./lb.nix
|
||||||
./mpv.nix
|
./mpv.nix
|
||||||
./mime.nix
|
./mime.nix
|
||||||
|
./nano.nix
|
||||||
./neovim.nix
|
./neovim.nix
|
||||||
./neomutt.nix
|
./neomutt.nix
|
||||||
./nix.nix
|
|
||||||
./newsboat.nix
|
./newsboat.nix
|
||||||
./flameshot-once.nix
|
./flameshot-once.nix
|
||||||
./packages.nix
|
./packages
|
||||||
./stardict.nix
|
# ./power-action.nix
|
||||||
./polkit.nix
|
|
||||||
./power-action.nix
|
|
||||||
./printing.nix
|
./printing.nix
|
||||||
# ./openweathermap.nix
|
./openweathermap.nix
|
||||||
./wallpaper.nix
|
# ./wallpaper.nix
|
||||||
./redshift.nix
|
./redshift.nix
|
||||||
./retiolum.nix
|
./retiolum.nix
|
||||||
./rofi.nix
|
./rofi.nix
|
||||||
@@ -270,14 +238,15 @@ in {
|
|||||||
./ssh.nix
|
./ssh.nix
|
||||||
./sshd.nix
|
./sshd.nix
|
||||||
./sudo.nix
|
./sudo.nix
|
||||||
./nsxiv.nix
|
./sxiv.nix
|
||||||
./themes.nix
|
./theming.nix
|
||||||
./tmux.nix
|
./tmux.nix
|
||||||
|
# ./tor.nix
|
||||||
./traadfri.nix
|
./traadfri.nix
|
||||||
./unclutter.nix
|
./unclutter.nix
|
||||||
|
./version.nix
|
||||||
./vscode.nix
|
./vscode.nix
|
||||||
./watson.nix
|
./watson.nix
|
||||||
./zsh.nix
|
./zsh.nix
|
||||||
./tor.nix
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
|
let
|
||||||
nixify = pkgs.writers.writeDashBin "nixify" ''
|
nixify = pkgs.writers.writeDashBin "nixify" ''
|
||||||
set -efuC
|
set -efuC
|
||||||
|
|
||||||
@@ -17,18 +18,18 @@
|
|||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
environment.systemPackages = [pkgs.direnv nixify];
|
environment.systemPackages = [ pkgs.direnv nixify ];
|
||||||
|
|
||||||
home-manager.users.me.programs.direnv = {
|
home-manager.users.me.programs.direnv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
stdlib = builtins.readFile "${
|
stdlib = builtins.readFile ("${
|
||||||
pkgs.fetchFromGitHub {
|
pkgs.fetchFromGitHub {
|
||||||
owner = "Mic92";
|
owner = "Mic92";
|
||||||
repo = "dotfiles";
|
repo = "dotfiles";
|
||||||
rev = "a0a9b7e358fa70a85cd468f8ca1fbb02ae0a91df";
|
rev = "a0a9b7e358fa70a85cd468f8ca1fbb02ae0a91df";
|
||||||
sha256 = "1y9h5s1lf59sczsm0ksq2x1yhl98ba9lwk5yil3q53rg7n4574pg";
|
sha256 = "1y9h5s1lf59sczsm0ksq2x1yhl98ba9lwk5yil3q53rg7n4574pg";
|
||||||
}
|
}
|
||||||
}/home/.direnvrc";
|
}/home/.direnvrc");
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zsh.interactiveShellInit = ''
|
programs.zsh.interactiveShellInit = ''
|
||||||
|
|||||||
@@ -1,15 +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;
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,4 @@
|
|||||||
{
|
{ lib, pkgs, ... }: {
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
virtualisation.docker = {
|
virtualisation.docker = {
|
||||||
enable = true;
|
enable = true;
|
||||||
# for ICE wifi, ref https://gist.github.com/sunsided/7840e89ff4e11b64a2d7503fafa0290c
|
# for ICE wifi, ref https://gist.github.com/sunsided/7840e89ff4e11b64a2d7503fafa0290c
|
||||||
@@ -11,6 +7,6 @@
|
|||||||
"--fixed-cidr=172.39.1.0/25"
|
"--fixed-cidr=172.39.1.0/25"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
users.users.me.extraGroups = ["docker"];
|
users.users.me.extraGroups = [ "docker" ];
|
||||||
environment.systemPackages = [pkgs.docker pkgs.docker-compose];
|
environment.systemPackages = [ pkgs.docker pkgs.docker_compose ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
inherit (import ../lib) defaultApplications colours theme;
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) defaultApplications colours theme;
|
|
||||||
in {
|
in {
|
||||||
home-manager.users.me.services.dunst = {
|
home-manager.users.me.services.dunst = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,45 +1,24 @@
|
|||||||
{
|
{ lib, pkgs, ... }:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) defaultApplications;
|
inherit (import <niveum/lib>) defaultApplications;
|
||||||
flameshot-once =
|
flameshot-once = pkgs.callPackage <stockholm/krebs/5pkgs/simple/flameshot-once> {};
|
||||||
pkgs.callPackage <stockholm/krebs/5pkgs/simple/flameshot-once> {};
|
|
||||||
in {
|
in {
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super: {
|
||||||
|
write =
|
||||||
|
super.callPackage <stockholm/krebs/5pkgs/simple/xwaitforwindow.nix> { };
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(flameshot-once.override {
|
(flameshot-once.override {
|
||||||
config = {
|
config.imgur = {
|
||||||
imgur = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
createUrl = "http://p.r/image";
|
createUrl = "http://p.r/image";
|
||||||
deleteUrl = "http://p.r/image/delete/%1";
|
deleteUrl = "http://p.r/image/delete/%1";
|
||||||
xdg-open.browser = (defaultApplications pkgs).browser;
|
xdg-open.browser = (defaultApplications pkgs).browser;
|
||||||
};
|
};
|
||||||
timeout = 1000;
|
config.timeout = 1000;
|
||||||
drawColor = "#ff0000";
|
|
||||||
drawThickness = 2;
|
|
||||||
showDesktopNotification = true;
|
|
||||||
buttons = [
|
|
||||||
"ARROW"
|
|
||||||
"BLUR"
|
|
||||||
"CIRCLE"
|
|
||||||
"CIRCLECOUNT"
|
|
||||||
"COPY"
|
|
||||||
"DRAWER"
|
|
||||||
"EXIT"
|
|
||||||
"IMAGEUPLOADER"
|
|
||||||
"MARKER"
|
|
||||||
"MOVESELECTION"
|
|
||||||
"PENCIL"
|
|
||||||
"RECTANGLE"
|
|
||||||
"SAVE"
|
|
||||||
"SELECTION"
|
|
||||||
"SELECTIONINDICATOR"
|
|
||||||
"TEXT"
|
|
||||||
"UNDO"
|
|
||||||
];
|
|
||||||
};
|
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{ config, pkgs, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
flixLocation = "/media/flix";
|
flixLocation = "/media/flix";
|
||||||
cacheLocation = "/var/cache/flix";
|
cacheLocation = "/var/cache/flix";
|
||||||
indexFilename = "index";
|
indexFilename = "index";
|
||||||
@@ -21,6 +18,7 @@ in {
|
|||||||
"x-systemd.device-timeout=1"
|
"x-systemd.device-timeout=1"
|
||||||
"x-systemd.idle-timeout=1min"
|
"x-systemd.idle-timeout=1min"
|
||||||
"x-systemd.requires=tinc.retiolum.service"
|
"x-systemd.requires=tinc.retiolum.service"
|
||||||
|
"x-systemd.requires=wpa_supplicant.service"
|
||||||
"user"
|
"user"
|
||||||
"_netdev"
|
"_netdev"
|
||||||
];
|
];
|
||||||
@@ -38,7 +36,7 @@ in {
|
|||||||
|
|
||||||
systemd.services.flix-index = {
|
systemd.services.flix-index = {
|
||||||
description = "Flix indexing service";
|
description = "Flix indexing service";
|
||||||
wants = ["network-online.target"];
|
wants = [ "network-online.target" ];
|
||||||
script = "cp ${flixLocation}/download/index ./${indexFilename}";
|
script = "cp ${flixLocation}/download/index ./${indexFilename}";
|
||||||
startAt = "hourly";
|
startAt = "hourly";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
@@ -77,4 +75,5 @@ in {
|
|||||||
| ${pkgs.findutils}/bin/xargs -I '{}' ${pkgs.utillinux}/bin/setsid ${pkgs.xdg_utils}/bin/xdg-open '{}'
|
| ${pkgs.findutils}/bin/xargs -I '{}' ${pkgs.utillinux}/bin/setsid ${pkgs.xdg_utils}/bin/xdg-open '{}'
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,54 +1,41 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }: {
|
||||||
|
nixpkgs.config.joypixels.acceptLicense = true;
|
||||||
|
|
||||||
fonts = {
|
fonts = {
|
||||||
enableDefaultFonts = true;
|
enableDefaultFonts = true;
|
||||||
fontDir.enable = true;
|
fontDir.enable = true;
|
||||||
fonts = with pkgs; [
|
fonts = with pkgs; [
|
||||||
alegreya
|
alegreya
|
||||||
alegreya-sans
|
alegreya-sans
|
||||||
amiri
|
|
||||||
annapurna-sil
|
|
||||||
cantarell-fonts
|
|
||||||
charis-sil
|
|
||||||
corefonts
|
corefonts
|
||||||
crimson
|
|
||||||
eb-garamond
|
eb-garamond
|
||||||
font-awesome_6
|
|
||||||
etBook
|
|
||||||
ezra-sil
|
|
||||||
fira
|
fira
|
||||||
font-awesome
|
font-awesome-ttf
|
||||||
galatia-sil
|
|
||||||
gentium
|
|
||||||
gfs-fonts
|
|
||||||
gyre-fonts
|
|
||||||
ibm-plex
|
ibm-plex
|
||||||
jetbrains-mono
|
inconsolata
|
||||||
libertinus
|
iosevka
|
||||||
libre-bodoni
|
libertine
|
||||||
lmodern
|
lmodern
|
||||||
merriweather
|
|
||||||
ocr-a
|
|
||||||
roboto
|
|
||||||
roboto-mono
|
|
||||||
noto-fonts
|
noto-fonts
|
||||||
noto-fonts-cjk
|
noto-fonts-cjk
|
||||||
noto-fonts-emoji
|
noto-fonts-emoji
|
||||||
|
roboto
|
||||||
|
roboto-mono
|
||||||
roboto-slab
|
roboto-slab
|
||||||
scheherazade-new
|
|
||||||
source-code-pro
|
source-code-pro
|
||||||
source-sans-pro
|
|
||||||
source-serif-pro
|
source-serif-pro
|
||||||
theano
|
source-sans-pro
|
||||||
tocharian-font
|
ubuntu_font_family
|
||||||
vistafonts
|
gfs-fonts
|
||||||
vollkorn
|
jetbrains-mono
|
||||||
zilla-slab
|
twemoji-color-font
|
||||||
]; # google-fonts league-of-moveable-type
|
joypixels
|
||||||
|
];
|
||||||
fontconfig.defaultFonts = {
|
fontconfig.defaultFonts = {
|
||||||
monospace = ["Noto Sans Mono"];
|
monospace = [ "JetBrains Mono" "JoyPixels" ];
|
||||||
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
|
serif = [ "Roboto Slab" ];
|
||||||
sansSerif = ["Noto Sans Display" "Noto Kufi Arabic" "Noto Sans Devanagari" "Noto Sans CJK JP"];
|
sansSerif = [ "Roboto" "Noto Sans" ];
|
||||||
emoji = ["Noto Color Emoji" "Noto Emoji"];
|
emoji = [ "JoyPixels" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
{
|
{ pkgs, lib, ... }: {
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
environment = {
|
environment = {
|
||||||
systemPackages = [pkgs.fzf];
|
systemPackages = [ pkgs.fzf ];
|
||||||
variables = {
|
variables = {
|
||||||
FZF_DEFAULT_OPTS =
|
FZF_DEFAULT_OPTS =
|
||||||
lib.escapeShellArgs ["--height=40%" "--layout=reverse"];
|
lib.escapeShellArgs [ "--height=40%" "--layout=reverse" ];
|
||||||
FZF_ALT_C_COMMAND = "${pkgs.fd}/bin/fd --type d";
|
FZF_ALT_C_COMMAND = "${pkgs.fd}/bin/fd --type d";
|
||||||
FZF_ALT_C_OPTS = lib.escapeShellArgs [
|
FZF_ALT_C_OPTS = lib.escapeShellArgs [
|
||||||
"--preview='${pkgs.tree}/bin/tree -L 1 \"{}\"'"
|
"--preview='${pkgs.tree}/bin/tree -L 1 \"{}\"'"
|
||||||
@@ -16,7 +12,7 @@
|
|||||||
];
|
];
|
||||||
FZF_CTRL_T_COMMAND = "${pkgs.fd}/bin/fd --type f";
|
FZF_CTRL_T_COMMAND = "${pkgs.fd}/bin/fd --type f";
|
||||||
FZF_CTRL_T_OPTS =
|
FZF_CTRL_T_OPTS =
|
||||||
lib.escapeShellArgs ["--preview='${pkgs.bat}/bin/bat \"{}\"'"];
|
lib.escapeShellArgs [ "--preview='${pkgs.bat}/bin/bat \"{}\"'" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }:
|
||||||
|
{
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.writers.writeDashBin "gaslight-stream" ''
|
(pkgs.writers.writeDashBin "gaslight-stream" ''
|
||||||
${pkgs.ffmpeg}/bin/ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac -f avi -
|
${pkgs.ffmpeg}/bin/ffmpeg -r 14 -s 640x480 -f video4linux2 -i /dev/video0 -f alsa -i default -c:v libx264 -preset ultrafast -c:a aac -f avi -
|
||||||
@@ -15,9 +16,10 @@
|
|||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
||||||
ssh machine gaslight-stream | mpv -
|
ssh machine gaslight-stream | mpv -
|
||||||
ssh machine gaslight-say "blablabla"
|
ssh machine gaslight-say "blablabla"
|
||||||
*/
|
|
||||||
|
|
||||||
|
*/
|
||||||
@@ -1,19 +1,16 @@
|
|||||||
|
{ pkgs, config, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (import ../lib) kieran ignorePaths;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) kieran ignorePaths;
|
|
||||||
in {
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.mr
|
pkgs.mr
|
||||||
pkgs.git
|
pkgs.git
|
||||||
pkgs.gitAndTools.gitflow
|
pkgs.gitAndTools.gitflow
|
||||||
|
pkgs.gitAndTools.hub
|
||||||
pkgs.gitAndTools.gh
|
pkgs.gitAndTools.gh
|
||||||
pkgs.gitAndTools.git-extras
|
pkgs.gitAndTools.git-extras
|
||||||
pkgs.gitAndTools.git-trim
|
pkgs.gitAndTools.git-trim
|
||||||
pkgs.gitAndTools.git-absorb
|
|
||||||
pkgs.gitstats
|
pkgs.gitstats
|
||||||
pkgs.patch
|
pkgs.patch
|
||||||
pkgs.patchutils
|
pkgs.patchutils
|
||||||
@@ -26,6 +23,37 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
|
home.file.".mrconfig".text = let
|
||||||
|
prependPath = prefix:
|
||||||
|
lib.attrsets.mapAttrs'
|
||||||
|
(path: lib.attrsets.nameValuePair "${prefix}/${path}");
|
||||||
|
git = url: { checkout = "git clone ${url}"; };
|
||||||
|
github = owner: repo: git "git@github.com:${owner}/${repo}";
|
||||||
|
keybase = owner: repo: git "keybase://private/${owner}/${repo}";
|
||||||
|
in lib.generators.toINI { } ({
|
||||||
|
DEFAULT = { git_gc = ''git gc "$@"''; };
|
||||||
|
} // prependPath "projects" {
|
||||||
|
"menstruation.rs" = github "kmein" "menstruation.rs";
|
||||||
|
brockman = github "kmein" "brockman";
|
||||||
|
challenges = github "kmein" "challenges";
|
||||||
|
conlangs = github "kmein" "conlangs";
|
||||||
|
ledger = keybase "kmein" "ledger";
|
||||||
|
mahlzeit = github "kmein" "mahlzeit";
|
||||||
|
menstruation-telegram = github "kmein" "menstruation-telegram";
|
||||||
|
meteora = github "kmein" "meteora";
|
||||||
|
modernizr = github "kmein" "modernizr";
|
||||||
|
niveum = github "kmein" "niveum";
|
||||||
|
nixpkgs = github "NixOS" "nixpkgs";
|
||||||
|
poetry = github "kmein" "poetry";
|
||||||
|
quotes = github "kmein" "quotes";
|
||||||
|
sphinx = github "kmein" "sphinx";
|
||||||
|
stockholm = git "https://cgit.krebsco.de/stockholm";
|
||||||
|
telebots = github "kmein" "telebots";
|
||||||
|
traadfri = github "kmein" "traadfri";
|
||||||
|
wissen = github "kmein" "wissen";
|
||||||
|
zen = github "kmein" "zen";
|
||||||
|
});
|
||||||
|
|
||||||
programs.git = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.gitAndTools.gitFull;
|
package = pkgs.gitAndTools.gitFull;
|
||||||
@@ -42,20 +70,33 @@ in {
|
|||||||
diffs = "diff --staged";
|
diffs = "diff --staged";
|
||||||
last = "log -1 HEAD";
|
last = "log -1 HEAD";
|
||||||
logs = "log --pretty=oneline";
|
logs = "log --pretty=oneline";
|
||||||
graph = "log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
|
graph =
|
||||||
|
"log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all";
|
||||||
};
|
};
|
||||||
ignores = ignorePaths;
|
ignores = ignorePaths;
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
pull.ff = "only";
|
pull.ff = "only";
|
||||||
rebase.autoStash = true;
|
rebase.autoStash = true;
|
||||||
merge.autoStash = true;
|
merge.autoStash = true;
|
||||||
|
core.pager =
|
||||||
# # ref https://github.com/dandavison/delta
|
"${pkgs.gitAndTools.diff-so-fancy}/bin/diff-so-fancy | ${pkgs.less}/bin/less --tabs=4 -RFX";
|
||||||
# core.pager = "${pkgs.delta}/bin/delta";
|
color = {
|
||||||
# interactive.diffFilter = "${pkgs.delta}/bin/delta --color-only";
|
ui = true;
|
||||||
# delta.navigate = true;
|
diff = {
|
||||||
# merge.conflictStyle = "diff3";
|
meta = "11";
|
||||||
# diff.colorMoved = "default";
|
frag = "magenta bold";
|
||||||
|
commit = "yellow bold";
|
||||||
|
old = "red bold";
|
||||||
|
new = "green bold";
|
||||||
|
whitespace = "red reverse";
|
||||||
|
};
|
||||||
|
diff-highlight = {
|
||||||
|
oldNormal = "red bold";
|
||||||
|
oldHighlight = "red bold 52";
|
||||||
|
newNormal = "green bold";
|
||||||
|
newHighlight = "green bold 22";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
13
configs/gitea.nix
Normal file
13
configs/gitea.nix
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
services.gitea = {
|
||||||
|
enable = true;
|
||||||
|
disableRegistration = true;
|
||||||
|
rootUrl = "https://code.kmein.de";
|
||||||
|
appName = "code.kmein.de";
|
||||||
|
};
|
||||||
|
services.nginx.virtualHosts."code.kmein.de" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/".extraConfig = "proxy_pass http://localhost:3000;";
|
||||||
|
};
|
||||||
|
}
|
||||||
61
configs/hass/default.nix
Normal file
61
configs/hass/default.nix
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (import ./lib.nix) triggers;
|
||||||
|
inherit (import <niveum/lib>) localAddresses;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./zigbee.nix
|
||||||
|
./frontend.nix
|
||||||
|
];
|
||||||
|
|
||||||
|
services.home-assistant = {
|
||||||
|
enable = true;
|
||||||
|
configWritable = true;
|
||||||
|
lovelaceConfigWritable = true;
|
||||||
|
openFirewall = true;
|
||||||
|
config = {
|
||||||
|
homeassistant = {
|
||||||
|
name = "Toum";
|
||||||
|
latitude = config.location.latitude;
|
||||||
|
longitude = config.location.longitude;
|
||||||
|
elevation = 90; # TODO find out how high I live
|
||||||
|
unit_system = "metric";
|
||||||
|
time_zone = config.time.timeZone;
|
||||||
|
};
|
||||||
|
config = {};
|
||||||
|
discovery = {};
|
||||||
|
system_health = {};
|
||||||
|
history = {};
|
||||||
|
# tradfri.host = localAddresses.tradfri; # dont use until python3Packages.pytradfri is packaged
|
||||||
|
sun = {};
|
||||||
|
mobile_app = {};
|
||||||
|
shopping_list = {};
|
||||||
|
sensor = [
|
||||||
|
{
|
||||||
|
platform = "dwd_weather_warnings";
|
||||||
|
region_name = "Berlin";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
mqtt = {
|
||||||
|
broker = "localhost";
|
||||||
|
port = 1883;
|
||||||
|
client_id = "home-assistant";
|
||||||
|
username = "albrecht";
|
||||||
|
password = lib.strings.fileContents <system-secrets/mosquitto>;
|
||||||
|
keepalive = 60;
|
||||||
|
protocol = "3.1";
|
||||||
|
|
||||||
|
discovery = true;
|
||||||
|
birth_message = {
|
||||||
|
topic = "/hass/status";
|
||||||
|
payload = "online";
|
||||||
|
};
|
||||||
|
will_message = {
|
||||||
|
topic = "/hass/status";
|
||||||
|
payload = "offline";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
37
configs/hass/frontend.nix
Normal file
37
configs/hass/frontend.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
let
|
||||||
|
inherit (import ./lib.nix) triggers;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.home-assistant.config = {
|
||||||
|
frontend = {
|
||||||
|
themes = {
|
||||||
|
day_theme = import ./themes/clear.nix;
|
||||||
|
night_theme = import ./themes/clear-dark.nix;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
automation = [
|
||||||
|
{
|
||||||
|
alias = "Night Theme";
|
||||||
|
hide_entity = true;
|
||||||
|
trigger = triggers.night;
|
||||||
|
action = [
|
||||||
|
{
|
||||||
|
service = "frontend.set_theme";
|
||||||
|
data.name = "night_theme";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alias = "Day Theme";
|
||||||
|
hide_entity = true;
|
||||||
|
trigger = triggers.day;
|
||||||
|
action = [
|
||||||
|
{
|
||||||
|
service = "frontend.set_theme";
|
||||||
|
data.name = "day_theme";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
16
configs/hass/lib.nix
Normal file
16
configs/hass/lib.nix
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
triggers = {
|
||||||
|
night = {
|
||||||
|
platform = "numeric_state";
|
||||||
|
entity_id = "sun.sun";
|
||||||
|
value_template = "{{ state.attributes.elevation }}";
|
||||||
|
below = -4.0;
|
||||||
|
};
|
||||||
|
day = {
|
||||||
|
platform = "numeric_state";
|
||||||
|
entity_id = "sun.sun";
|
||||||
|
value_template = "{{ state.attributes.elevation }}";
|
||||||
|
above = 0;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
72
configs/hass/themes/clear-dark.nix
Normal file
72
configs/hass/themes/clear-dark.nix
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
rec {
|
||||||
|
# Colors
|
||||||
|
text-color = "#DADADB"; # Grey text
|
||||||
|
text-medium-light-color = "#A0A2A8"; # Medium-light grey text
|
||||||
|
text-medium-color = "#80828A"; # Medium grey text
|
||||||
|
text-dark-color = "#6A6B74"; # Dark grey text
|
||||||
|
accent-color = "#008bef"; # Blue
|
||||||
|
accent-medium-color = "#2484C9"; # Decent blue
|
||||||
|
background-color = "#3b4049"; # Dark grey background
|
||||||
|
background-color-2 = "#484E59"; # Light grey background
|
||||||
|
background-card-color = "#434952"; # Grey background
|
||||||
|
border-color = "#383C46"; # Grey border
|
||||||
|
|
||||||
|
# Header
|
||||||
|
app-header-background-color = "#363941"; # Background color
|
||||||
|
|
||||||
|
# Text
|
||||||
|
primary-color = text-color;
|
||||||
|
text-primary-color = text-color;
|
||||||
|
|
||||||
|
# Left Menu
|
||||||
|
paper-listbox-background-color = background-color; # Background
|
||||||
|
sidebar-icon-color = text-medium-color; # icons
|
||||||
|
sidebar-selected-icon-color = text-medium-light-color; # Selected row icon and background (15%)
|
||||||
|
sidebar-selected-text-color = text-color; # Selected row label
|
||||||
|
|
||||||
|
# UI
|
||||||
|
paper-card-header-color = text-color; # Title in settings
|
||||||
|
primary-background-color = background-color; # Background (also title background in left menu)
|
||||||
|
mdc-theme-primary = accent-medium-color; # Action Buttons (save, restart etc.)
|
||||||
|
card-background-color = background-card-color; # Entity Registry Background
|
||||||
|
|
||||||
|
# Card
|
||||||
|
paper-card-background-color = background-card-color; # Background
|
||||||
|
dark-primary-color = text-color;
|
||||||
|
primary-text-color = text-color;
|
||||||
|
paper-listbox-color = text-color;
|
||||||
|
light-primary-color = text-dark-color;
|
||||||
|
secondary-text-color = text-medium-color;
|
||||||
|
disabled-text-color = text-dark-color;
|
||||||
|
paper-dialog-button-color = text-color;
|
||||||
|
secondary-background-color = background-color-2; # Background more info title
|
||||||
|
|
||||||
|
# Icons
|
||||||
|
paper-item-icon-color = text-dark-color; # Off
|
||||||
|
paper-item-icon-active-color = accent-color; # On
|
||||||
|
|
||||||
|
# Switches
|
||||||
|
switch-checked-button-color = text-medium-light-color; # Knob On
|
||||||
|
switch-unchecked-button-color = text-medium-light-color; # Knob Off
|
||||||
|
switch-checked-track-color = "#009FFF"; # Background On
|
||||||
|
switch-unchecked-track-color = "#767682"; # Background Off
|
||||||
|
|
||||||
|
# Slider
|
||||||
|
paper-slider-active-color = accent-color; # Line On
|
||||||
|
paper-slider-knob-color = text-medium-light-color; # Knob On
|
||||||
|
paper-slider-container-color = text-dark-color; # Line Off
|
||||||
|
paper-slider-knob-start-color = text-medium-light-color; # Knob Off
|
||||||
|
|
||||||
|
# Badges
|
||||||
|
label-badge-text-color = text-color;
|
||||||
|
label-badge-background-color = "rgba(54, 57, 65, 0.6)";
|
||||||
|
|
||||||
|
# Shadows
|
||||||
|
ha-card-box-shadow = "inset 0px 0px 0px 1px var(--border-color)";
|
||||||
|
|
||||||
|
# HACS
|
||||||
|
hacs-badge-color = accent-color; # New Badge
|
||||||
|
hacs-status-installed = text-color; # Installed Icon
|
||||||
|
hacs-status-pending-restart = text-dark-color; # Restart Icon
|
||||||
|
hacs-status-pending-update = accent-color;
|
||||||
|
}
|
||||||
52
configs/hass/themes/clear.nix
Normal file
52
configs/hass/themes/clear.nix
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
rec {
|
||||||
|
text-color = "#636B75"; # Grey text
|
||||||
|
text-medium-color = "#8c96a5"; # Medium grey text
|
||||||
|
text-light-color = "#BAC0C6"; # Light grey text
|
||||||
|
accent-color = "#00a1ff"; # Blue
|
||||||
|
background-color = "#F7F8F9"; # Light grey background
|
||||||
|
background-color-2 = "#F4F5F6"; # Light grey background
|
||||||
|
background-card-color = "rgba(255,255,255,1.0)"; # White background
|
||||||
|
border-color = "#E8E8E8"; # Light grey border
|
||||||
|
|
||||||
|
# Header
|
||||||
|
primary-color = text-color; # Background
|
||||||
|
text-primary-color = "#FFF"; # Text
|
||||||
|
|
||||||
|
# Left Menu
|
||||||
|
paper-listbox-background-color = background-color; # Background
|
||||||
|
# TODO = Text and Icons
|
||||||
|
|
||||||
|
# UI
|
||||||
|
paper-card-header-color = text-color; # Title in settings
|
||||||
|
primary-background-color = background-color; # Background color (also title background in left menu)
|
||||||
|
|
||||||
|
# Card
|
||||||
|
paper-card-background-color = background-card-color; # Background
|
||||||
|
dark-primary-color = text-color;
|
||||||
|
primary-text-color = text-color;
|
||||||
|
paper-listbox-color = text-color;
|
||||||
|
light-primary-color = text-light-color;
|
||||||
|
secondary-text-color = text-medium-color;
|
||||||
|
disabled-text-color = text-light-color;
|
||||||
|
paper-dialog-button-color = text-color;
|
||||||
|
secondary-background-color = background-color-2; # Background more info title
|
||||||
|
|
||||||
|
# Icons
|
||||||
|
paper-item-icon-color = text-light-color; # Off
|
||||||
|
paper-item-icon-active-color = accent-color; # On
|
||||||
|
|
||||||
|
# Switches
|
||||||
|
switch-checked-button-color = "#FFF"; # Knob On
|
||||||
|
switch-unchecked-button-color = "#FFF"; # Knob Off
|
||||||
|
switch-checked-track-color = "#0077FF"; # Background On
|
||||||
|
switch-unchecked-track-color = disabled-text-color; # Background Off
|
||||||
|
|
||||||
|
# Slider
|
||||||
|
paper-slider-active-color = accent-color; # Line On
|
||||||
|
paper-slider-container-color = "#e5e7ea"; # Line Off
|
||||||
|
paper-slider-knob-color = text-light-color; # Knob On
|
||||||
|
paper-slider-knob-start-color = text-light-color; # Knob Off
|
||||||
|
|
||||||
|
# Shadows
|
||||||
|
ha-card-box-shadow = "inset 0px 0px 0px 1px var(--border-color)";
|
||||||
|
}
|
||||||
102
configs/hass/zigbee.nix
Normal file
102
configs/hass/zigbee.nix
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
inherit (import <niveum/lib>) localAddresses;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.zigbee2mqtt = {
|
||||||
|
enable = true;
|
||||||
|
config = {
|
||||||
|
permit_join = false;
|
||||||
|
homeassistant = true;
|
||||||
|
serial = {
|
||||||
|
port = "/dev/ttyACM0";
|
||||||
|
disable_led = true;
|
||||||
|
};
|
||||||
|
mqtt = {
|
||||||
|
discovery = true;
|
||||||
|
base_topic = "zigbee";
|
||||||
|
server = "mqtt://${localAddresses.toum}";
|
||||||
|
user = "albrecht";
|
||||||
|
password = lib.strings.fileContents <system-secrets/mosquitto>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.mosquitto = {
|
||||||
|
enable = true;
|
||||||
|
host = "0.0.0.0";
|
||||||
|
allowAnonymous = false;
|
||||||
|
checkPasswords = true;
|
||||||
|
users."albrecht" = {
|
||||||
|
password = lib.strings.fileContents <system-secrets/mosquitto>;
|
||||||
|
acl = [ "topic readwrite #" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ 1883 ];
|
||||||
|
|
||||||
|
environment.systemPackages = [ pkgs.mosquitto ];
|
||||||
|
|
||||||
|
services.home-assistant = {
|
||||||
|
config = {
|
||||||
|
switch = [
|
||||||
|
{
|
||||||
|
platform = "mqtt";
|
||||||
|
name = "zigbee2mqtt_join";
|
||||||
|
state_topic = "/zigbee2mqtt/bridge/config/permit_join";
|
||||||
|
command_topic = "/zigbee2mqtt/bridge/config/permit_join";
|
||||||
|
payload_on = "true";
|
||||||
|
payload_off = "false";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
timer.zigbee_permit_join = {
|
||||||
|
name = "Zigbee Time remaining";
|
||||||
|
duration = 120;
|
||||||
|
};
|
||||||
|
automation = [
|
||||||
|
# Automation to start timer when enable join is turned on
|
||||||
|
{
|
||||||
|
id = "zigbee_join_enabled";
|
||||||
|
alias = "";
|
||||||
|
hide_entity = "true";
|
||||||
|
trigger = {
|
||||||
|
platform = "state";
|
||||||
|
entity_id = "switch.zigbee2mqtt_join";
|
||||||
|
to = "on";
|
||||||
|
};
|
||||||
|
action = {
|
||||||
|
service = "timer.start";
|
||||||
|
entity_id = "timer.zigbee_permit_join";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# Automation to stop timer when switch turned off and turn off switch when timer finished
|
||||||
|
{
|
||||||
|
id = "zigbee_join_disabled";
|
||||||
|
hide_entity = "true";
|
||||||
|
trigger = [
|
||||||
|
{
|
||||||
|
platform = "event";
|
||||||
|
event_type = "timer.finished";
|
||||||
|
event_data.entity_id = "timer.zigbee_permit_join";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
platform = "state";
|
||||||
|
entity_id = "switch.zigbee2mqtt_join";
|
||||||
|
to = "off";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
action = [
|
||||||
|
{
|
||||||
|
service = "timer.cancel";
|
||||||
|
data.entity_id = "timer.zigbee_permit_join";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
service = "switch.turn_off";
|
||||||
|
entity_id = "switch.zigbee2mqtt_join";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
81
configs/hedgedoc.nix
Normal file
81
configs/hedgedoc.nix
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
backupLocation = "/var/lib/codimd-backup";
|
||||||
|
stateLocation = "/var/lib/codimd/state.sqlite";
|
||||||
|
nixpkgs-unstable = import <nixpkgs-unstable> {};
|
||||||
|
domain = "pad.kmein.de";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ <stockholm/krebs/3modules/permown.nix> ];
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${domain} = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "https://localhost:3091";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
security.acme.certs.${domain}.group = "hedgecert";
|
||||||
|
users.groups.hedgecert.members = [ "codimd" "nginx" ];
|
||||||
|
|
||||||
|
security.dhparams = {
|
||||||
|
enable = true;
|
||||||
|
params.hedgedoc = {};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.hedgedoc = {
|
||||||
|
enable = true;
|
||||||
|
configuration = {
|
||||||
|
allowOrigin = [ domain ];
|
||||||
|
allowAnonymous = true;
|
||||||
|
allowGravatar = false;
|
||||||
|
allowFreeURL = true;
|
||||||
|
db = {
|
||||||
|
dialect = "sqlite";
|
||||||
|
storage = stateLocation;
|
||||||
|
};
|
||||||
|
port = 3091;
|
||||||
|
domain = domain;
|
||||||
|
useSSL = true;
|
||||||
|
protocolUseSSL = true;
|
||||||
|
sslCAPath = [ "/etc/ssl/certs/ca-certificates.crt" ];
|
||||||
|
sslCertPath = "/var/lib/acme/${domain}/cert.pem";
|
||||||
|
sslKeyPath = "/var/lib/acme/${domain}/key.pem";
|
||||||
|
dhParamPath = config.security.dhparams.params.hedgedoc.path;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
krebs.permown.${backupLocation} = { owner = "codimd"; group = "codimd"; umask = "0002"; };
|
||||||
|
|
||||||
|
systemd.services.hedgedoc-backup = {
|
||||||
|
description = "Hedgedoc backup service";
|
||||||
|
script = ''
|
||||||
|
${nixpkgs-unstable.sqlite}/bin/sqlite3 -json ${stateLocation} "select shortid, alias, ownerId, content from Notes" \
|
||||||
|
| ${pkgs.writers.writePython3 "hedgedoc-json-to-fs.py" {} ''
|
||||||
|
import json
|
||||||
|
import pathlib
|
||||||
|
import sys
|
||||||
|
|
||||||
|
for note in json.load(sys.stdin):
|
||||||
|
user_directory = pathlib.Path()
|
||||||
|
if note["ownerId"]:
|
||||||
|
user_directory = pathlib.Path(note["ownerId"])
|
||||||
|
user_directory.mkdir(exist_ok=True)
|
||||||
|
file_path = user_directory / (
|
||||||
|
(note["alias"] if note["alias"] else note["shortid"]) + ".md"
|
||||||
|
)
|
||||||
|
file_path.write_text(note["content"])
|
||||||
|
print(f"✔ {file_path}", file=sys.stderr)
|
||||||
|
''}
|
||||||
|
'';
|
||||||
|
startAt = "hourly";
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
User = "codimd";
|
||||||
|
Group = "codimd";
|
||||||
|
WorkingDirectory = backupLocation;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,27 +1,5 @@
|
|||||||
{
|
{ config, pkgs, ... }: {
|
||||||
config,
|
imports = [ ../modules/hledger.nix ];
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [<niveum/modules/hledger.nix>];
|
|
||||||
|
|
||||||
environment.systemPackages = let
|
|
||||||
timeLedger = "$HOME/projects/ledger/time.timeclock";
|
|
||||||
in [
|
|
||||||
(pkgs.writers.writeDashBin "hora-edit" ''
|
|
||||||
$EDITOR + "${timeLedger}" && ${pkgs.git}/bin/git -C "$(${pkgs.coreutils}/bin/dirname ${timeLedger})" commit --all --message "$(${pkgs.coreutils}/bin/date -Im)"
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "hora" ''
|
|
||||||
${pkgs.hledger}/bin/hledger -f "${timeLedger}" "$@"
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "hora-filli" ''
|
|
||||||
${pkgs.hledger}/bin/hledger -f "${timeLedger}" register fillidefilla -O csv \
|
|
||||||
-b "$(date -d "$(date +%Y-%m)-20 last month" +%Y-%m-%d)" \
|
|
||||||
-e "$(date -d "$(date +%Y-%m)-20" +%Y-%m-%d)" \
|
|
||||||
| sed 's/(fillidefilla:\(.*\))/\1/g' \
|
|
||||||
| xsv select date,amount,total,account,description
|
|
||||||
'')
|
|
||||||
];
|
|
||||||
|
|
||||||
niveum.hledger = {
|
niveum.hledger = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
sort_key = "PERCENT_CPU";
|
sort_key = "PERCENT_CPU";
|
||||||
tree_view = true;
|
tree_view = true;
|
||||||
update_process_names = false;
|
update_process_names = false;
|
||||||
right_meters = ["Uptime" "Tasks" "LoadAverage" "Battery"];
|
right_meters = [ "Uptime" "Tasks" "LoadAverage" "Battery" ];
|
||||||
left_meters = ["LeftCPUs2" "RightCPUs2" "Memory" "Swap"];
|
left_meters = [ "LeftCPUs2" "RightCPUs2" "Memory" "Swap" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.strings) fileContents;
|
inherit (lib.strings) fileContents;
|
||||||
inherit (import <niveum/lib>) sshPort;
|
inherit (import <niveum/lib>) sshPort;
|
||||||
eduroam = {
|
eduroam = {
|
||||||
@@ -18,7 +14,7 @@
|
|||||||
"username=meinhaki"
|
"username=meinhaki"
|
||||||
"password=${lib.strings.fileContents <secrets/mail/meinhaki>}"
|
"password=${lib.strings.fileContents <secrets/mail/meinhaki>}"
|
||||||
"noauto"
|
"noauto"
|
||||||
"x-systemd.requires=hu-vpn.service"
|
"x-systemd.requires=openvpn-hu-berlin.service"
|
||||||
"x-systemd.automount"
|
"x-systemd.automount"
|
||||||
"x-systemd.device-timeout=1"
|
"x-systemd.device-timeout=1"
|
||||||
"x-systemd.idle-timeout=1min"
|
"x-systemd.idle-timeout=1min"
|
||||||
@@ -36,6 +32,7 @@ in {
|
|||||||
options = hu-berlin-cifs-options;
|
options = hu-berlin-cifs-options;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
home-manager.users.me.programs.ssh = {
|
home-manager.users.me.programs.ssh = {
|
||||||
matchBlocks = {
|
matchBlocks = {
|
||||||
"alew.hu-berlin.de" = {
|
"alew.hu-berlin.de" = {
|
||||||
@@ -49,11 +46,10 @@ in {
|
|||||||
(pkgs.writers.writeDashBin "hu-ip" ''
|
(pkgs.writers.writeDashBin "hu-ip" ''
|
||||||
${pkgs.w3m}/bin/w3m -dump meineip.hu-berlin.de | head --lines=-4 | tail --lines=+3
|
${pkgs.w3m}/bin/w3m -dump meineip.hu-berlin.de | head --lines=-4 | tail --lines=+3
|
||||||
'')
|
'')
|
||||||
(
|
(pkgs.writers.writePython3Bin "hu-eduroam-install"
|
||||||
pkgs.writers.writePython3Bin "hu-eduroam-install"
|
|
||||||
{
|
{
|
||||||
libraries = with pkgs.python3Packages; [distro pyopenssl dbus-python];
|
libraries = with pkgs.python3Packages; [ distro pyopenssl dbus-python ];
|
||||||
flakeIgnore = ["E501" "E123" "W504" "E722" "F821" "E226" "E126" "E265" "W291"];
|
flakeIgnore = [ "E501" "E123" "W504" "E722" "F821" "E226" "E126" "E265" "W291" ];
|
||||||
}
|
}
|
||||||
(builtins.readFile (builtins.fetchurl {
|
(builtins.readFile (builtins.fetchurl {
|
||||||
url = "https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/linux-installer/eduroam-linux-hub.py";
|
url = "https://www.cms.hu-berlin.de/de/dl/netze/wlan/config/eduroam/linux-installer/eduroam-linux-hub.py";
|
||||||
@@ -64,22 +60,20 @@ in {
|
|||||||
|
|
||||||
systemd.services.hu-vpn = {
|
systemd.services.hu-vpn = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wants = ["network-online.target"];
|
wants = [ "network-online.target" ];
|
||||||
conflicts = ["openvpn-hu-berlin.service"];
|
conflicts = [ "openvpn-hu-berlin.service" ];
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.openfortivpn}/bin/openfortivpn -c ${
|
${pkgs.openfortivpn}/bin/openfortivpn -c ${pkgs.writeText "hu-berlin.config" ''
|
||||||
pkgs.writeText "hu-berlin.config" ''
|
|
||||||
host = forti-ssl.vpn.hu-berlin.de
|
host = forti-ssl.vpn.hu-berlin.de
|
||||||
port = 443
|
port = 443
|
||||||
trusted-cert = 42193a913d276d9eb86217612956e1e6464d6f07bed5393a4787c87adc4bd359
|
trusted-cert = 42193a913d276d9eb86217612956e1e6464d6f07bed5393a4787c87adc4bd359
|
||||||
username = ${eduroam.identity}@split_tunnel
|
username = ${eduroam.identity}
|
||||||
password = ${eduroam.password}
|
password = ${eduroam.password}
|
||||||
''
|
''}
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.openvpn-hu-berlin.conflicts = ["hu-vpn.service"];
|
systemd.services.openvpn-hu-berlin.conflicts = [ "hu-vpn.service" ];
|
||||||
|
|
||||||
services.openvpn.servers.hu-berlin = {
|
services.openvpn.servers.hu-berlin = {
|
||||||
autoStart = false;
|
autoStart = false;
|
||||||
@@ -88,7 +82,8 @@ in {
|
|||||||
password = eduroam.password;
|
password = eduroam.password;
|
||||||
};
|
};
|
||||||
config = fileContents (pkgs.fetchurl {
|
config = fileContents (pkgs.fetchurl {
|
||||||
url = "https://www.cms.hu-berlin.de/de/dl/netze/vpn/openvpn/hu-berlin.ovpn";
|
url =
|
||||||
|
"https://www.cms.hu-berlin.de/de/dl/netze/vpn/openvpn/hu-berlin.ovpn";
|
||||||
sha256 = "15b55aibik5460svjq2gwxrcyh6ay4k8savd6cd5lncgndmd8p8h";
|
sha256 = "15b55aibik5460svjq2gwxrcyh6ay4k8savd6cd5lncgndmd8p8h";
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,11 +1,7 @@
|
|||||||
{
|
{ inputs, config, pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
inherit (import ../lib) defaultApplications colours;
|
||||||
lib,
|
klem = import ../packages/scripts/klem.nix {
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) defaultApplications colours;
|
|
||||||
klem = import <niveum/packages/scripts/klem.nix> {
|
|
||||||
inherit pkgs lib;
|
inherit pkgs lib;
|
||||||
config.scripts = {
|
config.scripts = {
|
||||||
"p.r" = pkgs.writers.writeDash "p.r" ''
|
"p.r" = pkgs.writers.writeDash "p.r" ''
|
||||||
@@ -34,13 +30,9 @@
|
|||||||
"devanagari" = pkgs.writers.writeDash "devanagari" ''
|
"devanagari" = pkgs.writers.writeDash "devanagari" ''
|
||||||
${pkgs.scripts.devanagari}/bin/devanagari
|
${pkgs.scripts.devanagari}/bin/devanagari
|
||||||
'';
|
'';
|
||||||
"avesta" = pkgs.writeScript "avesta" (builtins.readFile <niveum/packages/scripts/avesta.sed>);
|
|
||||||
"curl" = pkgs.writers.writeDash "curl" ''
|
"curl" = pkgs.writers.writeDash "curl" ''
|
||||||
${pkgs.curl}/bin/curl -fSs "$(${pkgs.coreutils}/bin/cat)"
|
${pkgs.curl}/bin/curl -fSs "$(${pkgs.coreutils}/bin/cat)"
|
||||||
'';
|
'';
|
||||||
ocr = pkgs.writers.writeDash "ocr" ''
|
|
||||||
${pkgs.tesseract4}/bin/tesseract -l eng+deu - stdout
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,6 +42,7 @@
|
|||||||
move-to-new-workspace = pkgs.writers.writeDash "new-workspace" ''
|
move-to-new-workspace = pkgs.writers.writeDash "new-workspace" ''
|
||||||
i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
|
i3-msg move container to workspace $(($(i3-msg -t get_workspaces | tr , '\n' | grep '"num":' | cut -d : -f 2 | sort -rn | head -1) + 1))
|
||||||
'';
|
'';
|
||||||
|
|
||||||
in {
|
in {
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
displayManager.defaultSession = "none+i3";
|
displayManager.defaultSession = "none+i3";
|
||||||
@@ -77,10 +70,7 @@ in {
|
|||||||
home-manager.users.me.xsession.windowManager.i3 = {
|
home-manager.users.me.xsession.windowManager.i3 = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = rec {
|
config = rec {
|
||||||
fonts = {
|
fonts = {names = ["Sans"]; size = 10.0;};
|
||||||
names = ["Sans"];
|
|
||||||
size = 10.0;
|
|
||||||
};
|
|
||||||
modifier = "Mod4";
|
modifier = "Mod4";
|
||||||
window = {
|
window = {
|
||||||
titlebar = false;
|
titlebar = false;
|
||||||
@@ -88,15 +78,15 @@ in {
|
|||||||
hideEdgeBorders = "smart";
|
hideEdgeBorders = "smart";
|
||||||
commands = [
|
commands = [
|
||||||
{
|
{
|
||||||
criteria = {class = "floating";};
|
criteria = { class = "floating"; };
|
||||||
command = "floating enable";
|
command = "floating enable";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
criteria = {class = "fzfmenu";};
|
criteria = { class = "fzfmenu"; };
|
||||||
command = "floating enable";
|
command = "floating enable";
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
criteria = {class = "mpv";};
|
criteria = { class = "mpv"; };
|
||||||
command = lib.strings.concatStringsSep ", " [
|
command = lib.strings.concatStringsSep ", " [
|
||||||
"floating enable"
|
"floating enable"
|
||||||
"sticky enable"
|
"sticky enable"
|
||||||
@@ -118,43 +108,31 @@ in {
|
|||||||
text = colours.foreground;
|
text = colours.foreground;
|
||||||
};
|
};
|
||||||
in rec {
|
in rec {
|
||||||
focused =
|
focused = scheme // {
|
||||||
scheme
|
|
||||||
// {
|
|
||||||
border = colours.cyan.bright;
|
border = colours.cyan.bright;
|
||||||
indicator = colours.cyan.bright;
|
indicator = colours.cyan.bright;
|
||||||
childBorder = colours.cyan.bright;
|
childBorder = colours.cyan.bright;
|
||||||
};
|
};
|
||||||
unfocused =
|
unfocused = scheme // {
|
||||||
scheme
|
|
||||||
// {
|
|
||||||
border = colours.background;
|
border = colours.background;
|
||||||
indicator = colours.background;
|
indicator = colours.background;
|
||||||
childBorder = colours.background;
|
childBorder = colours.background;
|
||||||
};
|
};
|
||||||
focusedInactive = unfocused;
|
focusedInactive = unfocused;
|
||||||
urgent =
|
urgent = scheme // {
|
||||||
scheme
|
|
||||||
// {
|
|
||||||
border = colours.red.bright;
|
border = colours.red.bright;
|
||||||
indicator = colours.red.bright;
|
indicator = colours.red.bright;
|
||||||
childBorder = colours.red.bright;
|
childBorder = colours.red.bright;
|
||||||
};
|
};
|
||||||
placeholder =
|
placeholder = scheme // {
|
||||||
scheme
|
|
||||||
// {
|
|
||||||
border = colours.green.bright;
|
border = colours.green.bright;
|
||||||
indicator = colours.green.bright;
|
indicator = colours.green.bright;
|
||||||
childBorder = colours.green.bright;
|
childBorder = colours.green.bright;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
bars = [
|
bars = [{
|
||||||
{
|
|
||||||
workspaceButtons = false;
|
workspaceButtons = false;
|
||||||
fonts = {
|
fonts = {names = ["Sans"]; size = 8.0;};
|
||||||
names = ["Monospace" "Font Awesome 6 Free"];
|
|
||||||
size = 8.0;
|
|
||||||
};
|
|
||||||
mode = "hide"; # "dock"
|
mode = "hide"; # "dock"
|
||||||
position = "bottom";
|
position = "bottom";
|
||||||
colors = rec {
|
colors = rec {
|
||||||
@@ -167,15 +145,14 @@ in {
|
|||||||
text = colours.foreground;
|
text = colours.foreground;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
statusCommand = "env I3RS_GITHUB_TOKEN=${lib.strings.fileContents <secrets/github/notification.token>} ${pkgs.i3status-rust}/bin/i3status-rs ${
|
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 (config.niveum) batteryName wirelessInterface;
|
||||||
inherit colours;
|
inherit colours;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
})
|
})
|
||||||
}";
|
}";
|
||||||
}
|
}];
|
||||||
];
|
|
||||||
modes.resize = {
|
modes.resize = {
|
||||||
"Escape" = ''mode "default"'';
|
"Escape" = ''mode "default"'';
|
||||||
"Return" = ''mode "default"'';
|
"Return" = ''mode "default"'';
|
||||||
@@ -217,11 +194,6 @@ in {
|
|||||||
"${modifier}+r" = "mode resize";
|
"${modifier}+r" = "mode resize";
|
||||||
"${modifier}+v" = "split v";
|
"${modifier}+v" = "split v";
|
||||||
"${modifier}+w" = "layout tabbed";
|
"${modifier}+w" = "layout tabbed";
|
||||||
"${modifier}+q" = "exec ${pkgs.writers.writeDash "newsboat-sync" ''
|
|
||||||
notify-send --app-name="newsboat" "Updating ..."
|
|
||||||
newsboat -x reload
|
|
||||||
notify-send --app-name="newsboat" "Finished updating."
|
|
||||||
''}";
|
|
||||||
|
|
||||||
# "${modifier}+Shift+y" = "exec ${pkgs.qutebrowser}/bin/qutebrowser";
|
# "${modifier}+Shift+y" = "exec ${pkgs.qutebrowser}/bin/qutebrowser";
|
||||||
"${modifier}+Return" = "exec ${(defaultApplications pkgs).terminal}";
|
"${modifier}+Return" = "exec ${(defaultApplications pkgs).terminal}";
|
||||||
@@ -230,12 +202,14 @@ in {
|
|||||||
"${modifier}+0" = "exec ${pkgs.scripts.menu-calc}/bin/=";
|
"${modifier}+0" = "exec ${pkgs.scripts.menu-calc}/bin/=";
|
||||||
|
|
||||||
"${modifier}+Shift+w" = "exec ${pkgs.scripts.k-lock}/bin/k-lock";
|
"${modifier}+Shift+w" = "exec ${pkgs.scripts.k-lock}/bin/k-lock";
|
||||||
"${modifier}+d" = "exec ${pkgs.writers.writeDash "run" ''exec ${pkgs.rofi}/bin/rofi -modi run,window,ssh,filebrowser -show run''}";
|
"${modifier}+a" =
|
||||||
|
"exec --no-startup-id ${pkgs.rofi}/bin/rofi -display-window — -show window";
|
||||||
|
"${modifier}+d" = "exec --no-startup-id ${pkgs.dmenu}/bin/dmenu_run";
|
||||||
"${modifier}+Shift+d" = "exec ${
|
"${modifier}+Shift+d" = "exec ${
|
||||||
pkgs.writers.writeDash "notemenu" ''
|
pkgs.writers.writeDash "notemenu" ''
|
||||||
set -efu
|
set -efu
|
||||||
PATH=$PATH:${
|
PATH=$PATH:${
|
||||||
lib.makeBinPath [pkgs.rofi pkgs.findutils pkgs.coreutils]
|
lib.makeBinPath [ pkgs.dmenu pkgs.findutils pkgs.coreutils ]
|
||||||
}
|
}
|
||||||
|
|
||||||
cd ~/notes
|
cd ~/notes
|
||||||
@@ -243,19 +217,18 @@ in {
|
|||||||
echo diary/$(date -I).md
|
echo diary/$(date -I).md
|
||||||
echo diary/$(date -I -d yesterday).md
|
echo diary/$(date -I -d yesterday).md
|
||||||
find . -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2
|
find . -type f -printf "%T@ %p\n" | sort --reverse --numeric-sort | cut --delimiter=" " --fields=2
|
||||||
} | rofi -dmenu -i -p 'notes')
|
} | dmenu -i)
|
||||||
if test "$note_file"
|
if test "$note_file"
|
||||||
then
|
then
|
||||||
i3-sensible-terminal -e "$EDITOR" "$note_file"
|
i3-sensible-terminal -e "$EDITOR" "$note_file"
|
||||||
fi
|
fi
|
||||||
''
|
''
|
||||||
}";
|
}";
|
||||||
"${modifier}+p" = "exec --no-startup-id ${pkgs.rofi-pass}/bin/rofi-pass";
|
"${modifier}+p" = "exec --no-startup-id ${pkgs.pass}/bin/passmenu -l 5";
|
||||||
"${modifier}+u" = "exec ${pkgs.scripts.unicodmenu}/bin/unicodmenu";
|
"${modifier}+u" = "exec ${pkgs.scripts.unicodmenu}/bin/unicodmenu";
|
||||||
|
|
||||||
"${modifier}+F6" = "exec ${pkgs.xorg.xkill}/bin/xkill";
|
|
||||||
"${modifier}+F7" = "exec ${pkgs.scripts.showkeys-toggle}/bin/showkeys-toggle";
|
"${modifier}+F7" = "exec ${pkgs.scripts.showkeys-toggle}/bin/showkeys-toggle";
|
||||||
"${modifier}+F8" = "exec switch-theme toggle";
|
"${modifier}+F8" = "exec ${pkgs.xorg.xkill}/bin/xkill";
|
||||||
"${modifier}+F9" = "exec ${pkgs.redshift}/bin/redshift -O 4000 -b 0.85";
|
"${modifier}+F9" = "exec ${pkgs.redshift}/bin/redshift -O 4000 -b 0.85";
|
||||||
"${modifier}+F10" = "exec ${pkgs.redshift}/bin/redshift -x";
|
"${modifier}+F10" = "exec ${pkgs.redshift}/bin/redshift -x";
|
||||||
"${modifier}+F11" = "exec ${pkgs.xcalib}/bin/xcalib -invert -alter";
|
"${modifier}+F11" = "exec ${pkgs.xcalib}/bin/xcalib -invert -alter";
|
||||||
|
|||||||
@@ -1,17 +1,13 @@
|
|||||||
{
|
{
|
||||||
networking.firewall = {
|
networking.firewall = {
|
||||||
allowedTCPPortRanges = [
|
allowedTCPPortRanges = [{
|
||||||
{
|
|
||||||
from = 1714;
|
from = 1714;
|
||||||
to = 1764;
|
to = 1764;
|
||||||
}
|
}];
|
||||||
];
|
allowedUDPPortRanges = [{
|
||||||
allowedUDPPortRanges = [
|
|
||||||
{
|
|
||||||
from = 1714;
|
from = 1714;
|
||||||
to = 1764;
|
to = 1764;
|
||||||
}
|
}];
|
||||||
];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
|
|||||||
@@ -1,50 +1,17 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
let commaSep = builtins.concatStringsSep ",";
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
commaSep = builtins.concatStringsSep ",";
|
|
||||||
xkbOptions = ["compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle"];
|
|
||||||
languages = {
|
|
||||||
de = "T3";
|
|
||||||
gr = "polytonic";
|
|
||||||
ru = "phonetic";
|
|
||||||
ara = "buckwalter";
|
|
||||||
};
|
|
||||||
defaultLanguage = "de";
|
|
||||||
in {
|
in {
|
||||||
# man 7 xkeyboard-config
|
|
||||||
services.xserver = {
|
services.xserver = {
|
||||||
layout = "de";
|
layout = commaSep [ "de" "gr" "ru" ];
|
||||||
# T3: https://upload.wikimedia.org/wikipedia/commons/a/a9/German-Keyboard-Layout-T3-Version1-large.png
|
xkbVariant = commaSep [ "T3" "polytonic" "phonetic" ];
|
||||||
# buckwalter: http://www.qamus.org/transliteration.htm
|
|
||||||
xkbVariant = "T3";
|
|
||||||
xkbOptions =
|
xkbOptions =
|
||||||
commaSep xkbOptions;
|
commaSep [ "compose:caps" "terminate:ctrl_alt_bksp" "grp:ctrls_toggle" ];
|
||||||
libinput.enable = true;
|
libinput.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
console.keyMap = "de";
|
console.keyMap = "de";
|
||||||
|
|
||||||
environment.systemPackages =
|
|
||||||
lib.mapAttrsToList
|
|
||||||
(language: variant:
|
|
||||||
pkgs.writers.writeDashBin "kb-${language}" ''
|
|
||||||
${pkgs.xorg.setxkbmap}/bin/setxkbmap ${defaultLanguage},${language} ${languages.${defaultLanguage}},${variant} ${toString (map (option: "-option ${option}") xkbOptions)}
|
|
||||||
'')
|
|
||||||
languages;
|
|
||||||
|
|
||||||
# improve held key rate
|
# improve held key rate
|
||||||
services.xserver.displayManager.sessionCommands = "${pkgs.xorg.xset}/bin/xset r rate 300 50";
|
services.xserver.displayManager.sessionCommands =
|
||||||
|
"${pkgs.xorg.xset}/bin/xset r rate 300 50";
|
||||||
systemd.user.services.gxkb = {
|
|
||||||
wantedBy = ["graphical-session.target"];
|
|
||||||
serviceConfig = {
|
|
||||||
SyslogIdentifier = "gxkb";
|
|
||||||
ExecStart = "${pkgs.gxkb}/bin/gxkb";
|
|
||||||
Restart = "always";
|
|
||||||
RestartSec = "15s";
|
|
||||||
StartLimitBurst = 0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
davHome = "~/.local/share/dav";
|
davHome = "~/.local/share/dav";
|
||||||
kmeinCloud = {
|
kmeinCloud = {
|
||||||
davEndpoint = "https://cloud.xn--kiern-0qa.de/remote.php/dav";
|
davEndpoint = "https://cloud.xn--kiern-0qa.de/remote.php/dav";
|
||||||
@@ -15,13 +11,14 @@
|
|||||||
username = "kmein";
|
username = "kmein";
|
||||||
password = lib.fileContents <secrets/nextcloud-fysi/password>;
|
password = lib.fileContents <secrets/nextcloud-fysi/password>;
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
environment.systemPackages = [pkgs.khal pkgs.vdirsyncer pkgs.khard pkgs.todoman];
|
{
|
||||||
|
environment.systemPackages = [ pkgs.khal pkgs.vdirsyncer pkgs.khard pkgs.todoman ];
|
||||||
|
|
||||||
systemd.user.services.vdirsyncer = {
|
systemd.user.services.vdirsyncer = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wants = ["network-online.target"];
|
wants = [ "network-online.target" ];
|
||||||
wantedBy = ["default.target"];
|
wantedBy = [ "default.target" ];
|
||||||
startAt = "*:00/10";
|
startAt = "*:00/10";
|
||||||
script = ''
|
script = ''
|
||||||
${pkgs.vdirsyncer}/bin/vdirsyncer sync
|
${pkgs.vdirsyncer}/bin/vdirsyncer sync
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
|
{ lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
nixpkgs-unstable = import <nixpkgs-unstable> {};
|
||||||
|
in
|
||||||
{
|
{
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
systemd.services.lb-subscription = {
|
systemd.services.lb-subscription = {
|
||||||
enable = true;
|
enable = true;
|
||||||
wants = ["network-online.target"];
|
wants = [ "network-online.target" ];
|
||||||
startAt = "weekly";
|
startAt = "weekly";
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
user = "kfm";
|
user = "kfm";
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
first_year=2019
|
first_year=2019
|
||||||
for year in $(${pkgs.coreutils}/bin/seq "$first_year" "$(date +%Y)"); do
|
for year in $(${pkgs.coreutils}/bin/seq "$first_year" "$(date +%Y)"); do
|
||||||
${pkgs.curl}/bin/curl -sSL "https://www.literarische-blaetter.de/jahrgang-$year/" \
|
${pkgs.curl}/bin/curl -sSL "https://www.literarische-blaetter.de/jahrgang-$year/" \
|
||||||
| ${pkgs.htmlq}/bin/htmlq --attribute href 'ul.slides a' \
|
| ${nixpkgs-unstable.htmlq}/bin/htmlq --attribute href 'ul.slides a' \
|
||||||
| while read -r month; do
|
| while read -r month; do
|
||||||
${pkgs.curl}/bin/curl -sSL "$month" \
|
${pkgs.curl}/bin/curl -sSL "$month" \
|
||||||
| ${pkgs.htmlq}/bin/htmlq --attribute src iframe \
|
| ${nixpkgs-unstable.htmlq}/bin/htmlq --attribute src iframe \
|
||||||
| ${pkgs.gnused}/bin/sed 's/.*?pdf=//;s/?wp-hosted.*//'
|
| ${pkgs.gnused}/bin/sed 's/.*?pdf=//;s/?wp-hosted.*//'
|
||||||
done
|
done
|
||||||
done | ${pkgs.findutils}/bin/xargs ${pkgs.wget}/bin/wget --no-clobber
|
done | ${pkgs.findutils}/bin/xargs ${pkgs.wget}/bin/wget --no-clobber
|
||||||
|
|||||||
56
configs/matterbridge.nix
Normal file
56
configs/matterbridge.nix
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
{
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super: {
|
||||||
|
matterbridge = (import (super.fetchFromGitHub {
|
||||||
|
owner = "NixOS";
|
||||||
|
repo = "nixpkgs";
|
||||||
|
rev = "e45d91ee65db293a172ec506759d1248e40c35f5";
|
||||||
|
sha256 = "03cjs5xcx09lw0djyrx2kfakw7gkg4iqmy9w25azai62im39l30k";
|
||||||
|
}) {}).matterbridge;
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
services.matterbridge = {
|
||||||
|
enable = true;
|
||||||
|
configPath =
|
||||||
|
let bridgeBotToken = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||||
|
in toString ((pkgs.formats.toml {}).generate "config.toml" {
|
||||||
|
general = {
|
||||||
|
RemoteNickFormat = "[{NICK}] ";
|
||||||
|
Charset = "utf-8";
|
||||||
|
};
|
||||||
|
telegram.kmein.Token = bridgeBotToken;
|
||||||
|
irc =
|
||||||
|
let Nick = "ponte";
|
||||||
|
in {
|
||||||
|
hackint = { Server = "irc.hackint.org:6697"; UseTLS = true; inherit Nick; };
|
||||||
|
};
|
||||||
|
mumble.lassulus = {
|
||||||
|
Server = "lassul.us:64738";
|
||||||
|
Nick = "krebs_bridge";
|
||||||
|
SkipTLSVerify = true;
|
||||||
|
};
|
||||||
|
gateway = [
|
||||||
|
{
|
||||||
|
name = "krebs-bridge";
|
||||||
|
enable = true;
|
||||||
|
inout = [
|
||||||
|
{
|
||||||
|
account = "irc.hackint";
|
||||||
|
channel = "#krebs";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
account = "telegram.kmein";
|
||||||
|
channel = "-330372458";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
account = "mumble.lassulus";
|
||||||
|
channel = 6; # "nixos"
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
41
configs/menstruation.nix
Normal file
41
configs/menstruation.nix
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
backend = pkgs.callPackage <niveum/submodules/menstruation-backend> {};
|
||||||
|
telegram = pkgs.callPackage <niveum/submodules/menstruation-telegram> {};
|
||||||
|
backendPort = 8000;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
containers.menstruation.autoStart = true;
|
||||||
|
containers.menstruation.config = { config, pkgs, ... }: {
|
||||||
|
services.redis.enable = true;
|
||||||
|
|
||||||
|
systemd.services.menstruation-telegram = {
|
||||||
|
wants = [
|
||||||
|
"network-online.target"
|
||||||
|
"menstruation-backend.service"
|
||||||
|
"redis.service"
|
||||||
|
];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
environment = {
|
||||||
|
MENSTRUATION_TOKEN = lib.strings.fileContents <system-secrets/telegram/menstruation.token>;
|
||||||
|
MENSTRUATION_ENDPOINT = "http://localhost:${toString backendPort}";
|
||||||
|
MENSTRUATION_MODERATORS = "18980945";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
DynamicUser = true;
|
||||||
|
ExecStart = "${telegram}/bin/menstruation-telegram";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.menstruation-backend = {
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
environment.ROCKET_PORT = toString backendPort;
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = "always";
|
||||||
|
DynamicUser = true;
|
||||||
|
ExecStart = "${backend}/bin/menstruation_server";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -7,8 +7,8 @@
|
|||||||
"application/pdf" = "org.pwmt.zathura.desktop";
|
"application/pdf" = "org.pwmt.zathura.desktop";
|
||||||
"application/vnd.oasis.opendocument.text" = "writer.desktop";
|
"application/vnd.oasis.opendocument.text" = "writer.desktop";
|
||||||
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop";
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "writer.desktop";
|
||||||
"image/jpeg" = "nsxiv.desktop";
|
"image/jpeg" = "sxiv.desktop";
|
||||||
"image/png" = "nsxiv.desktop";
|
"image/png" = "sxiv.desktop";
|
||||||
"image/vnd.djvu+multipage" = "org.pwmt.zathura.desktop";
|
"image/vnd.djvu+multipage" = "org.pwmt.zathura.desktop";
|
||||||
"text/html" = "brave-browser.desktop";
|
"text/html" = "brave-browser.desktop";
|
||||||
"text/markdown" = "nvim.desktop";
|
"text/markdown" = "nvim.desktop";
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
"x-scheme-handler/webcal" = "brave-browser.desktop";
|
"x-scheme-handler/webcal" = "brave-browser.desktop";
|
||||||
"inode/directory" = "pcmanfm.desktop";
|
"inode/directory" = "pcmanfm.desktop";
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,86 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.nginx.virtualHosts.default = {
|
|
||||||
locations."= /stub_status".extraConfig = "stub_status;";
|
|
||||||
};
|
|
||||||
|
|
||||||
services.prometheus = {
|
|
||||||
enable = true;
|
|
||||||
port = 9001;
|
|
||||||
exporters = {
|
|
||||||
nginx.enable = false;
|
|
||||||
node = {
|
|
||||||
enable = true;
|
|
||||||
enabledCollectors = [
|
|
||||||
"conntrack"
|
|
||||||
"diskstats"
|
|
||||||
"entropy"
|
|
||||||
"filefd"
|
|
||||||
"filesystem"
|
|
||||||
"loadavg"
|
|
||||||
"mdadm"
|
|
||||||
"meminfo"
|
|
||||||
"netdev"
|
|
||||||
"netstat"
|
|
||||||
"stat"
|
|
||||||
"time"
|
|
||||||
"vmstat"
|
|
||||||
"systemd"
|
|
||||||
"logind"
|
|
||||||
"interrupts"
|
|
||||||
"ksmd"
|
|
||||||
];
|
|
||||||
port = 9002;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [config.services.prometheus.exporters.node.port];
|
|
||||||
|
|
||||||
systemd.services.promtail = {
|
|
||||||
description = "Promtail service for Loki";
|
|
||||||
wantedBy = ["multi-user.target"];
|
|
||||||
|
|
||||||
serviceConfig = {
|
|
||||||
ExecStart = ''
|
|
||||||
${pkgs.grafana-loki}/bin/promtail --config.file ${
|
|
||||||
(pkgs.formats.yaml {}).generate "promtail.yaml" {
|
|
||||||
server = {
|
|
||||||
http_listen_port = 28183;
|
|
||||||
grpc_listen_port = 0;
|
|
||||||
};
|
|
||||||
positions.filename = "/tmp/positions.yaml";
|
|
||||||
clients = [
|
|
||||||
{
|
|
||||||
url = "http://${
|
|
||||||
if config.networking.hostName == "makanek"
|
|
||||||
then "127.0.0.1"
|
|
||||||
else "makanek.r"
|
|
||||||
}:3100/loki/api/v1/push";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
scrape_configs = [
|
|
||||||
{
|
|
||||||
job_name = "journal";
|
|
||||||
journal = {
|
|
||||||
max_age = "12h";
|
|
||||||
labels.job = "systemd-journal";
|
|
||||||
labels.host = config.networking.hostName;
|
|
||||||
};
|
|
||||||
relabel_configs = [
|
|
||||||
{
|
|
||||||
source_labels = ["__journal__systemd_unit"];
|
|
||||||
target_label = "unit";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -3,12 +3,12 @@
|
|||||||
{
|
{
|
||||||
modules.http_2xx = {
|
modules.http_2xx = {
|
||||||
http = {
|
http = {
|
||||||
fail_if_not_ssl = false;
|
fail_if_not_ssl = true;
|
||||||
ip_protocol_fallback = false;
|
ip_protocol_fallback = false;
|
||||||
method = "GET";
|
method = "GET";
|
||||||
no_follow_redirects = false;
|
no_follow_redirects = false;
|
||||||
preferred_ip_protocol = "ip4";
|
preferred_ip_protocol = "ip4";
|
||||||
valid_http_versions = ["HTTP/1.1" "HTTP/2.0"];
|
valid_http_versions = [ "HTTP/1.1" "HTTP/2.0" ];
|
||||||
tls_config.insecure_skip_verify = true;
|
tls_config.insecure_skip_verify = true;
|
||||||
};
|
};
|
||||||
prober = "http";
|
prober = "http";
|
||||||
229
configs/monitoring/pull.nix
Normal file
229
configs/monitoring/pull.nix
Normal file
@@ -0,0 +1,229 @@
|
|||||||
|
{ lib, config, pkgs, ... }:
|
||||||
|
let
|
||||||
|
lokiConfig = import ./loki.nix;
|
||||||
|
blackboxConfig = import ./blackbox.nix;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
services.grafana = {
|
||||||
|
enable = true;
|
||||||
|
domain = "grafana.kmein.r";
|
||||||
|
port = 9444;
|
||||||
|
addr = "127.0.0.1";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts.${config.services.grafana.domain} = {
|
||||||
|
locations."/" = {
|
||||||
|
proxyPass = "http://127.0.0.1:${toString config.services.grafana.port}";
|
||||||
|
proxyWebsockets = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus.rules = let diskFreeThreshold = 10; in [(builtins.toJSON {
|
||||||
|
groups = [{
|
||||||
|
name = "niveum";
|
||||||
|
rules = [
|
||||||
|
{
|
||||||
|
alert = "ServiceDown";
|
||||||
|
expr = ''node_systemd_unit_state{state="failed"} == 1'';
|
||||||
|
annotations = {
|
||||||
|
summary = "{{$labels.job}}: Service {{$labels.name}} failed to start.";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "RootPartitionFull";
|
||||||
|
for = "10m";
|
||||||
|
expr = ''(node_filesystem_free_bytes{mountpoint="/"} * 100) / node_filesystem_size_bytes{mountpoint="/"} < ${toString diskFreeThreshold}'';
|
||||||
|
annotations = {
|
||||||
|
summary = "{{ $labels.job }}: Filesystem is running out of space soon.";
|
||||||
|
description = ''The root disk of {{ $labels.job }} has {{ $value | printf "%.2f" }}% free disk space (threshold at ${toString diskFreeThreshold}%).'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "RootPartitionFullWeek";
|
||||||
|
for = "1h";
|
||||||
|
expr = ''node_filesystem_free_bytes{mountpoint="/"} ''
|
||||||
|
+ ''and predict_linear(node_filesystem_free_bytes{mountpoint="/"}[2d], 7*24*3600) <= 0'';
|
||||||
|
annotations = {
|
||||||
|
summary = "{{$labels.job}}: Filesystem is running out of space in 7 days.";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "HighLoad";
|
||||||
|
expr = ''node_load15 / on(job) count(node_cpu_seconds_total{mode="system"}) by (job) >= 1.0'';
|
||||||
|
for = "10m";
|
||||||
|
annotations = {
|
||||||
|
summary = "{{$labels.job}}: Running on high load: {{$value}}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "HighRAM";
|
||||||
|
expr = "node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes < node_memory_MemTotal_bytes * 0.1";
|
||||||
|
for = "1h";
|
||||||
|
annotations.summary = "{{$labels.job}}: Using lots of RAM.";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "UptimeMonster";
|
||||||
|
expr = "time() - node_boot_time_seconds > 2592000";
|
||||||
|
annotations.summary = "{{$labels.job}}: up for more than 30 days.";
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "HostDown";
|
||||||
|
expr = ''up == 0'';
|
||||||
|
for = "5m";
|
||||||
|
annotations = {
|
||||||
|
summary = "Host {{ $labels.job }} down for 5 minutes.";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
alert = "Reboot";
|
||||||
|
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";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}];
|
||||||
|
})];
|
||||||
|
|
||||||
|
systemd.services.alertmanager-bot-telegram =
|
||||||
|
let
|
||||||
|
alertmanager-bot-telegram = pkgs.buildGoModule rec {
|
||||||
|
pname = "alertmanager-bot";
|
||||||
|
version = "2020-07-13";
|
||||||
|
src = pkgs.fetchFromGitHub {
|
||||||
|
owner = "metalmatze";
|
||||||
|
repo = "alertmanager-bot";
|
||||||
|
rev = "5efc0bbbf8023d4324e9da98562f064a714a7206";
|
||||||
|
sha256 = "09cciml1j8x76jpm2v5v6h2q6j1fkhsz1kswslmx8wl4wk40xgp4";
|
||||||
|
};
|
||||||
|
vendorSha256 = "1v0fgin8dn81b559zz4lqmrl7hikr46g4gb18sci4riql5qs1isj";
|
||||||
|
postInstall = ''
|
||||||
|
install -D ./default.tmpl $out/templates/default.tmpl
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
in {
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "ip-up.target" ];
|
||||||
|
environment.TELEGRAM_ADMIN = "18980945";
|
||||||
|
environment.TELEGRAM_TOKEN = lib.strings.fileContents <system-secrets/telegram/prometheus.token>;
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
StateDirectory = "alertbot";
|
||||||
|
ExecStart = ''${alertmanager-bot-telegram}/bin/alertmanager-bot \
|
||||||
|
--alertmanager.url=http://localhost:9093 --log.level=info \
|
||||||
|
--store=bolt --bolt.path=/var/lib/alertbot/bot.db \
|
||||||
|
--listen.addr="0.0.0.0:16320" \
|
||||||
|
--template.paths=${pkgs.writeText "template.tmpl" ''
|
||||||
|
{{ define "telegram.default" }}
|
||||||
|
{{range .Alerts -}}
|
||||||
|
{{ if eq .Status "firing" }}
|
||||||
|
⚠ <b>{{ index .Annotations "summary"}}</b>
|
||||||
|
{{ index .Annotations "description" }}
|
||||||
|
|
||||||
|
See on Grafana: http://${config.services.grafana.domain}/d/alpUteInz/niveum
|
||||||
|
{{ else -}}
|
||||||
|
RESOLVED 😌 <del>{{ index .Annotations "summary"}}</del>
|
||||||
|
{{- end }}
|
||||||
|
{{end -}}
|
||||||
|
{{end}}
|
||||||
|
''}'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus.alertmanager = {
|
||||||
|
enable = true;
|
||||||
|
listenAddress = "localhost";
|
||||||
|
configuration = {
|
||||||
|
route = {
|
||||||
|
group_wait = "30s";
|
||||||
|
repeat_interval = "4h";
|
||||||
|
receiver = "me";
|
||||||
|
};
|
||||||
|
receivers = [{
|
||||||
|
name = "me";
|
||||||
|
webhook_configs = [{
|
||||||
|
url = "http://localhost:16320";
|
||||||
|
send_resolved = true;
|
||||||
|
}];
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus.alertmanagers = [{
|
||||||
|
scheme = "http";
|
||||||
|
path_prefix = "/";
|
||||||
|
static_configs = [ { targets = [ "localhost:9093" ]; } ];
|
||||||
|
}];
|
||||||
|
|
||||||
|
services.prometheus.scrapeConfigs = [
|
||||||
|
{
|
||||||
|
job_name = "makanek";
|
||||||
|
static_configs = [ { targets = [
|
||||||
|
"127.0.0.1:${toString config.services.prometheus.exporters.node.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
|
||||||
|
];
|
||||||
|
|
||||||
|
services.loki = {
|
||||||
|
enable = true;
|
||||||
|
configFile = (pkgs.formats.yaml {}).generate "loki.yaml" lokiConfig;
|
||||||
|
};
|
||||||
|
}
|
||||||
75
configs/monitoring/push.nix
Normal file
75
configs/monitoring/push.nix
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
{ config, pkgs, ... }:
|
||||||
|
{
|
||||||
|
services.nginx.virtualHosts.default = {
|
||||||
|
locations."= /stub_status".extraConfig = "stub_status;";
|
||||||
|
};
|
||||||
|
|
||||||
|
services.prometheus = {
|
||||||
|
enable = true;
|
||||||
|
port = 9001;
|
||||||
|
exporters = {
|
||||||
|
nginx.enable = false;
|
||||||
|
node = {
|
||||||
|
enable = true;
|
||||||
|
enabledCollectors = [
|
||||||
|
"conntrack"
|
||||||
|
"diskstats"
|
||||||
|
"entropy"
|
||||||
|
"filefd"
|
||||||
|
"filesystem"
|
||||||
|
"loadavg"
|
||||||
|
"mdadm"
|
||||||
|
"meminfo"
|
||||||
|
"netdev"
|
||||||
|
"netstat"
|
||||||
|
"stat"
|
||||||
|
"time"
|
||||||
|
"vmstat"
|
||||||
|
"systemd"
|
||||||
|
"logind"
|
||||||
|
"interrupts"
|
||||||
|
"ksmd"
|
||||||
|
];
|
||||||
|
port = 9002;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
networking.firewall.allowedTCPPorts = [ config.services.prometheus.exporters.node.port ];
|
||||||
|
|
||||||
|
systemd.services.promtail = {
|
||||||
|
description = "Promtail service for Loki";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
ExecStart = ''
|
||||||
|
${pkgs.grafana-loki}/bin/promtail --config.file ${(pkgs.formats.yaml {}).generate "promtail.yaml" {
|
||||||
|
server = {
|
||||||
|
http_listen_port = 28183;
|
||||||
|
grpc_listen_port = 0;
|
||||||
|
};
|
||||||
|
positions.filename = "/tmp/positions.yaml";
|
||||||
|
clients = [
|
||||||
|
{ url = "http://${if config.networking.hostName == "makanek" then "127.0.0.1" else "makanek.r"}:3100/loki/api/v1/push"; }
|
||||||
|
];
|
||||||
|
scrape_configs = [
|
||||||
|
{
|
||||||
|
job_name = "journal";
|
||||||
|
journal = {
|
||||||
|
max_age = "12h";
|
||||||
|
labels.job = "systemd-journal";
|
||||||
|
labels.host = config.networking.hostName;
|
||||||
|
};
|
||||||
|
relabel_configs = [
|
||||||
|
{
|
||||||
|
source_labels = [ "__journal__systemd_unit" ];
|
||||||
|
target_label = "unit";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
}}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
31
configs/moodle-dl/borsfaye.nix
Normal file
31
configs/moodle-dl/borsfaye.nix
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old: old // {
|
||||||
|
patches = [ <niveum/packages/moodle-dl/telegram-format.patch> ];
|
||||||
|
});
|
||||||
|
in
|
||||||
|
{
|
||||||
|
containers.moodle-dl-borsfaye = {
|
||||||
|
autoStart = true;
|
||||||
|
config = { lib, pkgs, ...}: {
|
||||||
|
imports = [ <niveum/modules/moodle-dl.nix> ];
|
||||||
|
|
||||||
|
services.moodle-dl = {
|
||||||
|
enable = true;
|
||||||
|
startAt = "hourly";
|
||||||
|
package = moodle-dl-package;
|
||||||
|
notifyOnly = true;
|
||||||
|
settings = {
|
||||||
|
telegram = {
|
||||||
|
token = lib.strings.fileContents <system-secrets/telegram/moodle-dl.token>;
|
||||||
|
chat_id = "311425510";
|
||||||
|
send_error_msg = false;
|
||||||
|
};
|
||||||
|
token = lib.strings.fileContents <system-secrets/moodle-dl/faye.token>;
|
||||||
|
moodle_domain = "moodle.hu-berlin.de";
|
||||||
|
moodle_path = "/";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old: old // {
|
||||||
lib,
|
patches = [ <niveum/packages/moodle-dl/telegram-format.patch> ];
|
||||||
...
|
|
||||||
}: let
|
|
||||||
moodle-dl-package = pkgs.moodle-dl.overrideAttrs (old:
|
|
||||||
old
|
|
||||||
// {
|
|
||||||
patches = [<niveum/packages/moodle-dl/telegram-format.patch>];
|
|
||||||
});
|
});
|
||||||
in {
|
in
|
||||||
imports = [<niveum/modules/moodle-dl.nix>];
|
{
|
||||||
|
imports = [ <niveum/modules/moodle-dl.nix> ];
|
||||||
|
|
||||||
services.moodle-dl = {
|
services.moodle-dl = {
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -69,16 +64,6 @@ in {
|
|||||||
108283 # Digital Classicist
|
108283 # Digital Classicist
|
||||||
109211 # Altlitauisch
|
109211 # Altlitauisch
|
||||||
109185 # Etymologie
|
109185 # Etymologie
|
||||||
|
|
||||||
# SS 2022
|
|
||||||
112606 # Avestisch
|
|
||||||
111761 # Griechische Wissenschaftsliteratur
|
|
||||||
111515 # H. Furens
|
|
||||||
110914 # Apostelgeschichte
|
|
||||||
112225 # Gr. Paläographie
|
|
||||||
113275 # ALEW
|
|
||||||
112783 # Akzent und Silbenstruktur
|
|
||||||
113493 # Papyrologie
|
|
||||||
];
|
];
|
||||||
download_submissions = true;
|
download_submissions = true;
|
||||||
download_descriptions = true;
|
download_descriptions = true;
|
||||||
@@ -92,14 +77,13 @@ in {
|
|||||||
|
|
||||||
fileSystems."/export/moodle" = {
|
fileSystems."/export/moodle" = {
|
||||||
device = config.services.moodle-dl.directory;
|
device = config.services.moodle-dl.directory;
|
||||||
options = ["bind"];
|
options = [ "bind" ];
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [2049];
|
networking.firewall.allowedTCPPorts = [ 2049 ];
|
||||||
|
|
||||||
services.nginx.enable = true;
|
services.nginx.virtualHosts."moodle.kmein.r" =
|
||||||
|
let
|
||||||
services.nginx.virtualHosts."moodle.kmein.r" = let
|
|
||||||
identity = lib.strings.fileContents <secrets/eduroam/identity>;
|
identity = lib.strings.fileContents <secrets/eduroam/identity>;
|
||||||
password = lib.strings.fileContents <secrets/eduroam/password>;
|
password = lib.strings.fileContents <secrets/eduroam/password>;
|
||||||
in {
|
in {
|
||||||
@@ -115,9 +99,7 @@ in {
|
|||||||
|
|
||||||
services.nfs.server = {
|
services.nfs.server = {
|
||||||
enable = true;
|
enable = true;
|
||||||
exports = let
|
exports = let machines = with (import <niveum/lib>).retiolumAddresses; [kabsa manakish]; in ''
|
||||||
machines = with (import <niveum/lib>).retiolumAddresses; [kabsa manakish];
|
|
||||||
in ''
|
|
||||||
/export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines}
|
/export ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(fsid=0)") machines}
|
||||||
/export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines}
|
/export/moodle ${lib.concatMapStringsSep " " (machine: "${machine.ipv4}(insecure,rw)") machines}
|
||||||
'';
|
'';
|
||||||
@@ -1,27 +1,14 @@
|
|||||||
{
|
{ pkgs, lib, ... }: let
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
|
swallow = command: "${pkgs.scripts.swallow}/bin/swallow ${command}";
|
||||||
in {
|
in {
|
||||||
environment.shellAliases.smpv = swallow "mpv";
|
environment.shellAliases.smpv = swallow "mpv";
|
||||||
|
|
||||||
nixpkgs.overlays = [
|
|
||||||
(self: super: {
|
|
||||||
mpv = config.home-manager.users.me.programs.mpv.finalPackage;
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
home-manager.users.me = {
|
home-manager.users.me = {
|
||||||
programs.mpv = {
|
programs.mpv = {
|
||||||
enable = true;
|
enable = true;
|
||||||
config = {
|
config = {
|
||||||
ytdl-format = "bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best";
|
ytdl-raw-options = lib.concatStringsSep "," [ ''sub-lang="de,en"'' "write-sub=" "write-auto-sub=" ];
|
||||||
ytdl-raw-options = lib.concatStringsSep "," [''sub-lang="de,en"'' "write-sub=" "write-auto-sub="];
|
|
||||||
screenshot-template = "%F-%wH%wM%wS-%#04n";
|
screenshot-template = "%F-%wH%wM%wS-%#04n";
|
||||||
script-opts = "ytdl_hook-ytdl_path=${pkgs.yt-dlp}/bin/yt-dlp";
|
|
||||||
};
|
};
|
||||||
bindings = {
|
bindings = {
|
||||||
"Alt+RIGHT" = "add video-rotate 90";
|
"Alt+RIGHT" = "add video-rotate 90";
|
||||||
@@ -34,8 +21,7 @@ in {
|
|||||||
"Alt+j" = "add video-pan-y -0.05";
|
"Alt+j" = "add video-pan-y -0.05";
|
||||||
};
|
};
|
||||||
scripts = [
|
scripts = [
|
||||||
pkgs.mpvScripts.youtube-quality
|
pkgs.unstable.mpvScripts.youtube-quality
|
||||||
(pkgs.callPackage <niveum/packages/mpv-visualizer.nix> {})
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
38
configs/names.nix
Normal file
38
configs/names.nix
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
port = 5703;
|
||||||
|
geogen = (pkgs.fetchFromGitHub {
|
||||||
|
owner = "kmein";
|
||||||
|
repo = "scripts";
|
||||||
|
rev = "8945430f27a8c6fd632dd35382cb094abe3543ff";
|
||||||
|
sha256 = "1djyxkynypxsrmdf6idgjszqpcgqyq607rrsvl58p2bpymmwibzb";
|
||||||
|
}) + "/onomastics";
|
||||||
|
inherit (pkgs.callPackage geogen {}) dependencyEnv;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
systemd.services.names = {
|
||||||
|
wants = [ "network-online.target" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
description = "Better clone of geogen.stoepel.net";
|
||||||
|
serviceConfig = {
|
||||||
|
DynamicUser = true;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
cd $(mktemp -d)
|
||||||
|
ln -s "${geogen}/wsgi.py" wsgi.py
|
||||||
|
${dependencyEnv}/bin/gunicorn wsgi:app -b :${toString port}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx = {
|
||||||
|
enable = true;
|
||||||
|
recommendedGzipSettings = true;
|
||||||
|
recommendedOptimisation = true;
|
||||||
|
recommendedProxySettings = true;
|
||||||
|
recommendedTlsSettings = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."names.kmein.r" = {
|
||||||
|
locations."/".proxyPass = "http://127.0.0.1:${toString port}";
|
||||||
|
};
|
||||||
|
}
|
||||||
10
configs/nano.nix
Normal file
10
configs/nano.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
programs.nano.nanorc = ''
|
||||||
|
set autoindent
|
||||||
|
set boldtext
|
||||||
|
set morespace
|
||||||
|
set smarthome
|
||||||
|
set tabsize 4
|
||||||
|
set tabstospaces
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -1,41 +1,134 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
mainMailbox = "posteo";
|
mainMailbox = "posteo";
|
||||||
|
|
||||||
accounts = import <niveum/lib/email.nix> {inherit lib mainMailbox;};
|
accounts.uni = {
|
||||||
in {
|
user = "meinhark";
|
||||||
environment.systemPackages = [pkgs.neomutt];
|
password = lib.strings.fileContents <secrets/eduroam/password>;
|
||||||
|
address = "kieran.felix.meinhardt@hu-berlin.de";
|
||||||
|
imap = "mailbox.cms.hu-berlin.de";
|
||||||
|
smtp = "mailhost.cms.hu-berlin.de";
|
||||||
|
smtpSettings = smtp: "smtp://${smtp}";
|
||||||
|
folders = {
|
||||||
|
drafts = "Drafts";
|
||||||
|
sent = "Sent";
|
||||||
|
trash = "Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.uni-old = {
|
||||||
|
user = "meinhark";
|
||||||
|
password = lib.strings.fileContents <secrets/eduroam/password>;
|
||||||
|
address = "meinhark@informatik.hu-berlin.de";
|
||||||
|
imap = "mailbox.informatik.hu-berlin.de";
|
||||||
|
smtp = "mailhost.informatik.hu-berlin.de";
|
||||||
|
smtpSettings = smtp: "smtp://${smtp}";
|
||||||
|
folders = {
|
||||||
|
drafts = "Drafts";
|
||||||
|
sent = "Sent";
|
||||||
|
trash = "Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.work-uni = {
|
||||||
|
user = "meinhaki";
|
||||||
|
password = lib.strings.fileContents <secrets/mail/meinhaki>;
|
||||||
|
address = "kieran.meinhardt@hu-berlin.de";
|
||||||
|
imap = "mailbox.cms.hu-berlin.de";
|
||||||
|
smtp = "mailhost.cms.hu-berlin.de";
|
||||||
|
smtpSettings = smtp: "smtp://${smtp}";
|
||||||
|
folders = {
|
||||||
|
drafts = "Drafts";
|
||||||
|
sent = "Sent";
|
||||||
|
trash = "Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.work-fysi = rec {
|
||||||
|
user = "kieran@fysi.tech";
|
||||||
|
address = user;
|
||||||
|
password = lib.strings.fileContents <secrets/mail/fastmail>;
|
||||||
|
imap = "imap.fastmail.com";
|
||||||
|
smtp = "smtp.fastmail.com";
|
||||||
|
smtpSettings = smtp: "smtps://${smtp}:465";
|
||||||
|
folders = {
|
||||||
|
drafts = "Drafts";
|
||||||
|
sent = "Sent";
|
||||||
|
trash = "Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.cock = rec {
|
||||||
|
user = "2210@cock.li";
|
||||||
|
address = user;
|
||||||
|
password = lib.strings.fileContents <secrets/mail/cock>;
|
||||||
|
imap = "mail.cock.li";
|
||||||
|
smtp = imap;
|
||||||
|
smtpSettings = smtp: "smtp://${smtp}:587";
|
||||||
|
folders = {
|
||||||
|
drafts = "Drafts";
|
||||||
|
sent = "Sent";
|
||||||
|
trash = "Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts."${mainMailbox}" = rec {
|
||||||
|
user = "kieran.meinhardt@posteo.net";
|
||||||
|
address = user;
|
||||||
|
password = lib.strings.fileContents <secrets/mail/posteo>;
|
||||||
|
imap = "posteo.de";
|
||||||
|
smtp = imap;
|
||||||
|
smtpSettings = smtp: "smtp://${smtp}";
|
||||||
|
folders = {
|
||||||
|
drafts = "Drafts";
|
||||||
|
sent = "Sent";
|
||||||
|
trash = "Trash";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.google-amro = rec {
|
||||||
|
user = "amroplay@gmail.com";
|
||||||
|
address = user;
|
||||||
|
password = lib.strings.fileContents <secrets/mail/gmail/amroplay>;
|
||||||
|
imap = "imap.gmail.com";
|
||||||
|
smtp = "smtp.gmail.com";
|
||||||
|
smtpSettings = smtp: "smtps://${smtp}:465";
|
||||||
|
folders = {
|
||||||
|
drafts = "[Gmail]/Drafts";
|
||||||
|
sent = "[Gmail]/Sent Mail";
|
||||||
|
trash = "[Gmail]/Bin";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
accounts.google-kieran = rec {
|
||||||
|
user = "kieran.meinhardt@gmail.com";
|
||||||
|
address = user;
|
||||||
|
password = lib.strings.fileContents <secrets/mail/gmail/kieran.meinhardt>;
|
||||||
|
imap = "imap.gmail.com";
|
||||||
|
smtp = "smtp.gmail.com";
|
||||||
|
smtpSettings = smtp: "smtps://${smtp}:465";
|
||||||
|
folders = {
|
||||||
|
drafts = "[Gmail]/Entwürfe";
|
||||||
|
sent = "[Gmail]/Gesendet";
|
||||||
|
trash = "[Gmail]/Papierkorb";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = [ pkgs.neomutt ];
|
||||||
environment.shellAliases.mua = "${pkgs.neomutt}/bin/neomutt -f ${mainMailbox}←";
|
environment.shellAliases.mua = "${pkgs.neomutt}/bin/neomutt -f ${mainMailbox}←";
|
||||||
|
|
||||||
home-manager.users.me.xdg.configFile."neomutt/neomuttrc".text = let
|
home-manager.users.me.xdg.configFile."neomutt/neomuttrc".text = ''
|
||||||
as-pdf = pkgs.writers.writeDash "as-pdf" ''
|
set mailcap_path = ${pkgs.writeText "mailcap" ''
|
||||||
d=$(mktemp -d)
|
|
||||||
trap clean EXIT
|
|
||||||
clean() {
|
|
||||||
rm -rf "$d"
|
|
||||||
}
|
|
||||||
${pkgs.libreoffice}/bin/libreoffice --headless --convert-to pdf "$1" --outdir "$d"
|
|
||||||
${pkgs.zathura}/bin/zathura "$d"/*.pdf
|
|
||||||
'';
|
|
||||||
in ''
|
|
||||||
set mailcap_path = ${
|
|
||||||
pkgs.writeText "mailcap" ''
|
|
||||||
text/plain; $EDITOR %s ;
|
text/plain; $EDITOR %s ;
|
||||||
text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
|
text/html; ${pkgs.lynx}/bin/lynx -assume_charset=%{charset} -display_charset=utf-8 -dump %s; nametemplate=%s.html; copiousoutput;
|
||||||
image/*; ${pkgs.nsxiv}/bin/nsxiv %s ;
|
image/*; ${pkgs.sxiv}/bin/sxiv %s ;
|
||||||
video/*; ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput
|
video/*; ${pkgs.utillinux}/bin/setsid ${pkgs.mpv}/bin/mpv --quiet %s &; copiousoutput
|
||||||
audio/*; ${pkgs.mpv}/bin/mpv %s ;
|
audio/*; ${pkgs.mpv}/bin/mpv %s ;
|
||||||
application/pdf; ${pkgs.zathura}/bin/zathura %s ;
|
application/pdf; ${pkgs.zathura}/bin/zathura %s ;
|
||||||
application/pgp-encrypted; ${pkgs.gnupg}/bin/gpg -d '%s'; copiousoutput;
|
application/pgp-encrypted; ${pkgs.gnupg}/bin/gpg -d '%s'; copiousoutput;
|
||||||
application/pgp-keys; ${pkgs.gnupg}/bin/gpg --import '%s'; copiousoutput;
|
application/pgp-keys; ${pkgs.gnupg}/bin/gpg --import '%s'; copiousoutput;
|
||||||
application/vnd.openxmlformats-officedocument.wordprocessingml.document; ${as-pdf} %s;
|
''}:$mailcap_path
|
||||||
application/vnd.oasis.opendocument.text; ${as-pdf} %s;
|
|
||||||
application/vnd.openxmlformats*; ${pkgs.libreoffice}/bin/soffice '%s';
|
|
||||||
''
|
|
||||||
}:$mailcap_path
|
|
||||||
|
|
||||||
set sidebar_visible
|
set sidebar_visible
|
||||||
set sidebar_format = "%D%?F? [%F]?%* %?N?%N/?%S"
|
set sidebar_format = "%D%?F? [%F]?%* %?N?%N/?%S"
|
||||||
@@ -87,39 +180,31 @@ in {
|
|||||||
|
|
||||||
set header_cache="~/.cache/mutt" message_cachedir="~/.cache/mutt"
|
set header_cache="~/.cache/mutt" message_cachedir="~/.cache/mutt"
|
||||||
|
|
||||||
source ${
|
source ${pkgs.writeText "accounts.neomuttrc" ''
|
||||||
pkgs.writeText "accounts.neomuttrc" ''
|
|
||||||
set realname = "Kierán Meinhardt"
|
set realname = "Kierán Meinhardt"
|
||||||
account-hook . 'unset imap_user imap_pass smtp_user smtp_pass'
|
account-hook . 'unset imap_user imap_pass smtp_user smtp_pass'
|
||||||
# set accordingly: postponed trash record
|
# set accordingly: postponed trash record
|
||||||
${
|
${lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: let imapRoot = "imaps://${account.user}@${account.imap}"; in ''
|
||||||
lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: let
|
|
||||||
imapRoot = "imaps://${account.user}@${account.imap}";
|
|
||||||
in ''
|
|
||||||
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
|
account-hook ${account.user}@${account.imap} 'set imap_user="${account.user}" imap_pass="${account.password}"'
|
||||||
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
|
account-hook ${account.user}@${account.smtp} 'set smtp_user="${account.user}" smtp_pass="${account.password}"'
|
||||||
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
|
folder-hook ${account.user}@${account.imap} 'set smtp_url="${account.smtpSettings "${account.user}@${account.smtp}"}" from="${account.address}" record="${imapRoot}/${account.folders.sent}" postponed="${imapRoot}/${account.folders.drafts}" trash="${imapRoot}/${account.folders.trash}"'
|
||||||
named-mailboxes "${name}←" "${imapRoot}" "${name}→" "${imapRoot}/${account.folders.sent}"
|
named-mailboxes "${name}←" "${imapRoot}" "${name}→" "${imapRoot}/${account.folders.sent}"
|
||||||
'')
|
'') accounts)}
|
||||||
accounts)
|
''}
|
||||||
}
|
|
||||||
''
|
|
||||||
}
|
|
||||||
|
|
||||||
set spoolfile="${mainMailbox}"
|
set spoolfile="${mainMailbox}"
|
||||||
|
|
||||||
source ${
|
source ${pkgs.writeText "colors.neomuttrc" ''
|
||||||
pkgs.writeText "colors.neomuttrc" ''
|
|
||||||
# Default index colors:
|
# Default index colors:
|
||||||
color index_number blue default
|
color index_number blue default
|
||||||
color index red default '.*'
|
color index red default '.*'
|
||||||
color index_flags lightcyan default '.*'
|
color index_flags lightcyan default '.*'
|
||||||
color index_author yellow default '.*'
|
color index_author yellow default '.*'
|
||||||
color index_subject default default '.*'
|
color index_subject lightblack default '.*'
|
||||||
|
|
||||||
# New mail is boldened:
|
# New mail is boldened:
|
||||||
color index_author lightyellow default "~N"
|
color index_author lightyellow black "~N"
|
||||||
color index_subject lightwhite default "~N"
|
color index_subject lightwhite black "~N"
|
||||||
|
|
||||||
# Flagged mail is highlighted:
|
# Flagged mail is highlighted:
|
||||||
color index_flags lightmagenta default '~F'
|
color index_flags lightmagenta default '~F'
|
||||||
@@ -158,7 +243,6 @@ in {
|
|||||||
mono body bold "^gpg: Good signature"
|
mono body bold "^gpg: Good signature"
|
||||||
mono body bold "^gpg: BAD signature from.*"
|
mono body bold "^gpg: BAD signature from.*"
|
||||||
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
|
color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]"
|
||||||
''
|
''}
|
||||||
}
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
{pkgs, ...}: {
|
{ pkgs, ... }: {
|
||||||
environment.variables.EDITOR = pkgs.lib.mkForce "nvim";
|
environment.variables.EDITOR = pkgs.lib.mkForce "nvim";
|
||||||
environment.shellAliases.vi = "nvim";
|
environment.shellAliases.vi = "nvim";
|
||||||
environment.shellAliases.vim = "nvim";
|
environment.shellAliases.vim = "nvim";
|
||||||
environment.shellAliases.view = "nvim -R";
|
environment.shellAliases.view = "nvim -R";
|
||||||
|
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
vimPlugins =
|
vimPlugins = pkgs.vimPlugins // {
|
||||||
pkgs.vimPlugins
|
cheat-sh-vim = pkgs.callPackage <niveum/packages/vimPlugins/cheat-sh.nix> { };
|
||||||
// {
|
vim-fetch = pkgs.callPackage <niveum/packages/vimPlugins/vim-fetch.nix> { };
|
||||||
cheat-sh-vim = pkgs.callPackage <niveum/packages/vimPlugins/cheat-sh.nix> {};
|
vim-colors-paramount = pkgs.callPackage <niveum/packages/vimPlugins/vim-colors-paramount.nix> { };
|
||||||
vim-fetch = pkgs.callPackage <niveum/packages/vimPlugins/vim-fetch.nix> {};
|
vim-256noir = pkgs.callPackage <niveum/packages/vimPlugins/vim-256noir.nix> { };
|
||||||
vim-colors-paramount = pkgs.callPackage <niveum/packages/vimPlugins/vim-colors-paramount.nix> {};
|
icalendar-vim = pkgs.callPackage <niveum/packages/vimPlugins/icalendar-vim.nix> { };
|
||||||
vim-256noir = pkgs.callPackage <niveum/packages/vimPlugins/vim-256noir.nix> {};
|
jq-vim = pkgs.callPackage <niveum/packages/vimPlugins/jq-vim.nix> { };
|
||||||
icalendar-vim = pkgs.callPackage <niveum/packages/vimPlugins/icalendar-vim.nix> {};
|
vim-fsharp = pkgs.callPackage <niveum/packages/vimPlugins/vim-fsharp.nix> { };
|
||||||
jq-vim = pkgs.callPackage <niveum/packages/vimPlugins/jq-vim.nix> {};
|
vim-reason-plus = pkgs.callPackage <niveum/packages/vimPlugins/vim-reason-plus.nix> { };
|
||||||
vim-fsharp = pkgs.callPackage <niveum/packages/vimPlugins/vim-fsharp.nix> {};
|
vim-mail = pkgs.callPackage <niveum/packages/vimPlugins/vim-mail.nix> { };
|
||||||
vim-reason-plus = pkgs.callPackage <niveum/packages/vimPlugins/vim-reason-plus.nix> {};
|
|
||||||
vim-mail = pkgs.callPackage <niveum/packages/vimPlugins/vim-mail.nix> {};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -33,7 +31,7 @@
|
|||||||
supertab
|
supertab
|
||||||
undotree
|
undotree
|
||||||
tabular
|
tabular
|
||||||
# vimwiki
|
vimwiki
|
||||||
vim-colors-paramount
|
vim-colors-paramount
|
||||||
vim-commentary
|
vim-commentary
|
||||||
vim-css-color
|
vim-css-color
|
||||||
@@ -44,31 +42,29 @@
|
|||||||
vim-repeat
|
vim-repeat
|
||||||
vim-sensible
|
vim-sensible
|
||||||
vim-surround
|
vim-surround
|
||||||
(pkgs.vimUtils.buildVimPlugin {
|
|
||||||
name = "vim-dim-1.1.0";
|
|
||||||
src = pkgs.fetchFromGitHub {
|
|
||||||
owner = "jeffkreeftmeijer";
|
|
||||||
repo = "vim-dim";
|
|
||||||
rev = "1.1.0";
|
|
||||||
sha256 = "sha256-lyTZUgqUEEJRrzGo1FD8/t8KBioPrtB3MmGvPeEVI/g=";
|
|
||||||
};
|
|
||||||
})
|
|
||||||
];
|
];
|
||||||
opt = [
|
opt = [
|
||||||
csv
|
csv
|
||||||
|
dhall-vim
|
||||||
elm-vim
|
elm-vim
|
||||||
emmet-vim
|
emmet-vim
|
||||||
haskell-vim
|
haskell-vim
|
||||||
icalendar-vim
|
icalendar-vim
|
||||||
|
idris-vim
|
||||||
|
nim-vim
|
||||||
jq-vim
|
jq-vim
|
||||||
|
purescript-vim
|
||||||
rust-vim
|
rust-vim
|
||||||
typescript-vim
|
typescript-vim
|
||||||
|
vim-fsharp
|
||||||
vim-javascript
|
vim-javascript
|
||||||
vim-ledger
|
vim-ledger
|
||||||
vim-nix
|
vim-nix
|
||||||
|
vim-reason-plus
|
||||||
|
vim-toml
|
||||||
vimtex
|
vimtex
|
||||||
vim-pandoc
|
vim-pandoc
|
||||||
vim-pandoc-syntax
|
vim-pandoc-syntax # vim-pandoc-after
|
||||||
vim-256noir
|
vim-256noir
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
{
|
{ lib, pkgs, ... }:
|
||||||
lib,
|
let
|
||||||
pkgs,
|
profile = name: custom: lib.recursiveUpdate {
|
||||||
...
|
|
||||||
}: let
|
|
||||||
profile = name: custom:
|
|
||||||
lib.recursiveUpdate {
|
|
||||||
connection.id = name;
|
connection.id = name;
|
||||||
connection.type = "wifi";
|
connection.type = "wifi";
|
||||||
connection.interface-name = "wlp3s0";
|
connection.interface-name = "wlp3s0";
|
||||||
@@ -18,8 +14,7 @@
|
|||||||
ipv6.dns-search = "";
|
ipv6.dns-search = "";
|
||||||
ipv6.method = "auto";
|
ipv6.method = "auto";
|
||||||
proxy = {};
|
proxy = {};
|
||||||
}
|
} custom;
|
||||||
custom;
|
|
||||||
eduroamProfile = {
|
eduroamProfile = {
|
||||||
connection.uuid = "eae9fee6-a7d2-4120-a609-440b457d6fcf";
|
connection.uuid = "eae9fee6-a7d2-4120-a609-440b457d6fcf";
|
||||||
wifi-security = {
|
wifi-security = {
|
||||||
@@ -41,20 +36,15 @@
|
|||||||
phase2-auth = "pap";
|
phase2-auth = "pap";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
in {
|
in
|
||||||
imports = [<niveum/modules/networkmanager-declarative.nix>];
|
{
|
||||||
|
imports = [ ../modules/networkmanager-declarative.nix ];
|
||||||
programs.nm-applet.enable = true;
|
|
||||||
|
|
||||||
networking.networkmanager = {
|
networking.networkmanager = {
|
||||||
enable = true;
|
enable = true;
|
||||||
plugins = [
|
|
||||||
pkgs.networkmanager-openvpn
|
|
||||||
pkgs.networkmanager-fortisslvpn
|
|
||||||
];
|
|
||||||
wifi.macAddress = "random";
|
wifi.macAddress = "random";
|
||||||
ethernet.macAddress = "random";
|
ethernet.macAddress = "random";
|
||||||
unmanaged = ["docker*"];
|
unmanaged = [ "docker*" ];
|
||||||
profiles = lib.mapAttrs profile {
|
profiles = lib.mapAttrs profile {
|
||||||
Aether = {
|
Aether = {
|
||||||
connection.uuid = "7138bb0f-1aeb-4905-890e-a6628427aa21";
|
connection.uuid = "7138bb0f-1aeb-4905-890e-a6628427aa21";
|
||||||
@@ -90,12 +80,7 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.me.extraGroups = ["networkmanager"];
|
users.users.me.extraGroups = [ "networkmanager" ];
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [ pkgs.speedtest-cli ];
|
||||||
pkgs.speedtest-cli
|
|
||||||
pkgs.networkmanager-openvpn
|
|
||||||
pkgs.networkmanagerapplet
|
|
||||||
pkgs.networkmanager-fortisslvpn
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,11 @@
|
|||||||
{
|
{ pkgs, config, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
ytdl-format = "'bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best'";
|
ytdl-format = "'bestvideo[height<=?720][fps<=?30][vcodec!=?vp9]+bestaudio/best'";
|
||||||
|
|
||||||
youtube-download = "${pkgs.ts}/bin/ts ${pkgs.yt-dlp}/bin/yt-dlp -f ${ytdl-format} --add-metadata";
|
youtube-download = "${pkgs.ts}/bin/ts ${pkgs.youtube-dl}/bin/youtube-dl -f ${ytdl-format} --add-metadata";
|
||||||
|
|
||||||
newsboat-home = "${config.users.users.me.home}/cloud/Seafile/Documents/newsboat";
|
newsboat-home =
|
||||||
|
"${config.users.users.me.home}/cloud/Seafile/Documents/newsboat";
|
||||||
linkhandler-bin = "${pkgs.scripts.linkhandler}/bin/linkhandler";
|
linkhandler-bin = "${pkgs.scripts.linkhandler}/bin/linkhandler";
|
||||||
|
|
||||||
newsboat-config = pkgs.writeText "config" ''
|
newsboat-config = pkgs.writeText "config" ''
|
||||||
@@ -50,7 +48,7 @@
|
|||||||
save-path ${newsboat-home}/saved/
|
save-path ${newsboat-home}/saved/
|
||||||
|
|
||||||
highlight all "---.*---" yellow default
|
highlight all "---.*---" yellow default
|
||||||
# highlight feedlist ".*(0/0))" default default
|
highlight feedlist ".*(0/0))" black default
|
||||||
highlight article "^Title:.*" yellow default bold
|
highlight article "^Title:.*" yellow default bold
|
||||||
highlight article "^Author:.*" yellow default
|
highlight article "^Author:.*" yellow default
|
||||||
highlight article "^Flags:.*" red default
|
highlight article "^Flags:.*" red default
|
||||||
@@ -58,12 +56,14 @@
|
|||||||
highlight article "\\[image [0-9][0-9]*\\]" color109 default bold
|
highlight article "\\[image [0-9][0-9]*\\]" color109 default bold
|
||||||
highlight article "\\[embedded flash: [0-9][0-9]*\\]" color66 default bold
|
highlight article "\\[embedded flash: [0-9][0-9]*\\]" color66 default bold
|
||||||
|
|
||||||
|
color background white default
|
||||||
|
color listnormal white default
|
||||||
|
color listnormal_unread white default bold
|
||||||
color listfocus blue default
|
color listfocus blue default
|
||||||
color listfocus_unread blue default bold
|
color listfocus_unread blue default bold
|
||||||
color info red default bold
|
color info red default bold
|
||||||
|
color article white default
|
||||||
'';
|
'';
|
||||||
|
|
||||||
newsboat-sql = "${pkgs.sqlite}/bin/sqlite3 ${newsboat-home}/cache.db";
|
|
||||||
in {
|
in {
|
||||||
nixpkgs.config.packageOverrides = pkgs: {
|
nixpkgs.config.packageOverrides = pkgs: {
|
||||||
newsboat = pkgs.writers.writeDashBin "newsboat" ''
|
newsboat = pkgs.writers.writeDashBin "newsboat" ''
|
||||||
@@ -73,23 +73,8 @@ in {
|
|||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
pkgs.newsboat
|
pkgs.newsboat
|
||||||
(pkgs.writers.writeDashBin "newsboat-unread-count" ''
|
|
||||||
if [ -f ${newsboat-home}/cache.db.lock ]; then
|
|
||||||
${pkgs.jq}/bin/jq -n '{state: "Info", text: "↻", icon: "rss"}'
|
|
||||||
else
|
|
||||||
|
|
||||||
${pkgs.jq}/bin/jq -n \
|
|
||||||
--argjson unread "$(${newsboat-sql} "SELECT COUNT(DISTINCT id) FROM rss_item WHERE unread=1")" \
|
|
||||||
--argjson watchLater "$(${newsboat-sql} "SELECT COUNT(DISTINCT id) FROM rss_item WHERE flags='e' AND deleted=0")" \
|
|
||||||
'{
|
|
||||||
state: (if $unread > 0 then "Good" else "Idle" end),
|
|
||||||
text: (if $unread > 0 then "\($unread)" else "[\($watchLater)]" end),
|
|
||||||
icon: "rss"
|
|
||||||
}'
|
|
||||||
fi
|
|
||||||
'')
|
|
||||||
(pkgs.writers.writeDashBin "mpv-watch-later" ''
|
(pkgs.writers.writeDashBin "mpv-watch-later" ''
|
||||||
${newsboat-sql} "SELECT url FROM rss_item WHERE flags='e' AND deleted=0 ORDER BY pubDate DESC" \
|
${pkgs.sqlite}/bin/sqlite3 ${newsboat-home}/cache.db "SELECT url FROM rss_item WHERE flags='e' AND deleted=0 ORDER BY pubDate DESC" \
|
||||||
| ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv
|
| ${pkgs.findutils}/bin/xargs ${pkgs.mpv}/bin/mpv
|
||||||
'')
|
'')
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,15 +1,12 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
passwordFile = path: toString (pkgs.writeText "password" (lib.strings.fileContents path));
|
passwordFile = path: toString (pkgs.writeText "password" (lib.strings.fileContents path));
|
||||||
inherit (import <niveum/lib>) localAddresses;
|
inherit (import <niveum/lib>) localAddresses;
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
services.nextcloud = {
|
services.nextcloud = {
|
||||||
enable = true;
|
enable = true;
|
||||||
package = pkgs.nextcloud24;
|
package = pkgs.nextcloud22;
|
||||||
|
|
||||||
https = true;
|
https = true;
|
||||||
|
|
||||||
@@ -34,17 +31,9 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Nextcloud";
|
|
||||||
link = "https://${config.services.nextcloud.hostName}";
|
|
||||||
description = "manages calendars, to-do lists, files, and recipes.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
services.postgresql = {
|
services.postgresql = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ensureDatabases = ["nextcloud"];
|
ensureDatabases = [ "nextcloud" ];
|
||||||
ensureUsers = [
|
ensureUsers = [
|
||||||
{
|
{
|
||||||
name = "nextcloud";
|
name = "nextcloud";
|
||||||
@@ -53,6 +42,7 @@ in {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
services.nginx.virtualHosts."cloud.xn--kiern-0qa.de" = {
|
services.nginx.virtualHosts."cloud.xn--kiern-0qa.de" = {
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
{pkgs, ...}: {
|
|
||||||
nixpkgs = {
|
|
||||||
config.allowUnfree = true;
|
|
||||||
overlays = [
|
|
||||||
(import <nix-writers/pkgs>)
|
|
||||||
(import <stockholm/krebs/5pkgs>)
|
|
||||||
];
|
|
||||||
};
|
|
||||||
nix = {
|
|
||||||
package = pkgs.nixUnstable;
|
|
||||||
extraOptions = "experimental-features = nix-command flakes";
|
|
||||||
settings = {
|
|
||||||
substituters = [
|
|
||||||
"http://cache.prism.r"
|
|
||||||
"https://cache.nixos.org/"
|
|
||||||
];
|
|
||||||
trusted-public-keys = [
|
|
||||||
"cache.prism-1:+S+6Lo/n27XEtvdlQKuJIcb1yO5NUqUCE2lolmTgNJU="
|
|
||||||
"cache.prism-2:YwmCm3/s/D+SxrPKN/ETjlpw/219pNUbpnluatp6FKI="
|
|
||||||
"hydra.nixos.org-1:CNHJZBh9K4tP3EKF6FkkgeVYsS3ohTl+oS0Qa8bezVs="
|
|
||||||
];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
important-directories = pkgs.writeText "directories" ''
|
|
||||||
h ~/
|
|
||||||
d ~/cloud/Dropbox/
|
|
||||||
g ~/cloud/gdrive/
|
|
||||||
s ~/cloud/Seafile/
|
|
||||||
kk ~/cloud/keybase/private/kmein/
|
|
||||||
kp ~/cloud/keybase/public/kmein/
|
|
||||||
t /tmp
|
|
||||||
D ~/Downloads
|
|
||||||
cf ''${XDG_CONFIG_HOME:-$HOME/.config}
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
environment.systemPackages = [pkgs.nsxiv];
|
|
||||||
|
|
||||||
# TODO fix
|
|
||||||
home-manager.users.me.xdg.configFile."nsxiv/exec/key-handler".source = pkgs.writers.writeDash "key-handler" ''
|
|
||||||
PATH=$PATH:${
|
|
||||||
lib.makeBinPath [
|
|
||||||
pkgs.gnused
|
|
||||||
pkgs.gawk
|
|
||||||
pkgs.dmenu
|
|
||||||
pkgs.coreutils
|
|
||||||
pkgs.libnotify
|
|
||||||
pkgs.imagemagick
|
|
||||||
pkgs.xclip
|
|
||||||
]
|
|
||||||
}
|
|
||||||
|
|
||||||
echo >&2 key "$1" pressed
|
|
||||||
while read file; do
|
|
||||||
case "$1" in
|
|
||||||
"c")
|
|
||||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
|
||||||
[ -z "$destdir" ] && exit
|
|
||||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
|
||||||
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
|
|
||||||
;;
|
|
||||||
"m")
|
|
||||||
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
|
||||||
[ -z "$destdir" ] && exit
|
|
||||||
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
|
||||||
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
|
||||||
;;
|
|
||||||
"r")
|
|
||||||
convert -rotate 90 "$file" "$file" ;;
|
|
||||||
"R")
|
|
||||||
convert -rotate -90 "$file" "$file" ;;
|
|
||||||
"f")
|
|
||||||
convert -flop "$file" "$file" ;;
|
|
||||||
"y")
|
|
||||||
echo -n "$file" | xclip -selection clipboard &&
|
|
||||||
notify-send "$file copied to clipboard" & ;;
|
|
||||||
"Y")
|
|
||||||
readlink -f "$file" | xclip -selection clipboard &&
|
|
||||||
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
|
|
||||||
"d")
|
|
||||||
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
openweathermap-repo = pkgs.fetchFromGitHub {
|
openweathermap-repo = pkgs.fetchFromGitHub {
|
||||||
owner = "ip1981";
|
owner = "ip1981";
|
||||||
repo = "openweathermap";
|
repo = "openweathermap";
|
||||||
@@ -18,5 +15,5 @@ in {
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.weather];
|
environment.systemPackages = [ pkgs.weather ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,41 +1,12 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
hc = pkgs.callPackage <stockholm/tv/5pkgs/simple/hc.nix> {};
|
hc = pkgs.callPackage <stockholm/tv/5pkgs/simple/hc.nix> {};
|
||||||
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {};
|
worldradio = pkgs.callPackage <niveum/packages/worldradio.nix> {};
|
||||||
menstruation = pkgs.callPackage <menstruation-backend> {};
|
menstruation = pkgs.callPackage <niveum/submodules/menstruation-backend> {};
|
||||||
pandoc-doc = pkgs.callPackage <niveum/packages/man/pandoc.nix> {};
|
|
||||||
|
|
||||||
zoteroStyle = {
|
nixpkgs-unstable = import <nixpkgs-unstable> { config.allowUnfree = true; };
|
||||||
name,
|
|
||||||
sha256,
|
|
||||||
}: {
|
|
||||||
name = "${name}.csl";
|
|
||||||
path = pkgs.fetchurl {
|
|
||||||
url = "https://www.zotero.org/styles/${name}";
|
|
||||||
inherit sha256;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
cslDirectory = pkgs.linkFarm "citation-styles" [
|
|
||||||
(zoteroStyle {
|
|
||||||
name = "chicago-author-date-de";
|
|
||||||
sha256 = "sha256-ddMYk4A9DJQhx9ldkmF7PhwKuc7wUSr26uHHGAze9Ps=";
|
|
||||||
})
|
|
||||||
(zoteroStyle {
|
|
||||||
name = "din-1505-2";
|
|
||||||
sha256 = "sha256-bXZbB850fek8J6wMVFL32ndI7F4wiKKr1qUC71ezreE=";
|
|
||||||
})
|
|
||||||
(zoteroStyle {
|
|
||||||
name = "apa";
|
|
||||||
sha256 = "sha256-yq4fW6hQknycLjaj5fPbXLrQlGBp5myXiOSHBU90jEc=";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
|
|
||||||
astrolog = pkgs.astrolog.overrideAttrs (old:
|
astrolog = nixpkgs-unstable.astrolog.overrideAttrs (old: old // {
|
||||||
old
|
|
||||||
// {
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
${old.installPhase}
|
${old.installPhase}
|
||||||
# set sensible defaults
|
# set sensible defaults
|
||||||
@@ -54,12 +25,42 @@
|
|||||||
'';
|
'';
|
||||||
});
|
});
|
||||||
|
|
||||||
recht = pkgs.callPackage <recht> {};
|
recht = pkgs.callPackage (pkgs.fetchFromGitHub {
|
||||||
|
owner = "kmein";
|
||||||
|
repo = "recht";
|
||||||
|
rev = "0.6.2";
|
||||||
|
sha256 = "08gnrnz3lwh8h6fyga56yfy9qryzm89xbshm7wpxfyxf2pmp1qfx";
|
||||||
|
}) {};
|
||||||
|
|
||||||
in {
|
in {
|
||||||
home-manager.users.me.home.file = {
|
imports = [
|
||||||
".csl".source = cslDirectory;
|
./writing.nix
|
||||||
".local/share/pandoc/csl".source = cslDirectory; # as of pandoc 2.11, it includes citeproc
|
./python.nix
|
||||||
};
|
./haskell
|
||||||
|
{
|
||||||
|
environment.systemPackages = let
|
||||||
|
# nightly = pkgs.rustChannelOf {
|
||||||
|
# date = "2019-12-27";
|
||||||
|
# channel = "nightly";
|
||||||
|
# };
|
||||||
|
in with pkgs; [
|
||||||
|
htmlTidy
|
||||||
|
nodePackages.csslint
|
||||||
|
nodePackages.jsonlint
|
||||||
|
nodePackages.prettier
|
||||||
|
nodePackages.typescript
|
||||||
|
nodePackages.yarn
|
||||||
|
nodejs
|
||||||
|
nodePackages.javascript-typescript-langserver
|
||||||
|
|
||||||
|
tokei # count lines of code
|
||||||
|
gnumake
|
||||||
|
binutils # for strip, ld, ...
|
||||||
|
# nightly.rust
|
||||||
|
shellcheck
|
||||||
|
];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
# INTERNET
|
# INTERNET
|
||||||
@@ -69,14 +70,17 @@ in {
|
|||||||
w3m
|
w3m
|
||||||
wget
|
wget
|
||||||
whois
|
whois
|
||||||
|
ix
|
||||||
dnsutils
|
dnsutils
|
||||||
|
# mtr # my traceroute
|
||||||
# FILE MANAGERS
|
# FILE MANAGERS
|
||||||
lf
|
ranger
|
||||||
pcmanfm
|
pcmanfm
|
||||||
# MEDIA
|
# MEDIA
|
||||||
ffmpeg
|
ffmpeg
|
||||||
imagemagick
|
imagemagick
|
||||||
exiftool
|
exiftool
|
||||||
|
scrot
|
||||||
# ARCHIVE TOOLS
|
# ARCHIVE TOOLS
|
||||||
unzip
|
unzip
|
||||||
unrar
|
unrar
|
||||||
@@ -93,23 +97,23 @@ in {
|
|||||||
fd # better find
|
fd # better find
|
||||||
file # determine file type
|
file # determine file type
|
||||||
dos2unix
|
dos2unix
|
||||||
genpass # generate passwords
|
|
||||||
ncdu # ncurses disk usage
|
ncdu # ncurses disk usage
|
||||||
rmlint # remove duplicate files
|
|
||||||
python3Packages.jsonschema # json validation
|
python3Packages.jsonschema # json validation
|
||||||
jq # json toolkit
|
jq # json toolkit
|
||||||
pup # html toolkit
|
pup # html toolkit
|
||||||
htmlq
|
nixpkgs-unstable.htmlq
|
||||||
xsv # csv toolkit
|
xsv # csv toolkit
|
||||||
xmlstarlet # xml toolkit
|
xmlstarlet # xml toolkit
|
||||||
man-pages
|
manpages
|
||||||
posix_man_pages
|
posix_man_pages
|
||||||
|
# moreutils # for parallel, sponge, combine
|
||||||
tree
|
tree
|
||||||
exfat # to mount windows drives
|
fuse_exfat # to mount windows drives
|
||||||
parallel # for parallel, since moreutils shadows task spooler
|
parallel # for parallel, since moreutils shadows task spooler
|
||||||
ripgrep # better grep
|
ripgrep # better grep
|
||||||
rlwrap
|
rlwrap
|
||||||
progress # display progress bars for pipes
|
progress # display progress bars for pipes
|
||||||
|
up # universal plumber (piping tool)
|
||||||
# HARDWARE TOOLS
|
# HARDWARE TOOLS
|
||||||
usbutils # for lsusb
|
usbutils # for lsusb
|
||||||
pciutils # for lspci
|
pciutils # for lspci
|
||||||
@@ -117,42 +121,33 @@ in {
|
|||||||
arandr # xrandr for noobs
|
arandr # xrandr for noobs
|
||||||
libnotify # for notify-send
|
libnotify # for notify-send
|
||||||
xclip # clipboard CLI
|
xclip # clipboard CLI
|
||||||
xdragon # drag and drop
|
dragon-drop # drag and drop
|
||||||
xorg.xkill # kill by clicking
|
xorg.xkill # kill by clicking
|
||||||
audacity
|
audacity
|
||||||
calibre
|
calibre
|
||||||
electrum
|
|
||||||
inkscape
|
inkscape
|
||||||
astrolog
|
astrolog # astrolog
|
||||||
anki-bin # flashcards
|
anki # flashcards
|
||||||
jbofihe # lojbanic software
|
nixpkgs-unstable.zoom-us # video conferencing
|
||||||
zoom-us # video conferencing
|
|
||||||
alejandra # nix formatter
|
|
||||||
pdfgrep # search in pdf
|
pdfgrep # search in pdf
|
||||||
pdftk # pdf toolkit
|
pdftk # pdf toolkit
|
||||||
mupdf
|
|
||||||
poppler_utils # pdf toolkit
|
poppler_utils # pdf toolkit
|
||||||
foxitreader # for viewing pdf annotations
|
foxitreader # for viewing pdf annotations
|
||||||
okular # the word is nucular
|
|
||||||
xournalpp # for annotating pdfs
|
xournalpp # for annotating pdfs
|
||||||
pdfpc # presenter console for pdf slides
|
pdfpc # presenter console for pdf slides
|
||||||
hc # print files as qr codes
|
hc # print files as qr codes
|
||||||
yt-dlp
|
youtubeDL
|
||||||
espeak
|
|
||||||
bc # calculator
|
bc # calculator
|
||||||
pari # gp -- better calculator
|
pari # gp -- better calculator
|
||||||
scripts.auc
|
scripts.auc
|
||||||
scripts.stackoverflow
|
|
||||||
scripts.infschmv
|
scripts.infschmv
|
||||||
scripts.qrpaste
|
scripts.qrpaste
|
||||||
scripts.ttspaste
|
|
||||||
scripts.new-mac # get a new mac address
|
scripts.new-mac # get a new mac address
|
||||||
scripts.scanned
|
scripts.scanned
|
||||||
scripts.default-gateway
|
scripts.default-gateway
|
||||||
scripts.showkeys-toggle
|
scripts.showkeys-toggle
|
||||||
scripts.kirciuoklis
|
scripts.kirciuoklis
|
||||||
scripts.favicon
|
scripts.favicon
|
||||||
scripts.heuretes
|
|
||||||
scripts.ipa # XSAMPA to IPA converter
|
scripts.ipa # XSAMPA to IPA converter
|
||||||
scripts.playlist
|
scripts.playlist
|
||||||
scripts.mpv-tv
|
scripts.mpv-tv
|
||||||
@@ -163,8 +158,11 @@ in {
|
|||||||
recht
|
recht
|
||||||
scripts.vimv
|
scripts.vimv
|
||||||
scripts.swallow # window swallowing
|
scripts.swallow # window swallowing
|
||||||
|
scripts.genius
|
||||||
|
scripts.instaget
|
||||||
scripts.literature-quote
|
scripts.literature-quote
|
||||||
jless # less(1) for json
|
scripts.nav # json navigation
|
||||||
|
scripts.n
|
||||||
scripts.notetags
|
scripts.notetags
|
||||||
scripts.booksplit
|
scripts.booksplit
|
||||||
scripts.dmenurandr
|
scripts.dmenurandr
|
||||||
@@ -177,22 +175,24 @@ in {
|
|||||||
scripts.vg
|
scripts.vg
|
||||||
scripts.fkill
|
scripts.fkill
|
||||||
scripts.wttr
|
scripts.wttr
|
||||||
|
scripts.sanskrit-dictionary
|
||||||
scripts.unicodmenu
|
scripts.unicodmenu
|
||||||
|
scripts.horoscope
|
||||||
scripts.closest
|
scripts.closest
|
||||||
scripts.trans
|
scripts.trans
|
||||||
|
scripts.liddel-scott-jones
|
||||||
scripts.mpv-radio
|
scripts.mpv-radio
|
||||||
# kmein.slide
|
# kmein.slide
|
||||||
scripts.tolino-screensaver
|
scripts.tolino-screensaver
|
||||||
scripts.rfc
|
scripts.rfc
|
||||||
scripts.tag
|
scripts.tag
|
||||||
scripts.timer
|
|
||||||
python3Packages.eyeD3
|
|
||||||
scripts.menu-calc
|
scripts.menu-calc
|
||||||
nix-prefetch-git
|
nix-prefetch-git
|
||||||
scripts.nix-git
|
scripts.nix-git
|
||||||
nixfmt
|
nixfmt
|
||||||
par
|
par
|
||||||
qrencode
|
qrencode
|
||||||
|
wtf
|
||||||
|
|
||||||
menstruation
|
menstruation
|
||||||
|
|
||||||
@@ -207,7 +207,7 @@ in {
|
|||||||
(pkgs.writers.writeDashBin "ncmpcpp-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.ncmpcpp}/bin/ncmpcpp "$@"'')
|
(pkgs.writers.writeDashBin "ncmpcpp-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.ncmpcpp}/bin/ncmpcpp "$@"'')
|
||||||
(pkgs.writers.writeDashBin "mpc-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.mpc_cli}/bin/mpc "$@"'')
|
(pkgs.writers.writeDashBin "mpc-zaatar" ''MPD_HOST=${(import <niveum/lib/local-network.nix>).zaatar} exec ${pkgs.mpc_cli}/bin/mpc "$@"'')
|
||||||
|
|
||||||
spotify
|
nixpkgs-unstable.spotify
|
||||||
ncspot
|
ncspot
|
||||||
playerctl
|
playerctl
|
||||||
|
|
||||||
@@ -222,56 +222,6 @@ in {
|
|||||||
irc-announce
|
irc-announce
|
||||||
git-preview
|
git-preview
|
||||||
ircaids
|
ircaids
|
||||||
|
|
||||||
(python3.withPackages (py: [
|
|
||||||
py.black
|
|
||||||
# py.python-language-server
|
|
||||||
# py.pyls-mypy
|
|
||||||
# py.pyls-black
|
|
||||||
# py.pyls-isort
|
|
||||||
py.flake8
|
|
||||||
py.pygments
|
|
||||||
py.schema
|
|
||||||
]))
|
|
||||||
python3Packages.poetry
|
|
||||||
|
|
||||||
html-tidy
|
|
||||||
nodePackages.csslint
|
|
||||||
nodePackages.jsonlint
|
|
||||||
nodePackages.prettier
|
|
||||||
nodePackages.typescript
|
|
||||||
nodePackages.yarn
|
|
||||||
nodejs
|
|
||||||
nodePackages.javascript-typescript-langserver
|
|
||||||
texlive.combined.scheme-full
|
|
||||||
latexrun
|
|
||||||
(aspellWithDicts (dict: [dict.de dict.en dict.en-computers]))
|
|
||||||
# haskellPackages.pandoc-citeproc
|
|
||||||
scripts.text2pdf
|
|
||||||
lowdown
|
|
||||||
glow # markdown to term
|
|
||||||
libreoffice
|
|
||||||
# gnumeric
|
|
||||||
dia
|
|
||||||
pandoc
|
|
||||||
pandoc-doc
|
|
||||||
# proselint
|
|
||||||
asciidoctor
|
|
||||||
wordnet
|
|
||||||
tokei # count lines of code
|
|
||||||
gnumake
|
|
||||||
binutils # for strip, ld, ...
|
|
||||||
# nightly.rust
|
|
||||||
shellcheck
|
|
||||||
|
|
||||||
(pkgs.writers.writeDashBin "hass-cli" ''
|
|
||||||
HASS_SERVER=http://zaatar.r:8123 HASS_TOKEN=${lib.strings.fileContents <secrets/hass/token>} exec ${pkgs.home-assistant-cli}/bin/hass-cli "$@"
|
|
||||||
'')
|
|
||||||
scripts.rofi-hass
|
|
||||||
];
|
];
|
||||||
|
|
||||||
home-manager.users.me.xdg.configFile."pycodestyle".text = ''
|
|
||||||
[pycodestyle]
|
|
||||||
max-line-length = 110
|
|
||||||
'';
|
|
||||||
}
|
}
|
||||||
46
configs/packages/haskell/default.nix
Normal file
46
configs/packages/haskell/default.nix
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{ config, pkgs, ... }: {
|
||||||
|
home-manager.users.me.home.file = {
|
||||||
|
".ghc/ghci.conf".text = ''
|
||||||
|
:set editor vim
|
||||||
|
:def hoogle \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --count=15 \"" ++ s ++ "\""
|
||||||
|
:def doc \s -> return $ ":!${pkgs.haskellPackages.hoogle}/bin/hoogle search --color -l --info \"" ++ s ++ "\""
|
||||||
|
:set prompt "\o033[1m%s\o033[1;34m λ\o033[0m "
|
||||||
|
:set -Wall
|
||||||
|
:set -XOverloadedStrings
|
||||||
|
'';
|
||||||
|
# :def unpl \x -> return $ ":!${pkgs.haskellPackages.pointful}/bin/pointful \"" ++ x ++ "\""
|
||||||
|
# :def pl \x -> return $ ":!${pkgs.haskellPackages.pointfree}/bin/pointfree -v \"" ++ x ++ "\""
|
||||||
|
".stack/config.yaml".source =
|
||||||
|
let inherit (import <niveum/lib>) kieran;
|
||||||
|
in (pkgs.formats.yaml {}).generate "config.yaml" {
|
||||||
|
templates.params = {
|
||||||
|
author-name = kieran.name;
|
||||||
|
author-email = kieran.email;
|
||||||
|
copyright = "Copyright: (c) 2020 ${kieran.name}";
|
||||||
|
github-username = kieran.github;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
services.hoogle = {
|
||||||
|
enable = false;
|
||||||
|
packages = import ./packages.nix;
|
||||||
|
port = 8091;
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs;
|
||||||
|
[
|
||||||
|
cabal2nix
|
||||||
|
cabal-install
|
||||||
|
hlint
|
||||||
|
haskellPackages.ormolu
|
||||||
|
(haskellPackages.ghcWithHoogle (import ./packages.nix))
|
||||||
|
] ++ map haskell.lib.justStaticExecutables [
|
||||||
|
haskellPackages.ghcid
|
||||||
|
haskellPackages.hasktags
|
||||||
|
# haskellPackages.hindent
|
||||||
|
# haskellPackages.pointfree
|
||||||
|
# haskellPackages.pointful
|
||||||
|
haskellPackages.hpack
|
||||||
|
];
|
||||||
|
}
|
||||||
100
configs/packages/haskell/packages.nix
Normal file
100
configs/packages/haskell/packages.nix
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
haskellPackages:
|
||||||
|
with haskellPackages; [
|
||||||
|
HTTP
|
||||||
|
HUnit
|
||||||
|
MissingH
|
||||||
|
QuickCheck
|
||||||
|
ad
|
||||||
|
adjunctions
|
||||||
|
aeson
|
||||||
|
# algebra
|
||||||
|
ansi-terminal
|
||||||
|
async
|
||||||
|
attoparsec
|
||||||
|
base-orphans
|
||||||
|
bifunctors
|
||||||
|
binary
|
||||||
|
blaze-html
|
||||||
|
blaze-markup
|
||||||
|
brick
|
||||||
|
bytes
|
||||||
|
bytestring
|
||||||
|
case-insensitive
|
||||||
|
cassava
|
||||||
|
cereal
|
||||||
|
clock
|
||||||
|
comonad
|
||||||
|
comonad-transformers
|
||||||
|
conduit
|
||||||
|
conduit-extra
|
||||||
|
constraints
|
||||||
|
containers
|
||||||
|
contravariant
|
||||||
|
criterion
|
||||||
|
data-default
|
||||||
|
diagrams
|
||||||
|
directory
|
||||||
|
dlist
|
||||||
|
either
|
||||||
|
edit-distance
|
||||||
|
exceptions
|
||||||
|
extra
|
||||||
|
filepath
|
||||||
|
foundation
|
||||||
|
free
|
||||||
|
haskeline
|
||||||
|
hedgehog
|
||||||
|
hourglass
|
||||||
|
hspec
|
||||||
|
http-client
|
||||||
|
http-conduit
|
||||||
|
kan-extensions
|
||||||
|
lens
|
||||||
|
linear
|
||||||
|
lucid
|
||||||
|
megaparsec
|
||||||
|
microlens
|
||||||
|
monad-logger
|
||||||
|
monad-memo
|
||||||
|
mono-traversable
|
||||||
|
mtl
|
||||||
|
network
|
||||||
|
parallel
|
||||||
|
parsec
|
||||||
|
persistent
|
||||||
|
pipes
|
||||||
|
pointed
|
||||||
|
pretty
|
||||||
|
pretty-show
|
||||||
|
prettyprinter
|
||||||
|
primitive
|
||||||
|
process
|
||||||
|
profunctors
|
||||||
|
regex-tdfa
|
||||||
|
safe
|
||||||
|
scalpel
|
||||||
|
semigroupoids
|
||||||
|
semigroups
|
||||||
|
servant
|
||||||
|
servant-blaze
|
||||||
|
servant-client
|
||||||
|
servant-docs
|
||||||
|
servant-server
|
||||||
|
servant-swagger
|
||||||
|
split
|
||||||
|
stm
|
||||||
|
tagsoup
|
||||||
|
tasty
|
||||||
|
text
|
||||||
|
time
|
||||||
|
transformers
|
||||||
|
turtle
|
||||||
|
unix-time
|
||||||
|
unordered-containers
|
||||||
|
vector
|
||||||
|
void
|
||||||
|
vty
|
||||||
|
warp
|
||||||
|
wreq
|
||||||
|
yaml
|
||||||
|
]
|
||||||
20
configs/packages/python.nix
Normal file
20
configs/packages/python.nix
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
{ pkgs, ... }: {
|
||||||
|
environment.systemPackages = [
|
||||||
|
(pkgs.python3.withPackages (py: [
|
||||||
|
py.black
|
||||||
|
# py.python-language-server
|
||||||
|
# py.pyls-mypy
|
||||||
|
# py.pyls-black
|
||||||
|
# py.pyls-isort
|
||||||
|
py.flake8
|
||||||
|
py.pygments
|
||||||
|
py.schema
|
||||||
|
]))
|
||||||
|
pkgs.python3Packages.poetry
|
||||||
|
];
|
||||||
|
|
||||||
|
home-manager.users.me.xdg.configFile."pycodestyle".text = ''
|
||||||
|
[pycodestyle]
|
||||||
|
max-line-length = 110
|
||||||
|
'';
|
||||||
|
}
|
||||||
81
configs/packages/writing.nix
Normal file
81
configs/packages/writing.nix
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
{ pkgs, lib, config, ... }:
|
||||||
|
let
|
||||||
|
pandoc-doc = pkgs.callPackage <niveum/packages/man/pandoc.nix> {};
|
||||||
|
|
||||||
|
zoteroStyle = { name, sha256 }: {
|
||||||
|
name = "${name}.csl";
|
||||||
|
path = pkgs.fetchurl {
|
||||||
|
url = "https://www.zotero.org/styles/${name}";
|
||||||
|
inherit sha256;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
cslDirectory = pkgs.linkFarm "citation-styles" [
|
||||||
|
(zoteroStyle {
|
||||||
|
name = "chicago-author-date-de";
|
||||||
|
sha256 = "0fz0xn46rkciblr34a7x2v60j0lbq9l3fmzi43iphph27m0czn6s";
|
||||||
|
})
|
||||||
|
(zoteroStyle {
|
||||||
|
name = "din-1505-2";
|
||||||
|
sha256 = "1pvy1b7qm13mnph7z365rrz1j082bl2y8ih73rhzd0zd6dz1jyjq";
|
||||||
|
})
|
||||||
|
(zoteroStyle {
|
||||||
|
name = "apa";
|
||||||
|
sha256 = "1878vxp0y0h05yzaghnd51n981623mxskw3lsdyzmffqhihvv111";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
makeStardictDataDir = dicts:
|
||||||
|
pkgs.linkFarm "dictionaries" (map ({ name, path }: {
|
||||||
|
name = "dic/${name}";
|
||||||
|
inherit path;
|
||||||
|
}) dicts);
|
||||||
|
in {
|
||||||
|
environment.variables.STARDICT_DATA_DIR = toString (makeStardictDataDir [
|
||||||
|
{
|
||||||
|
name = "gr-de";
|
||||||
|
path = pkgs.fetchurl {
|
||||||
|
url = "http://tovotu.de/data/stardict/pape_gr-de.zip";
|
||||||
|
sha256 = "1d705y47b40vp0mg79vbwasw4y0i8fmnlwvf4x4ri0dkfqng9sky";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "la-de";
|
||||||
|
path = pkgs.fetchurl {
|
||||||
|
url = "http://tovotu.de/data/stardict/georges_lat-de.zip";
|
||||||
|
sha256 = "12n26nzwg28wn4zwv45mv0wkgy1jh1d8p0k6haamz9601cqq7hkj";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
name = "de-la";
|
||||||
|
path = pkgs.fetchurl {
|
||||||
|
url = "http://tovotu.de/data/stardict/georges_de-lat.zip";
|
||||||
|
sha256 = "0inm6xn1lcnb851cj329n0v2vbfc1z1bxwhgsd8fnm0zxy3f3ifq";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
]);
|
||||||
|
|
||||||
|
home-manager.users.me.home.file = {
|
||||||
|
".csl".source = cslDirectory;
|
||||||
|
".local/share/pandoc/csl".source = cslDirectory; # as of pandoc 2.11, it includes citeproc
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
texlive.combined.scheme-full
|
||||||
|
latexrun
|
||||||
|
(aspellWithDicts (dict: [ dict.de dict.en dict.en-computers ]))
|
||||||
|
# haskellPackages.pandoc-citeproc
|
||||||
|
scripts.text2pdf
|
||||||
|
lowdown
|
||||||
|
glow # markdown to term
|
||||||
|
libreoffice
|
||||||
|
# gnumeric
|
||||||
|
dia
|
||||||
|
pandoc
|
||||||
|
pandoc-doc
|
||||||
|
# proselint
|
||||||
|
asciidoctor
|
||||||
|
wordnet
|
||||||
|
# sdcv # stardict cli
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
{config, ...}: let
|
|
||||||
user = config.users.users.me.name;
|
|
||||||
in {
|
|
||||||
security.polkit.extraConfig = ''
|
|
||||||
polkit.addRule(function(action, subject) {
|
|
||||||
if (subject.user == "${user}" && action.id == "org.freedesktop.systemd1.manage-units") {
|
|
||||||
return polkit.Result.YES;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
'';
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
{
|
{ pkgs, config, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend";
|
suspend = pkgs.writers.writeDash "suspend" "${pkgs.systemd}/bin/systemctl suspend";
|
||||||
in {
|
in
|
||||||
imports = [<stockholm/krebs/3modules/power-action.nix>];
|
{
|
||||||
|
imports = [ <stockholm/krebs/3modules/power-action.nix> ];
|
||||||
|
|
||||||
krebs.power-action = {
|
krebs.power-action = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,21 +1,19 @@
|
|||||||
{pkgs, ...}: let
|
{ pkgs, ... }:
|
||||||
inherit (import <niveum/lib>) localAddresses;
|
let
|
||||||
hp-driver = pkgs.hplip;
|
inherit (import ../lib) localAddresses;
|
||||||
|
hp-driver = pkgs.hplipWithPlugin;
|
||||||
in {
|
in {
|
||||||
services.printing = {
|
services.printing = {
|
||||||
enable = true;
|
enable = true;
|
||||||
drivers = [hp-driver];
|
drivers = [ hp-driver ];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
hardware.sane = {
|
||||||
pkgs.system-config-printer
|
enable = true;
|
||||||
];
|
extraBackends = [ hp-driver ];
|
||||||
|
};
|
||||||
|
|
||||||
# allow connecting to .local printers
|
hardware.printers.ensurePrinters = [{
|
||||||
services.avahi.nssmdns = true;
|
|
||||||
|
|
||||||
hardware.printers.ensurePrinters = [
|
|
||||||
{
|
|
||||||
name = "OfficeJet";
|
name = "OfficeJet";
|
||||||
location = "Zimmer";
|
location = "Zimmer";
|
||||||
deviceUri = "https://${localAddresses.officejet}";
|
deviceUri = "https://${localAddresses.officejet}";
|
||||||
@@ -27,11 +25,9 @@ in {
|
|||||||
OutputMode = "Normal";
|
OutputMode = "Normal";
|
||||||
ColorModel = "KGray"; # RGB CMYGray KGray
|
ColorModel = "KGray"; # RGB CMYGray KGray
|
||||||
};
|
};
|
||||||
}
|
}];
|
||||||
];
|
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
HP/hp-officejet_4650_series.ppd.gz
|
|
||||||
drv:///hp/hpcups.drv/hp-officejet_4650_series.ppd
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
/* HP/hp-officejet_4650_series.ppd.gz
|
||||||
|
drv:///hp/hpcups.drv/hp-officejet_4650_series.ppd
|
||||||
|
*/
|
||||||
|
|||||||
212
configs/radio/default.nix
Normal file
212
configs/radio/default.nix
Normal file
@@ -0,0 +1,212 @@
|
|||||||
|
{ lib, pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
inherit (import <niveum/lib>) tmpfilesConfig serveHtml;
|
||||||
|
|
||||||
|
radioStore = "/var/lib/radio";
|
||||||
|
htgenPort = 8080;
|
||||||
|
stations = {
|
||||||
|
lyrikline = {
|
||||||
|
streamPort = 8001;
|
||||||
|
mpdPort = 6601;
|
||||||
|
description = ''
|
||||||
|
Weltklang. Welt als ewiges Gedicht, das seine Schallspuren durch Raum und Zeit jagt. Endlose Zufallswiedergabe von <a href="//lyrikline.org">lyrikline</a>. — Listen to the sound of voices and poems permeating linguistic and geographic barriers, 24 hours per day.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
lyrik = {
|
||||||
|
streamPort = 8002;
|
||||||
|
mpdPort = 6602;
|
||||||
|
description = ''
|
||||||
|
Deutsche Lyrik, die du noch nicht gut genug kennst. Tritt in einen Fluss aus Reim und Maß; keine zwei Mal ist er derselbe.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
mpd-add-with-tags = pkgs.writers.writeHaskell "mpd-add-with-tags" {
|
||||||
|
libraries = with pkgs.haskellPackages; [ optparse-generic libmpd ];
|
||||||
|
} ''
|
||||||
|
{-# LANGUAGE DeriveGeneric, OverloadedStrings #-}
|
||||||
|
import Control.Monad (void)
|
||||||
|
import Data.String
|
||||||
|
import Network.MPD
|
||||||
|
import Options.Generic
|
||||||
|
|
||||||
|
data Options = Options { url :: String, artist :: Maybe String, title :: Maybe String }
|
||||||
|
deriving (Generic)
|
||||||
|
|
||||||
|
instance ParseRecord Options
|
||||||
|
|
||||||
|
main :: IO ()
|
||||||
|
main = do
|
||||||
|
options <- getRecord "Add to MPD with tags"
|
||||||
|
void $ withMPD $ do
|
||||||
|
songId <- addId (fromString $ url options) Nothing
|
||||||
|
maybe (pure ()) (addTagId songId Artist . fromString) $ artist options
|
||||||
|
maybe (pure ()) (addTagId songId Title . fromString) $ title options
|
||||||
|
'';
|
||||||
|
|
||||||
|
mpcs = lib.mapAttrs (name: station: pkgs.writers.writeDashBin "mpc-${name}" ''
|
||||||
|
MPD_PORT=${toString station.mpdPort} ${pkgs.mpc_cli}/bin/mpc "$@"
|
||||||
|
'') stations;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
imports = [ <stockholm/krebs/3modules/htgen.nix> ];
|
||||||
|
nixpkgs.overlays = [
|
||||||
|
(self: super: { htgen = super.callPackage <stockholm/krebs/5pkgs/simple/htgen> {}; })
|
||||||
|
];
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
(tmpfilesConfig {
|
||||||
|
type = "d";
|
||||||
|
path = radioStore;
|
||||||
|
mode = "0755";
|
||||||
|
user = config.users.extraUsers.radio.name;
|
||||||
|
age = "1d";
|
||||||
|
})
|
||||||
|
];
|
||||||
|
|
||||||
|
users.extraUsers.radio = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "radio";
|
||||||
|
};
|
||||||
|
users.groups.radio = {};
|
||||||
|
|
||||||
|
krebs.htgen.radio = {
|
||||||
|
port = htgenPort;
|
||||||
|
user.name = "radio";
|
||||||
|
script = ''. ${pkgs.writers.writeDash "meinskript" ''
|
||||||
|
send200() {
|
||||||
|
printf 'HTTP/1.1 200 OK\r\n'
|
||||||
|
printf 'Content-Type: text/html; charset=UTF-8\r\n'
|
||||||
|
printf 'Connection: close\r\n'
|
||||||
|
printf '\r\n'
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$Method $Request_URI" in
|
||||||
|
"GET /lyrik/status")
|
||||||
|
send200
|
||||||
|
video_id="$(
|
||||||
|
${mpcs.lyrik}/bin/mpc-lyrik status -f %file% \
|
||||||
|
| head -n1 \
|
||||||
|
| grep -o 'id=[^&]*' \
|
||||||
|
| sed 's/^id=//g'
|
||||||
|
)"
|
||||||
|
|
||||||
|
${pkgs.youtube-dl}/bin/youtube-dl -j "https://www.youtube.com/watch?v=$video_id" \
|
||||||
|
| ${pkgs.jq}/bin/jq -r '"% [\(.title)](\(.webpage_url))\n\n\(.description)"' \
|
||||||
|
| sed 's/$/ /g' \
|
||||||
|
| ${pkgs.pandoc}/bin/pandoc -s
|
||||||
|
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
"GET /lyrikline/status")
|
||||||
|
send200
|
||||||
|
|
||||||
|
hash="$(
|
||||||
|
${mpcs.lyrikline}/bin/mpc-lyrikline status -f '%file%' \
|
||||||
|
| head -n 1 \
|
||||||
|
| md5sum \
|
||||||
|
| cut -d' ' -f 1
|
||||||
|
)"
|
||||||
|
url="$(cat ${radioStore}/$hash)"
|
||||||
|
|
||||||
|
echo "<html><body style='margin:0'><iframe style='width:100%;height:100%;border:0' src="$url"></iframe></body></html>"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
''}'';
|
||||||
|
};
|
||||||
|
|
||||||
|
containers = lib.mapAttrs (name: station: {
|
||||||
|
autoStart = true;
|
||||||
|
config = {config, pkgs, ...}: {
|
||||||
|
services.mpd = {
|
||||||
|
enable = true;
|
||||||
|
network.port = station.mpdPort;
|
||||||
|
extraConfig = ''
|
||||||
|
log_level "default"
|
||||||
|
|
||||||
|
audio_output {
|
||||||
|
name "${name}"
|
||||||
|
type "httpd"
|
||||||
|
encoder "vorbis"
|
||||||
|
port "${toString station.streamPort}"
|
||||||
|
bitrate "128"
|
||||||
|
format "44100:16:2"
|
||||||
|
always_on "yes"
|
||||||
|
tags "yes"
|
||||||
|
}
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}) stations;
|
||||||
|
|
||||||
|
environment.systemPackages = lib.attrValues mpcs;
|
||||||
|
|
||||||
|
systemd.services.lyrikline = {
|
||||||
|
after = [ "container@lyrikline.service" ];
|
||||||
|
wantedBy = [ "container@lyrikline.service" ];
|
||||||
|
startAt = "*:00/5";
|
||||||
|
serviceConfig.User = config.users.extraUsers.radio.name;
|
||||||
|
preStart = "${mpcs.lyrikline}/bin/mpc-lyrikline crop || :";
|
||||||
|
script = ''
|
||||||
|
set -efu
|
||||||
|
|
||||||
|
lyrikline=https://www.lyrikline.org
|
||||||
|
for _ in $(seq 1 10); do
|
||||||
|
random_route="$(${pkgs.curl}/bin/curl -sSL "$lyrikline/index.php/tools/getrandompoem" --data-raw 'lang=de' --compressed | ${pkgs.jq}/bin/jq -r .link)"
|
||||||
|
poem_url="$lyrikline$random_route"
|
||||||
|
|
||||||
|
poem_file="$(
|
||||||
|
${pkgs.curl}/bin/curl -sSL "$poem_url" \
|
||||||
|
| grep -o 'https://.*\.mp3' \
|
||||||
|
| head -n1
|
||||||
|
)"
|
||||||
|
|
||||||
|
hash="$(echo "$poem_file" | md5sum | cut -d' ' -f 1)"
|
||||||
|
echo "$poem_file ($hash) -> $poem_url"
|
||||||
|
echo "$poem_url" > "${radioStore}/$hash"
|
||||||
|
|
||||||
|
${mpcs.lyrikline}/bin/mpc-lyrikline add "$poem_file"
|
||||||
|
done
|
||||||
|
|
||||||
|
${mpcs.lyrikline}/bin/mpc-lyrikline play
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.lyrik = {
|
||||||
|
after = [ "container@lyrik.service" ];
|
||||||
|
wantedBy = [ "container@lyrik.service" ];
|
||||||
|
preStart = "${mpcs.lyrik}/bin/mpc-lyrik crop || :";
|
||||||
|
restartIfChanged = true;
|
||||||
|
serviceConfig.User = config.users.extraUsers.radio.name;
|
||||||
|
script =
|
||||||
|
let
|
||||||
|
invidious = "https://invidious.silkky.cloud";
|
||||||
|
videoIds = import <niveum/lib/hot-rotation/lyrik.nix>;
|
||||||
|
streams = lib.concatMapStringsSep "\n" (id: "${invidious}/latest_version?id=${id}&itag=251") videoIds;
|
||||||
|
streamsFile = pkgs.writeText "hotrot" streams;
|
||||||
|
in ''
|
||||||
|
set -efu
|
||||||
|
${mpcs.lyrik}/bin/mpc-lyrik add < ${toString streamsFile}
|
||||||
|
|
||||||
|
${mpcs.lyrik}/bin/mpc-lyrik crossfade 5
|
||||||
|
${mpcs.lyrik}/bin/mpc-lyrik random on
|
||||||
|
${mpcs.lyrik}/bin/mpc-lyrik repeat on
|
||||||
|
${mpcs.lyrik}/bin/mpc-lyrik play
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."radio.kmein.de" = {
|
||||||
|
enableACME = true;
|
||||||
|
forceSSL = true;
|
||||||
|
locations = lib.mkMerge (
|
||||||
|
[
|
||||||
|
{ "/".extraConfig = serveHtml (import ./station-list.nix { inherit pkgs lib stations; }) pkgs; }
|
||||||
|
] ++ (lib.mapAttrsToList (name: station: {
|
||||||
|
"= /${name}/status".proxyPass = "http://127.0.0.1:${toString htgenPort}";
|
||||||
|
"= /${name}/listen.ogg".proxyPass = "http://127.0.0.1:${toString station.streamPort}";
|
||||||
|
"= /${name}.ogg".return = "301 http://radio.xn--kiern-0qa.de/${name}/listen.ogg"; # legacy
|
||||||
|
}) stations)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
43
configs/radio/station-list.nix
Normal file
43
configs/radio/station-list.nix
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
{ pkgs, lib, stations }:
|
||||||
|
let
|
||||||
|
theStations = lib.mapAttrsToList (name: value: value // {name = name;}) stations;
|
||||||
|
in
|
||||||
|
pkgs.writeText "index.html" ''
|
||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>radio.kierán</title>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="//cdn.rawgit.com/necolas/normalize.css/master/normalize.css"
|
||||||
|
/>
|
||||||
|
<link
|
||||||
|
rel="stylesheet"
|
||||||
|
href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.9.2/css/bulma.min.css"
|
||||||
|
/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<main class="section">
|
||||||
|
<div class="subtitle is-3">Welcome to</div>
|
||||||
|
<h1 class="title is-1">radio.kierán</h1>
|
||||||
|
|
||||||
|
<div class="columns is-multiline">
|
||||||
|
${lib.concatMapStringsSep "\n" (station: ''
|
||||||
|
<div class="column">
|
||||||
|
<div class="box">
|
||||||
|
<strong class="is-uppercase">${station.name}</strong>
|
||||||
|
(<a href="/${station.name}/status">status</a>, <a href="/${station.name}/listen.ogg">link</a>)
|
||||||
|
|
||||||
|
<p class="has-text-grey">${station.description}</p>
|
||||||
|
<hr/>
|
||||||
|
<audio style="width:100%" controls src="/${station.name}/listen.ogg"/>
|
||||||
|
</div>
|
||||||
|
</div>'') theStations
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
''
|
||||||
@@ -1 +1 @@
|
|||||||
{services.redshift.enable = false;}
|
{ services.redshift.enable = false; }
|
||||||
|
|||||||
@@ -1,9 +1,5 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
network = "retiolum";
|
network = "retiolum";
|
||||||
|
|
||||||
stateDirectory = "retiolum-map";
|
stateDirectory = "retiolum-map";
|
||||||
@@ -11,11 +7,18 @@
|
|||||||
geo-ip-database = "${lib.head config.services.geoipupdate.settings.EditionIDs}.mmdb";
|
geo-ip-database = "${lib.head config.services.geoipupdate.settings.EditionIDs}.mmdb";
|
||||||
geo-ip-database-path = "${config.services.geoipupdate.settings.DatabaseDirectory}/${geo-ip-database}";
|
geo-ip-database-path = "${config.services.geoipupdate.settings.DatabaseDirectory}/${geo-ip-database}";
|
||||||
|
|
||||||
tinc-graph = pkgs.callPackage <tinc-graph> {};
|
tinc-graph-source = pkgs.fetchFromGitHub {
|
||||||
in {
|
owner = "kmein";
|
||||||
|
repo = "tinc-graph";
|
||||||
|
rev = "1b9c69ffdbdab82d30a23e44f739feea63d94163";
|
||||||
|
sha256 = "0bk4x9l399f80lmz4asx7s5fcsgrfdb6xyymbq884621x4z3d2vp";
|
||||||
|
};
|
||||||
|
tinc-graph = pkgs.callPackage tinc-graph-source {};
|
||||||
|
in
|
||||||
|
{
|
||||||
systemd.services.retiolum-index = {
|
systemd.services.retiolum-index = {
|
||||||
description = "Retiolum indexing service";
|
description = "Retiolum indexing service";
|
||||||
wants = ["tinc.${network}.service"];
|
wants = [ "tinc.${network}.service" ];
|
||||||
script = ''
|
script = ''
|
||||||
${tinc-graph}/bin/tinc-graph --geoip-file ${geo-ip-database-path} --network ${network} \
|
${tinc-graph}/bin/tinc-graph --geoip-file ${geo-ip-database-path} --network ${network} \
|
||||||
| ${pkgs.coreutils}/bin/tee network.json \
|
| ${pkgs.coreutils}/bin/tee network.json \
|
||||||
@@ -26,7 +29,7 @@ in {
|
|||||||
cp ${tinc-graph}/static/graph.html graph.html
|
cp ${tinc-graph}/static/graph.html graph.html
|
||||||
'';
|
'';
|
||||||
startAt = "hourly";
|
startAt = "hourly";
|
||||||
path = [pkgs.coreutils pkgs.jq pkgs.tinc_pre];
|
path = [ pkgs.coreutils pkgs.jq pkgs.tinc_pre ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
User = "root";
|
User = "root";
|
||||||
@@ -40,23 +43,10 @@ in {
|
|||||||
settings = {
|
settings = {
|
||||||
AccountID = 608777;
|
AccountID = 608777;
|
||||||
LicenseKey = toString <system-secrets/maxmind/license.key>;
|
LicenseKey = toString <system-secrets/maxmind/license.key>;
|
||||||
EditionIDs = ["GeoLite2-City"];
|
EditionIDs = [ "GeoLite2-City" ];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
link = "http://graph.r";
|
|
||||||
title = "Retiolum Realtime Map";
|
|
||||||
description = "displays geographical information about the retiolum network. <a href=\"http://graph.r/graph.html\">Graph</a> info also available.";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
link = "http://c.r/${geo-ip-database}";
|
|
||||||
title = "GeoIP";
|
|
||||||
description = "shares MaxMind's GeoIP database with the krebs world. Updated weekly.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
services.nginx = {
|
services.nginx = {
|
||||||
enable = true;
|
enable = true;
|
||||||
recommendedGzipSettings = true;
|
recommendedGzipSettings = true;
|
||||||
@@ -64,13 +54,10 @@ in {
|
|||||||
recommendedProxySettings = true;
|
recommendedProxySettings = true;
|
||||||
recommendedTlsSettings = true;
|
recommendedTlsSettings = true;
|
||||||
virtualHosts."graph.r".locations."/".root = "/var/lib/${stateDirectory}";
|
virtualHosts."graph.r".locations."/".root = "/var/lib/${stateDirectory}";
|
||||||
# RRM @ https://github.com/krebs/cholerab/blob/master/thesauron.adoc
|
|
||||||
virtualHosts."rrm.r".locations."/".root = "/var/lib/${stateDirectory}";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.geoip-share = {
|
systemd.services.geoip-share = {
|
||||||
after = ["geoipupdate.service"];
|
after = [ "geoipupdate.service" ];
|
||||||
wantedBy = ["geoipupdate.service"];
|
|
||||||
script = let
|
script = let
|
||||||
cyberlocker-tools = pkgs.callPackage <stockholm/krebs/5pkgs/simple/cyberlocker-tools> {};
|
cyberlocker-tools = pkgs.callPackage <stockholm/krebs/5pkgs/simple/cyberlocker-tools> {};
|
||||||
in "${cyberlocker-tools}/bin/cput ${geo-ip-database} < ${geo-ip-database-path}";
|
in "${cyberlocker-tools}/bin/cput ${geo-ip-database} < ${geo-ip-database-path}";
|
||||||
@@ -1,11 +1,7 @@
|
|||||||
{
|
{ config, pkgs, ... }: {
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
imports = [
|
imports = [
|
||||||
<niveum/modules/retiolum.nix>
|
../modules/retiolum.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.hosts = {"42:0:ca48:f98f:63d7:31ce:922b:245d" = ["go"];};
|
networking.hosts = { "42:0:ca48:f98f:63d7:31ce:922b:245d" = [ "go" ]; };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
{
|
{ config, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) colours;
|
inherit (import <niveum/lib>) colours;
|
||||||
in {
|
in{
|
||||||
home-manager.users.me.programs.rofi = {
|
home-manager.users.me.programs.rofi = {
|
||||||
enable = true;
|
enable = true;
|
||||||
font = "Monospace 10";
|
font = "Monospace 10";
|
||||||
theme = "${pkgs.rofi}/share/rofi/themes/Arc-Dark.rasi";
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
{
|
{
|
||||||
pkgs,
|
|
||||||
config,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.xserver.displayManager.sessionCommands = "${pkgs.seafile-client}/bin/seafile-applet &";
|
services.xserver.displayManager.sessionCommands = "${pkgs.seafile-client}/bin/seafile-applet &";
|
||||||
|
|
||||||
home-manager.users.me.xdg.configFile = {
|
home-manager.users.me.xdg.configFile = {
|
||||||
@@ -19,5 +16,5 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [pkgs.seafile-client];
|
environment.systemPackages = [ pkgs.seafile-client ];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
|
{ config, pkgs, lib, ... }:
|
||||||
{
|
{
|
||||||
config,
|
imports = [ <niveum/modules/spotifyd.nix> ];
|
||||||
pkgs,
|
disabledModules = [ "services/audio/spotifyd.nix" ];
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: {
|
|
||||||
services.spotifyd = {
|
services.spotifyd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
@@ -1,22 +1,8 @@
|
|||||||
{
|
{ pkgs, config, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
config,
|
inherit (import ../lib) sshPort kieran;
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) sshPort kieran;
|
|
||||||
externalNetwork = import <niveum/lib/external-network.nix>;
|
|
||||||
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
|
|
||||||
ssh-passphease = lib.strings.fileContents <system-secrets/ssh/passphrase>;
|
|
||||||
in {
|
in {
|
||||||
services.xserver.displayManager.sessionCommands = toString (pkgs.writeScript "ssh-add" ''
|
services.xserver.displayManager.sessionCommands = "${pkgs.openssh}/bin/ssh-add";
|
||||||
#!${pkgs.expect}/bin/expect -f
|
|
||||||
spawn ${pkgs.openssh}/bin/ssh-add
|
|
||||||
expect "Enter passphrase for *:"
|
|
||||||
send "${ssh-passphrase}\n";
|
|
||||||
expect "Identity added: *"
|
|
||||||
interact
|
|
||||||
'');
|
|
||||||
|
|
||||||
programs.ssh.startAgent = true;
|
programs.ssh.startAgent = true;
|
||||||
|
|
||||||
@@ -35,17 +21,7 @@ in {
|
|||||||
port = sshPort;
|
port = sshPort;
|
||||||
};
|
};
|
||||||
makanek = {
|
makanek = {
|
||||||
hostname = externalNetwork.makanek;
|
hostname = "makanek.r";
|
||||||
user = "root";
|
|
||||||
port = sshPort;
|
|
||||||
};
|
|
||||||
ful = {
|
|
||||||
hostname = externalNetwork.ful;
|
|
||||||
user = "root";
|
|
||||||
port = sshPort;
|
|
||||||
};
|
|
||||||
tahina = {
|
|
||||||
hostname = "tahina.r";
|
|
||||||
user = "root";
|
user = "root";
|
||||||
port = sshPort;
|
port = sshPort;
|
||||||
};
|
};
|
||||||
@@ -54,6 +30,11 @@ in {
|
|||||||
user = "kfm";
|
user = "kfm";
|
||||||
port = sshPort;
|
port = sshPort;
|
||||||
};
|
};
|
||||||
|
toum = {
|
||||||
|
hostname = "toum.r";
|
||||||
|
user = "root";
|
||||||
|
port = sshPort;
|
||||||
|
};
|
||||||
kabsa = {
|
kabsa = {
|
||||||
hostname = "kabsa.r";
|
hostname = "kabsa.r";
|
||||||
user = "kfm";
|
user = "kfm";
|
||||||
@@ -67,16 +48,6 @@ in {
|
|||||||
hostname = "135.181.85.233";
|
hostname = "135.181.85.233";
|
||||||
user = "root";
|
user = "root";
|
||||||
};
|
};
|
||||||
"fysi-dev1" = {
|
|
||||||
hostname = "94.130.229.139";
|
|
||||||
user = "root";
|
|
||||||
identityFile = sshIdentity "fysiweb";
|
|
||||||
};
|
|
||||||
"fysi-shared0" = {
|
|
||||||
hostname = "49.12.205.235";
|
|
||||||
user = "root";
|
|
||||||
identityFile = sshIdentity "fysiweb";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
inherit (import ../lib) sshPort kieran;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
config,
|
|
||||||
lib,
|
|
||||||
pkgs,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (import <niveum/lib>) sshPort kieran;
|
|
||||||
in {
|
|
||||||
users.motd = "Welcome to ${config.networking.hostName}!";
|
users.motd = "Welcome to ${config.networking.hostName}!";
|
||||||
|
|
||||||
services.openssh = {
|
services.openssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
ports = [sshPort];
|
ports = [ sshPort ];
|
||||||
passwordAuthentication = false;
|
passwordAuthentication = false;
|
||||||
forwardX11 = true;
|
forwardX11 = true;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,368 +0,0 @@
|
|||||||
{
|
|
||||||
config,
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
dictionaries = {
|
|
||||||
lojban = {
|
|
||||||
jbo-deu = pkgs.fetchzip {
|
|
||||||
url = "https://guskant.github.io/lojbo/stardict/jbo-deu-20160110.tar.gz";
|
|
||||||
sha256 = "18ia15wyvd8ksi7yxn939qmvpdlrip8mvfywafv7vjj685rdhk80";
|
|
||||||
};
|
|
||||||
rafsi-jbo = pkgs.fetchzip {
|
|
||||||
url = "https://guskant.github.io/lojbo/stardict/rafsi-jbo-20160110.tar.gz";
|
|
||||||
sha256 = "00fkw964b48liz1jayfjb5jnpwihghkq4i28y8i11yqb56w6bn3c";
|
|
||||||
};
|
|
||||||
jbo-eng = pkgs.fetchzip {
|
|
||||||
url = "https://guskant.github.io/lojbo/stardict/jbo-eng-20160110.tar.gz";
|
|
||||||
sha256 = "15l65yshqdp0a7fr4a7ffwx3m2v6ymchxgra9zmk5bsgcxsb4r8m";
|
|
||||||
};
|
|
||||||
jbo-jbo = pkgs.fetchzip {
|
|
||||||
url = "https://guskant.github.io/lojbo/stardict/jbo-jbo-20160110.tar.gz";
|
|
||||||
sha256 = "1psfyrjrq84prr2s4jcm31ijykm7clyqygmbacr09n570xfwqcfw";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
classics = {
|
|
||||||
Pape = pkgs.fetchzip {
|
|
||||||
url = "http://tovotu.de/data/stardict/pape_gr-de.zip";
|
|
||||||
sha256 = "1kmbdjqinrcxkc6jdyyrq5rl2wzhnrychyynnh91yhrjwjxlh44k";
|
|
||||||
};
|
|
||||||
Woodhouse = pkgs.fetchzip {
|
|
||||||
url = "https://c.krebsco.de/Woodhouse.zip";
|
|
||||||
sha256 = "1dvnc2679yb048q2f3hr2h34acvhan0n3iir6h9ajlrdzz48mlkq";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
LSJ = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/nikita-moor/latin-dictionary/releases/download/2020-02-14/LiddellScott1940-stardict.zip";
|
|
||||||
sha256 = "13rprgd9jvnhxk9735c91xr6ywr0j5jiwkjnpm3qpvy93isyjbys";
|
|
||||||
};
|
|
||||||
GreekMorphology = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/latin-dict/Morphologia-Graeca/releases/download/v0.5/morphology-mobile-goldendict.oxia.zip";
|
|
||||||
sha256 = "0m75cppjjjmvv18cs7yh9f4p7ckqzxfznnndgkiw3yrfd50k8p96";
|
|
||||||
};
|
|
||||||
Frisk = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/latin-dict/Frisk1960/releases/download/v1.1/Frisk1960-stardict.zip";
|
|
||||||
sha256 = "1rk5a3n3fpfdcmg4bc5945m88s6ldxql8cjn4jqs33rgklh7n046";
|
|
||||||
};
|
|
||||||
Georges-De-Lat = pkgs.fetchzip {
|
|
||||||
url = "http://tovotu.de/data/stardict/georges_de-lat.zip";
|
|
||||||
sha256 = "1gx4vv64bi9lxw2zgd861j469jvw4f2hhfwy1gglb12id8r7rdrl";
|
|
||||||
};
|
|
||||||
Georges-Lat-De = pkgs.fetchzip {
|
|
||||||
url = "http://tovotu.de/data/stardict/georges_lat-de.zip";
|
|
||||||
sha256 = "0cc5xipn60anxvq8z2mw53d4gi1k92wbrj9m4ws3g9rh87fmkvgz";
|
|
||||||
};
|
|
||||||
LewisShort = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/latin-dict/LewisShort1879/releases/download/v1.3/LewisShort1879-stardict.zip";
|
|
||||||
sha256 = "1y3ans47iv8bzzb1paimdqvcid8ms04ikjbqy3iw077i2js3qbjk";
|
|
||||||
};
|
|
||||||
DoederleinSynonymes = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/latin-dict/Doederlein1874/releases/download/v1.1/Doederlein1875-stardict.zip";
|
|
||||||
sha256 = "0mhik7gjxl8ncr9g5z2l4pfk60k1c5n0gc1w0cnp2x1v6lqvb57h";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
englishGerman = {
|
|
||||||
Etymonline = pkgs.fetchzip {
|
|
||||||
url = "http://tovotu.de/data/stardict/etymonline.zip";
|
|
||||||
sha256 = "1bjja3n3layfd08xa1r0a6375dxh5zi6hlv7chkhgnx800cx7hxn";
|
|
||||||
};
|
|
||||||
Roget = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/bigdict/stardict-Roget_s_II_The_New_Thesaurus_3th_Ed-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1szyny9497bpyyccf9l5kr3bnw0wvl4cnsd0n1zscxpyzlsrqqbz";
|
|
||||||
};
|
|
||||||
JargonFile = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/dict.org/stardict-dictd-jargon-2.4.2.tar.bz2";
|
|
||||||
sha256 = "096phar9qpmm0fnaqv5nz8x9lpxwnfj78g4vjfcfyd7kqp7iqla4";
|
|
||||||
};
|
|
||||||
Oxford-Collocations = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/bigdict/stardict-Oxford_Collocations_Dictionary_2nd_Ed-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1zkfs0zxkcn21z2lhcabrs77v4ma9hpv7qm119hpyi1d8ajcw07q";
|
|
||||||
};
|
|
||||||
Langenscheidt-Deu-En = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/babylon/german/stardict-Handw_rterbuch_Deutsch_Englisc-2.4.2.tar.bz2";
|
|
||||||
sha256 = "12q9i5azq7ylyrpb6jqbaf1rxalc3kzcwjvbinvb0yabdxb80y30";
|
|
||||||
};
|
|
||||||
Langenscheidt-En-Deu = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/babylon/german/stardict-Handw_rterbuch_Englisch_Deutsc-2.4.2.tar.bz2";
|
|
||||||
sha256 = "087b05h155j5ldshfgx91pz81h6ijq2zaqjirg7ma8ig3l96zb59";
|
|
||||||
};
|
|
||||||
Duden_Das_Fremdworterbuch = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/babylon/german/stardict-Duden_Das_Fremdworterbuch-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1zrcay54ccl031s6dvjwsah5slhanmjab87d81rxlcy8fx0xd8wq";
|
|
||||||
};
|
|
||||||
Duden_De_De = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/babylon/german/stardict-Duden_De_De-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1fhay04w5aaj83axfmla2ql34nb60gb05dgv0k94ig7p8x4yxxlf";
|
|
||||||
};
|
|
||||||
ConciseOED = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/bigdict/stardict-Concise_Oxford_English_Dictionary-2.4.2.tar.bz2";
|
|
||||||
sha256 = "19kpcxbhqzpmhi94mp48nalgmsh6s7rsx1gb4kwkhirp2pbjcyl7";
|
|
||||||
};
|
|
||||||
Duden_Synonym = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/babylon/german/stardict-Duden_Synonym-2.4.2.tar.bz2";
|
|
||||||
sha256 = "0cx086zvb86bmz7i8vnsch4cj4fb0cp165g4hig4982zakj6f2jd";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
sanskrit = let
|
|
||||||
repo = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f";
|
|
||||||
in {
|
|
||||||
BoehtlingkRoth = pkgs.fetchzip {
|
|
||||||
url = "${repo}/sa-head/german-entries/tars/Bohtlingk-and-Roth-Grosses-Petersburger-Worterbuch__2021-10-05_14-23-18Z__19MB.tar.gz";
|
|
||||||
sha256 = "13414a8rgd7hd5ffar6nl68nk3ys60wjkgb7m11hp0ahaasmf6ly";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
BoehtlingkRothKurz = pkgs.fetchzip {
|
|
||||||
url = "${repo}/sa-head/german-entries/tars/Bohtlingk-Sanskrit-Worterbuch-in-kurzerer-Fassung__2021-10-05_14-23-18Z__10MB.tar.gz";
|
|
||||||
sha256 = "15yx31yrk40k9nn6kaysp4pprzj8dpd13dj3wafklc3izm8lr2wq";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
MonierWilliams = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f/sa-head/en-entries/tars/mw-cologne__2021-10-06_00-16-23Z__16MB.tar.gz";
|
|
||||||
sha256 = "0p99ybxwxmmd94hf035hvm2hhnfy84av7qq79xf28bh2rbx6s9ng";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
MonierWilliamsEnglish = pkgs.fetchzip {
|
|
||||||
url = "${repo}/en-head/tars/mw-english-sanskrit__2021-10-05_14-23-18Z__3MB.tar.gz";
|
|
||||||
sha256 = "09a61hhii4b1m2fkrlh4rm2xnlgwrllh84iypbc6wyj00w9jkl3x";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
Borooah = pkgs.fetchzip {
|
|
||||||
url = "${repo}/en-head/tars/borooah__2021-10-05_14-23-18Z__2MB.tar.gz";
|
|
||||||
sha256 = "0qmmfbynqgv125v48383i51ky9yi69zibhh7vwk95gyar2yrprn2";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
ApteEnglish = pkgs.fetchzip {
|
|
||||||
url = "${repo}/en-head/tars/apte-english-sanskrit-cologne__2021-10-06_00-12-51Z__1MB.tar.gz";
|
|
||||||
sha256 = "064ysm24ydc534ca689y5i2flnra8jkmh8zn0gsb6n8hdsb0d1lq";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
oed = {
|
|
||||||
OED1 = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/bigdict/stardict-Oxford_English_Dictionary_2nd_Ed._P1-2.4.2.tar.bz2";
|
|
||||||
sha256 = "0i5vv1rv44yfwyf9bfbdrb9brzhhpvz2jnh39fv8hh107nkv2vcf";
|
|
||||||
};
|
|
||||||
OED2 = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/bigdict/stardict-Oxford_English_Dictionary_2nd_Ed._P2-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1pk234pbq4pk55d8sjk0pp9j5sajm82f8804kf2xm2x5p387q1rg";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
russian = {
|
|
||||||
LingvoGermanRussian = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/lingvo/stardict-GR-LingvoUniversal-2.4.2.tar.bz2";
|
|
||||||
sha256 = "0p353gs2z4vj70hqsdhffjaaw3a4zlmcs46flipmf35lm5wmaj0g";
|
|
||||||
};
|
|
||||||
LingvoRussianGerman = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/lingvo/stardict-RG-LingvoUniversal-2.4.2.tar.bz2";
|
|
||||||
sha256 = "03f9wdmkgpjifpms7dyh10ma29wf3ka1j3zlp1av0cybhdldk2a8";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
makeStardictDataDir = dicts: pkgs.linkFarm "dictionaries" (lib.mapAttrsToList (name: path: {inherit name path;}) dicts);
|
|
||||||
|
|
||||||
makeStardict = name: dicts:
|
|
||||||
pkgs.writers.writeDashBin name ''
|
|
||||||
set -efu
|
|
||||||
export SDCV_PAGER=${toString sdcvPager}
|
|
||||||
exec ${pkgs.sdcv}/bin/sdcv --color --only-data-dir --data-dir ${makeStardictDataDir dicts} "$@"
|
|
||||||
'';
|
|
||||||
|
|
||||||
sdcvPager = pkgs.writeDash "sdcvPager" ''
|
|
||||||
export PATH=${lib.makeBinPath [pkgs.gnused pkgs.ncurses pkgs.less]}
|
|
||||||
sed "
|
|
||||||
s!<sup>1</sup>!¹!gI
|
|
||||||
s!<sup>2</sup>!²!gI
|
|
||||||
s!<sup>3</sup>!³!gI
|
|
||||||
s!<sup>4</sup>!⁴!gI
|
|
||||||
s! style=\"color: #...\"!!g;
|
|
||||||
s!<span class=\"zenoTXSpaced\">\([^<>]*\)</span>!\1!g;
|
|
||||||
s!</\?dictionary[^>]*>!!g;
|
|
||||||
s!<style.*</style>!!g;
|
|
||||||
s!<author>\([^<>]*\)</author>!\1 !g;
|
|
||||||
s!<quote lang=\"\(greek\|la\)\">\([^<>]*\)</quote>!$(tput sitm)\2$(tput sgr0)!g;
|
|
||||||
s!<biblScope>\([^<>]*\)</biblScope>!\1!g;
|
|
||||||
s!<mood>\([^<>]*\)</mood>!$(tput sitm)\1$(tput sgr0)!g;
|
|
||||||
s!<adv>\([^<>]*\)</adv>!$(tput sitm)\1$(tput sgr0)!g;
|
|
||||||
s!<gram[^>]*>\([^<>]*\)</gram>!$(tput sitm)\1$(tput sgr0)!g;
|
|
||||||
s!<bibl_title>\([^<>]*\)</bibl_title>!$(tput sitm)\1$(tput sgr0) !g;
|
|
||||||
s!<hi rend=\"ital\">\([^<>]*\)</hi>!$(tput sitm)\1$(tput sgr0) !g;
|
|
||||||
s!<dict_tr>\([^<>]*\)</dict_tr>!$(tput setaf 3)\1$(tput sgr0)!g;
|
|
||||||
s!<headword>\([^<>]*\)</headword>!$(tput bold)\1$(tput sgr0)\t!g;
|
|
||||||
s!</\?a[^>]*>!!g
|
|
||||||
s!</\?[cp]b[^>]*>!!g
|
|
||||||
s!</\?gramGrp[^>]*>!!g
|
|
||||||
s!</\?lbl[^>]*>!!g
|
|
||||||
s!</\?xr[^>]*>!!g
|
|
||||||
s!</\?pron[^>]*>!!g
|
|
||||||
s!</\?gen[^>]*>!!g
|
|
||||||
s!</\?tns[^>]*>!!g
|
|
||||||
s!</\?per[^>]*>!!g
|
|
||||||
s!</\?blockquote[^>]*>!!g
|
|
||||||
s!</\?etym[^>]*>!!g
|
|
||||||
s!<foreign[^>]*>!$(tput sitm)!g
|
|
||||||
s!</foreign[^>]*>!$(tput sgr0)!g
|
|
||||||
s!</\?date[^>]*>!!g
|
|
||||||
s!</\?placeName[^>]*>!!g
|
|
||||||
s!</\?itype[^>]*>!!g
|
|
||||||
s!</\?p>!!g
|
|
||||||
s!<input[^>]*>!!g
|
|
||||||
s!</\?orth[^>]*>!!g
|
|
||||||
s!</\?number[^>]*>!!g
|
|
||||||
s!</\?forename[^>]*>!!g
|
|
||||||
s!</\?persName[^>]*>!!g
|
|
||||||
s!</\?surname[^>]*>!!g
|
|
||||||
s!</\?entryFree[^>]*>!!g
|
|
||||||
s!</\?def[^>]*>!!g
|
|
||||||
s!</\?cit[^>]*>!!g
|
|
||||||
s!</\?pos[^>]*>!!g
|
|
||||||
s!</\?usg[^>]*>!!g
|
|
||||||
s!</\?ul>!!g
|
|
||||||
s!<li>!\n!g
|
|
||||||
s!</li>!!g
|
|
||||||
s!<bibl[^>]*>!$(tput setaf 245)!g
|
|
||||||
s!</bibl[^>]*>!$(tput sgr0)!g
|
|
||||||
s/<dt>/$(tput bold)/g;
|
|
||||||
s:</dt>:$(tput sgr0):g;
|
|
||||||
s/<dd>/\n/g;
|
|
||||||
s:</dd>::g;
|
|
||||||
s:<script>.*</script>::g;
|
|
||||||
s/<b>/$(tput bold)/gI;
|
|
||||||
s:</b>:$(tput sgr0):gI;
|
|
||||||
s:<br\s*/\?>:\n:gI;
|
|
||||||
s:<i>:$(tput sitm):gI;
|
|
||||||
s:</i>:$(tput sgr0):gI;
|
|
||||||
s:<u>:$(tput smul):gI;
|
|
||||||
s:</u>:$(tput sgr0):gI;
|
|
||||||
s:<FONT face=[^>]*>::g;
|
|
||||||
s:</FONT>::g;
|
|
||||||
s!<head>\([^<>]*\)</head>!$(tput bold)\1$(tput sgr0)!g;
|
|
||||||
s!<span lang=\"\(gr\|la\)\">\([^<>]*\)</span>!\2!g
|
|
||||||
s#<div style=\"margin-left:1em\">\(.*\)</div>#\\1#g;
|
|
||||||
s:<font color=\"brown\">\([^<>]*\)</font>:$(tput setaf 3)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=\"blue\">\([^<>]*\)</font>:$(tput setaf 4)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=\"red\">\([^<>]*\)</font>:$(tput setaf 1)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=\"darkviolet\">\([^<>]*\)</font>:$(tput setaf 5)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=\"#a0a\">\([^<>]*\)</font>:$(tput bold)\1$(tput sgr0):g
|
|
||||||
s:<font color=\"#838\">\([^<>]*\)</font>:$(tput setaf 3)\1$(tput sgr0):g
|
|
||||||
s:':':g
|
|
||||||
s:<:<:g
|
|
||||||
s:>:>:g
|
|
||||||
s:<font color=\"#007000\">\([^<>]*\)</font>:$(tput setaf 2)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=\"#007000\">\([^<>]*\)</font>:$(tput setaf 2)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=#000099>\([^<>]*\)</font>:$(tput setaf 4)\\1$(tput sgr0):g;
|
|
||||||
s:<font color=0000FF>\([^<>]*\)</font>:$(tput bold)\\1$(tput sgr0):g;
|
|
||||||
s:<IMG src=\"223E9A06.bmp\"[^>]*>:ː:g;
|
|
||||||
s:<IMG src=\"502F5DDA.bmp\"[^>]*>::g;
|
|
||||||
s:<IMG src=\"8DAD7054.bmp\"[^>]*>:n̩:g
|
|
||||||
s!</\?TABLE>!!gI
|
|
||||||
s!</\?TR[^>]*>!!gI
|
|
||||||
s!</\?TD>!!gI
|
|
||||||
s!</\?FONT[^>]*>!!gI
|
|
||||||
s!</\?A[^>]*>!!gI
|
|
||||||
s!<SPAN class=\"bsptext\">\([^<>]*\)</SPAN>!$(tput setaf 245)\1$(tput sgr0)!g
|
|
||||||
s! +! !g;
|
|
||||||
s!<div part=\"[^\"]*\">!\n\n&!g
|
|
||||||
s!<sense n=\"\([^\"]*\)\"!\n$(tput setaf 5)\1.$(tput sgr0) &!g;
|
|
||||||
s!</\?sense[^>]*>!!g
|
|
||||||
s!</\?div[^>]*>!!g
|
|
||||||
s!<span lang=\"gr\">!!g # unbalanced in Frisk
|
|
||||||
s!^\s*[0-9])!$(tput setaf 5)&$(tput sgr0)!g
|
|
||||||
s!</\?span[^>]*>!!gI
|
|
||||||
s!</\?p[^>]*>!!gI
|
|
||||||
" | less -FR
|
|
||||||
'';
|
|
||||||
in {
|
|
||||||
environment.etc.stardict.source = toString (makeStardictDataDir ({
|
|
||||||
Crum = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/misc/stardict-Coptic-English_all_dialects-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1fi281mb9yzv40wjsdapi8fzpa7x2yscz582lv2qnss9g8zzzzr9";
|
|
||||||
};
|
|
||||||
SmithBiographyMythology = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/latin-dict/Smith1873/releases/download/v1.0/Smith1873-stardict.zip";
|
|
||||||
sha256 = "01h5fxacp2m60xir8kzslkfy772vs3vmz07zhdwfhcwdaxif2af2";
|
|
||||||
};
|
|
||||||
SmithAntiquities = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/latin-dict/Smith1890/releases/download/v1.0/Smith1890-stardict.zip";
|
|
||||||
sha256 = "0vpsv62p2lrzmgys4d1swpnc6lqhdi7rxwkj2ngy3lz5dk3fysyb";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// dictionaries.classics
|
|
||||||
// dictionaries.sanskrit
|
|
||||||
// dictionaries.oed
|
|
||||||
// dictionaries.russian
|
|
||||||
// dictionaries.englishGerman));
|
|
||||||
|
|
||||||
environment.systemPackages = [
|
|
||||||
pkgs.goldendict
|
|
||||||
(makeStardict "lsj" dictionaries.classics)
|
|
||||||
(makeStardict "sa" dictionaries.sanskrit)
|
|
||||||
(makeStardict "oed" dictionaries.oed)
|
|
||||||
(makeStardict "sd-russian" dictionaries.russian)
|
|
||||||
(makeStardict "sd" dictionaries.englishGerman)
|
|
||||||
(makeStardict "jbo" dictionaries.lojban)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
https://github.com/latin-dict/Georges1910/releases/download/v1.0/Georges1910-stardict.zip
|
|
||||||
https://github.com/nikita-moor/latin-dictionary/releases/download/2020-02-14/LiddellScott1940-stardict.zip
|
|
||||||
http://download.huzheng.org/bigdict/stardict-Cambridge_Dictionary_of_American_Idioms-2.4.2.tar.bz2
|
|
||||||
http://download.huzheng.org/bigdict/stardict-Concise_Oxford_Thesaurus_2nd_Ed-2.4.2.tar.bz2
|
|
||||||
http://download.huzheng.org/bigdict/stardict-Urban_Dictionary_P1-2.4.2.tar.bz2
|
|
||||||
http://download.huzheng.org/bigdict/stardict-Urban_Dictionary_P2-2.4.2.tar.bz2
|
|
||||||
|
|
||||||
Duden_Rechtschreibung = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/babylon/german/stardict-Duden_Rechtschreibung-2.4.2.tar.bz2";
|
|
||||||
sha256 = "0xiprb45s88w62rn8rlbjrsagbiliay9hszsiy20glwabf6zsfji";
|
|
||||||
};
|
|
||||||
Duden = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/de/stardict-duden-2.4.2.tar.bz2";
|
|
||||||
sha256 = "049i4ynfqqxykv1nlkyks94mvn14s22qdax5gg7hx1ks5y4xw64j";
|
|
||||||
};
|
|
||||||
FreeOnlineDictionaryOfComputing = pkgs.fetchzip {
|
|
||||||
url = "http://download.huzheng.org/dict.org/stardict-dictd_www.dict.org_foldoc-2.4.2.tar.bz2";
|
|
||||||
sha256 = "1lw2i8dzxpx929cpgvv0x366dnh4drr10wzqmrhcd0kvwglqawgm";
|
|
||||||
};
|
|
||||||
Cappeller = pkgs.fetchzip {
|
|
||||||
url = "${repo}/sa-head/german-entries/tars/capeller-sanskrit-german__2021-10-05_14-23-18Z__1MB.tar.gz";
|
|
||||||
sha256 = "0jwrj2aih2lrcjg0lqm8jrvq9vsas9s8j4c9ggbg2n0jyz03kci3";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
Yates = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f/sa-head/en-entries/tars/yates__2021-10-05_14-23-18Z__2MB.tar.gz";
|
|
||||||
sha256 = "1k7gbalysf48pwa06zfykrqhdk466g35xy64b30k4z8bybgdn8z2";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
Wilson = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f/sa-head/en-entries/tars/wilson__2021-10-05_14-23-18Z__3MB.tar.gz";
|
|
||||||
sha256 = "0r5z1xif56zlw9r2jp3fvwmcjv4f2fhd9r17j30nah9awx2m1isg";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
SpokenSanskrit = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f/sa-head/en-entries/tars/spokensanskrit__2019-01-12_05-13-52Z__12MB.tar.gz";
|
|
||||||
sha256 = "0x8j657mawvdcyd1knzvf33yp15z77d661n3h6g9hcj7wn9s5xyk";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
Grassmann = pkgs.fetchzip {
|
|
||||||
url = "${repo}/sa-head/german-entries/tars/grassman-sanskrit-german__2021-10-05_14-23-18Z__2MB.tar.gz";
|
|
||||||
sha256 = "0jalsykaxkl6wzrky72lz8g3jdz26lmjpyibbfaf7a5vvnr55k02";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
Benfey = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f/sa-head/en-entries/tars/benfey__2021-10-05_14-23-18Z__2MB.tar.gz";
|
|
||||||
sha256 = "0lj3hgphqgnihn482g9kgjwbvdrcd38vc29v1fi36srn08qdhvcb";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
ApteSa = pkgs.fetchzip {
|
|
||||||
url = "${repo}/sa-head/en-entries/tars/apte-sa__2021-12-18_13-20-56Z__6MB.tar.gz";
|
|
||||||
sha256 = "0cq1dd02d1pvmjnibbs2cscifjnk2z0nqccf5yzzilxkzsrarh32";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
MacDonell = pkgs.fetchzip {
|
|
||||||
url = "https://github.com/indic-dict/stardict-sanskrit/raw/4ebd2d3db5820f7cbe3a649c3d5aa8f83d19b29f/sa-head/en-entries/tars/macdonell__2021-10-05_14-23-18Z__2MB.tar.gz";
|
|
||||||
sha256 = "1yzmj0393mxvjv4n2lnvd2c722v2bmxxiyq7pscdwni3bxip3h8s";
|
|
||||||
stripRoot = false;
|
|
||||||
};
|
|
||||||
*/
|
|
||||||
|
|
||||||
@@ -6,5 +6,5 @@
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
users.users.me.extraGroups = ["wheel"];
|
users.users.me.extraGroups = [ "wheel" ];
|
||||||
}
|
}
|
||||||
|
|||||||
64
configs/sxiv.nix
Normal file
64
configs/sxiv.nix
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
{ pkgs, lib, ... }:
|
||||||
|
let
|
||||||
|
important-directories = pkgs.writeText "directories" ''
|
||||||
|
h ~/
|
||||||
|
d ~/cloud/Dropbox/
|
||||||
|
g ~/cloud/gdrive/
|
||||||
|
s ~/cloud/Seafile/
|
||||||
|
kk ~/cloud/keybase/private/kmein/
|
||||||
|
kp ~/cloud/keybase/public/kmein/
|
||||||
|
t /tmp
|
||||||
|
D ~/Downloads
|
||||||
|
cf ''${XDG_CONFIG_HOME:-$HOME/.config}
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
environment.systemPackages = [ pkgs.sxiv ];
|
||||||
|
|
||||||
|
# TODO fix
|
||||||
|
home-manager.users.me.xdg.configFile."sxiv/exec/key-handler".source =
|
||||||
|
pkgs.writers.writeDash "key-handler" ''
|
||||||
|
PATH=$PATH:${
|
||||||
|
lib.makeBinPath [
|
||||||
|
pkgs.gnused
|
||||||
|
pkgs.gawk
|
||||||
|
pkgs.dmenu
|
||||||
|
pkgs.coreutils
|
||||||
|
pkgs.libnotify
|
||||||
|
pkgs.imagemagick
|
||||||
|
pkgs.xclip
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
echo >&2 key "$1" pressed
|
||||||
|
while read file; do
|
||||||
|
case "$1" in
|
||||||
|
"c")
|
||||||
|
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Copy file(s) to where?" | sed "s|~|$HOME|g")"
|
||||||
|
[ -z "$destdir" ] && exit
|
||||||
|
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||||
|
cp "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file copied to $destdir." &
|
||||||
|
;;
|
||||||
|
"m")
|
||||||
|
[ -z "$destdir" ] && destdir="$(sed "s/\s.*#.*$//;/^\s*$/d" ${important-directories} | awk '{print $2}' | dmenu -l 20 -i -p "Move file(s) to where?" | sed "s|~|$HOME|g")"
|
||||||
|
[ -z "$destdir" ] && exit
|
||||||
|
[ ! -d "$destdir" ] && notify-send "$destdir is not a directory, cancelled." && exit
|
||||||
|
mv "$file" "$destdir" && notify-send -i "$(readlink -f "$file")" "$file moved to $destdir." &
|
||||||
|
;;
|
||||||
|
"r")
|
||||||
|
convert -rotate 90 "$file" "$file" ;;
|
||||||
|
"R")
|
||||||
|
convert -rotate -90 "$file" "$file" ;;
|
||||||
|
"f")
|
||||||
|
convert -flop "$file" "$file" ;;
|
||||||
|
"y")
|
||||||
|
echo -n "$file" | xclip -selection clipboard &&
|
||||||
|
notify-send "$file copied to clipboard" & ;;
|
||||||
|
"Y")
|
||||||
|
readlink -f "$file" | xclip -selection clipboard &&
|
||||||
|
notify-send "$(readlink -f "$file") copied to clipboard" & ;;
|
||||||
|
"d")
|
||||||
|
[ "$(printf "No\\nYes" | dmenu -i -p "Really delete $file?")" = "Yes" ] && rm "$file" && notify-send "$file deleted." ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
}
|
||||||
61
configs/tarot.nix
Normal file
61
configs/tarot.nix
Normal 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;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,11 +1,6 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
nixpkgs-unstable = import <nixpkgs-unstable> {};
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
unstable = import <nixos-unstable> {inherit (config.nixpkgs) config;};
|
|
||||||
|
|
||||||
toSymbols = pkgs.writers.writeDash "to-symbols" ''
|
toSymbols = pkgs.writers.writeDash "to-symbols" ''
|
||||||
${pkgs.gnused}/bin/sed '
|
${pkgs.gnused}/bin/sed '
|
||||||
s/\bTri\b/△/;
|
s/\bTri\b/△/;
|
||||||
@@ -44,17 +39,15 @@
|
|||||||
'';
|
'';
|
||||||
in {
|
in {
|
||||||
niveum.telegramBots.transits = {
|
niveum.telegramBots.transits = {
|
||||||
enable = false;
|
enable = true;
|
||||||
time = "*:0/1";
|
time = "4:00";
|
||||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||||
chatIds = ["-1001796440545"];
|
chatIds = [ "18980945" ];
|
||||||
command = toString (pkgs.writers.writeDash "common-transits" ''
|
command = toString (pkgs.writers.writeDash "common-transits" ''
|
||||||
now=$(${pkgs.coreutils}/bin/date +%_H:%M | ${pkgs.gnused}/bin/sed 's/^\s*//')
|
|
||||||
date=$(${pkgs.coreutils}/bin/date +'%m %d %Y')
|
|
||||||
{
|
{
|
||||||
${unstable.astrolog}/bin/astrolog -qd $date -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto "North Node"
|
${nixpkgs-unstable.astrolog}/bin/astrolog -n -zN Berlin -Yt -Yd -d -R Uranus Neptune Pluto
|
||||||
${unstable.astrolog}/bin/astrolog -Yt -Yd -q 10 22 1999 6:32 -zN Kassel -td $date -R Uranus Neptune Pluto "North Node"
|
${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 | ${pkgs.gnugrep}/bin/grep "^$now" || :
|
} | ${toSymbols} | ${pkgs.coreutils}/bin/sort -n
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
{
|
{ pkgs, lib, ... }:
|
||||||
pkgs,
|
let
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
autorenkalender-package = pkgs.fetchFromGitHub {
|
autorenkalender-package = pkgs.fetchFromGitHub {
|
||||||
owner = "kmein";
|
owner = "kmein";
|
||||||
repo = "autorenkalender";
|
repo = "autorenkalender";
|
||||||
@@ -10,22 +7,14 @@
|
|||||||
sha256 = "1pa7sjg33vdnjianrqldv445jdzzv3mn231ljk1j58hs0cd505gs";
|
sha256 = "1pa7sjg33vdnjianrqldv445jdzzv3mn231ljk1j58hs0cd505gs";
|
||||||
};
|
};
|
||||||
autorenkalender =
|
autorenkalender =
|
||||||
pkgs.python3Packages.callPackage autorenkalender-package {};
|
pkgs.python3Packages.callPackage autorenkalender-package { };
|
||||||
in {
|
in {
|
||||||
niveum.telegramBots.autorenkalender = {
|
niveum.telegramBots.autorenkalender = {
|
||||||
enable = true;
|
enable = true;
|
||||||
time = "07:00";
|
time = "07:00";
|
||||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
||||||
chatIds = ["@autorenkalender"];
|
chatIds = [ "@autorenkalender" ];
|
||||||
parseMode = "Markdown";
|
parseMode = "Markdown";
|
||||||
command = "${autorenkalender}/bin/autorenkalender";
|
command = "${autorenkalender}/bin/autorenkalender";
|
||||||
};
|
};
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Autorenkalender";
|
|
||||||
description = "sends <a href=\"https://www.projekt-gutenberg.org/\">Projekt Gutenberg</a>'s anniversary information to Telegram.";
|
|
||||||
link = "https://t.me/Autorenkalender";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,15 +1,13 @@
|
|||||||
{
|
{ config, pkgs, lib, ... }:
|
||||||
config,
|
let
|
||||||
pkgs,
|
telebots = let
|
||||||
lib,
|
telebots-package = pkgs.fetchFromGitHub {
|
||||||
...
|
owner = "kmein";
|
||||||
}: let
|
repo = "telebots";
|
||||||
nixpkgs-21-11 = import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-21.11.tar.gz") {
|
rev = "22931c9457e092c4e413555dbe61819d77844246";
|
||||||
config.permittedInsecurePackages = [
|
sha256 = "0byp3w6li3fin7ry0ki4rmgkaajdil424y5pc1j7ci9mpws0s5ik";
|
||||||
"python3.9-poetry-1.1.12"
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
telebots = nixpkgs-21-11.callPackage <telebots> {};
|
in pkgs.callPackage telebots-package {};
|
||||||
reverseDirectory = "/run/telegram-reverse";
|
reverseDirectory = "/run/telegram-reverse";
|
||||||
proverbDirectory = "/run/telegram-proverb";
|
proverbDirectory = "/run/telegram-proverb";
|
||||||
inherit (import <niveum/lib>) tmpfilesConfig;
|
inherit (import <niveum/lib>) tmpfilesConfig;
|
||||||
@@ -18,43 +16,22 @@ in {
|
|||||||
./literature-quote.nix
|
./literature-quote.nix
|
||||||
./astrology.nix
|
./astrology.nix
|
||||||
./autorenkalender.nix
|
./autorenkalender.nix
|
||||||
./hesychius.nix
|
|
||||||
./smyth.nix
|
|
||||||
./nachtischsatan.nix
|
./nachtischsatan.nix
|
||||||
./tlg-wotd.nix
|
./tlg-wotd.nix
|
||||||
<niveum/modules/telegram-bot.nix>
|
<niveum/modules/telegram-bot.nix>
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.tmpfiles.rules = map (path:
|
systemd.tmpfiles.rules = map (path: tmpfilesConfig {
|
||||||
tmpfilesConfig {
|
|
||||||
type = "d";
|
type = "d";
|
||||||
mode = "0750";
|
mode = "0750";
|
||||||
age = "1h";
|
age = "1h";
|
||||||
inherit path;
|
inherit path;
|
||||||
}) [reverseDirectory proverbDirectory];
|
}) [ reverseDirectory proverbDirectory ];
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Rückwarts-Bot";
|
|
||||||
link = "https://t.me/RueckwaertsBot";
|
|
||||||
description = "reverses things on Telegram.";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "BetaCode-Bot";
|
|
||||||
link = "https://t.me/BetaCodeBot";
|
|
||||||
description = "converts <a href=\"https://en.wikipedia.org/wiki/Beta_Code\">beta code</a> to polytonic Greek on Telegram.";
|
|
||||||
}
|
|
||||||
{
|
|
||||||
title = "Sprichwortgenerator-Bot";
|
|
||||||
link = "https://t.me/SprichwortGeneratorBot";
|
|
||||||
description = "generates useless German proverbs with optional stock photo background on Telegram.";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
systemd.services.telegram-reverse = {
|
systemd.services.telegram-reverse = {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "Telegram reverse bot";
|
description = "Telegram reverse bot";
|
||||||
path = [pkgs.ffmpeg];
|
path = [ pkgs.ffmpeg ];
|
||||||
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/reverse.token>;
|
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/reverse.token>;
|
||||||
enable = true;
|
enable = true;
|
||||||
script = "${telebots}/bin/telegram-reverse";
|
script = "${telebots}/bin/telegram-reverse";
|
||||||
@@ -63,7 +40,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.telegram-betacode = {
|
systemd.services.telegram-betacode = {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "Telegram beta code bot";
|
description = "Telegram beta code bot";
|
||||||
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/betacode.token>;
|
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/betacode.token>;
|
||||||
enable = true;
|
enable = true;
|
||||||
@@ -72,7 +49,7 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.telegram-proverb = {
|
systemd.services.telegram-proverb = {
|
||||||
wantedBy = ["multi-user.target"];
|
wantedBy = [ "multi-user.target" ];
|
||||||
description = "Telegram proverb bot";
|
description = "Telegram proverb bot";
|
||||||
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/proverb.token>;
|
environment.TELEGRAM_BOT_TOKEN = lib.strings.fileContents <system-secrets/telegram/proverb.token>;
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|||||||
@@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
pkgs,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
hesychius = <scripts> + "/hesychius/hesychius.txt";
|
|
||||||
in {
|
|
||||||
niveum.telegramBots.hesychius = {
|
|
||||||
enable = true;
|
|
||||||
time = "08:00";
|
|
||||||
token = lib.strings.fileContents <system-secrets/telegram/kmein.token>;
|
|
||||||
chatIds = ["@HesychiosAlexandreus"];
|
|
||||||
command = "${pkgs.coreutils}/bin/shuf -n1 ${hesychius}";
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.timers.telegram-bot-hesychius.timerConfig.RandomizedDelaySec = "10h";
|
|
||||||
|
|
||||||
niveum.passport.services = [
|
|
||||||
{
|
|
||||||
title = "Hesychius of Alexandria Bot";
|
|
||||||
description = "sends a random word from Hesychius of Alexandria's lexicon to Telegram.";
|
|
||||||
link = "https://t.me/HesychiosAlexandreus";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user