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

33 Commits

Author SHA1 Message Date
1c7c7b71a1 use substituteInPlace 2025-12-25 09:08:42 +01:00
5d0639953c use finalAttrs 2025-12-25 09:06:37 +01:00
b7217b9e95 spotifyd: remove 2025-12-25 08:57:01 +01:00
dad20851c9 name is set automatically from pname and version 2025-12-25 08:51:17 +01:00
0752f23082 set doCheck 2025-12-25 08:49:09 +01:00
54b545bf75 explicitly import nixpkgs-unstable 2025-12-25 08:42:38 +01:00
a30c356012 filter src 2025-12-25 08:42:13 +01:00
3cf2615bd4 do not import nixpkgs with lookup path 2025-12-25 08:34:53 +01:00
213d2da55b remove rec 2025-12-25 08:33:18 +01:00
3a6428982f minimize usage of // 2025-12-25 08:21:59 +01:00
583bc83839 distrobump: remove 2025-12-25 08:14:37 +01:00
ec7f5f5bb1 networkmanager-declarative: remove 2025-12-25 08:13:48 +01:00
746a78ff8f remove @ pattern 2025-12-25 08:13:02 +01:00
8fd51be217 prometheus: monitor iching 2025-12-22 14:01:15 +01:00
6ac0c0bae4 prometheus: drop hu and fu monitoring 2025-12-22 14:01:06 +01:00
2eb69eb1fe update secrets 2025-12-22 13:59:11 +01:00
0b7308e602 dashboard: remove 2025-12-22 11:50:22 +01:00
f329f25992 picom: remove 2025-12-22 11:31:21 +01:00
11647db257 xsecurelock: replace slock, run before suspend 2025-12-22 11:31:21 +01:00
9f65360713 getty: add greeting 2025-12-22 11:27:56 +01:00
7c2e5533db remove fritzbox residue 2025-12-22 11:27:38 +01:00
32fa3e75ea mp3player-write 2025-12-22 08:51:07 +01:00
435aa4a365 secrets: update 2025-12-22 08:50:53 +01:00
8d955bf640 fatteh: configure systemd-boot 2025-12-22 08:50:44 +01:00
a44d15a166 nethack 2025-12-22 08:50:14 +01:00
b33e1d3569 zaatar: 25.11 2025-12-22 08:49:57 +01:00
cba0f92a7a zaatar: remove NAS 2025-12-22 08:49:35 +01:00
1f163d65cd atuin: remove 2025-12-22 08:40:28 +01:00
e816145b13 redshift: enable 2025-12-22 08:35:11 +01:00
4cb62b382b Merge remote-tracking branch 'origin/nethack' 2025-12-20 11:46:20 +01:00
ad2c922ab4 iching: init 2025-12-20 11:45:58 +01:00
a0f7867a25 tarot: generalize 2025-12-20 11:31:12 +01:00
dd75268d60 update secrets 2025-12-20 11:27:04 +01:00
48 changed files with 953 additions and 1162 deletions

114
.bin/mp3player-write Executable file
View File

@@ -0,0 +1,114 @@
#!/usr/bin/env bash
# Usage:
# ./mp3_transfer.sh -s 1.3 /mnt/mp3player file1.m4a file2.m4a ...
set -e
# Default speed
SPEED=1.0
# Parse options
while getopts ":s:" opt; do
case $opt in
s)
SPEED=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires a value." >&2
exit 1
;;
esac
done
# Shift past the options
shift $((OPTIND -1))
# Check arguments
if [ "$#" -lt 2 ]; then
echo "Usage: $0 [-s speed] MOUNT_POINT FILE1 [FILE2 ...]"
exit 1
fi
MOUNT_POINT=$1
shift
FILES=("$@")
# Check mount point exists
if [ ! -d "$MOUNT_POINT" ]; then
echo "Error: Mount point '$MOUNT_POINT' does not exist."
exit 1
fi
# Estimate required space
TOTAL_SIZE=0
for f in "${FILES[@]}"; do
if [ ! -f "$f" ]; then
echo "Warning: File '$f' does not exist, skipping."
continue
fi
# Get file size in bytes
FILE_SIZE=$(stat --printf="%s" "$f")
# Estimate mp3 output size: roughly 1/2 of original m4a (adjust if needed)
TOTAL_SIZE=$((TOTAL_SIZE + FILE_SIZE / 2))
done
# Get available space in bytes
AVAILABLE=$(df --output=avail "$MOUNT_POINT" | tail -n 1)
AVAILABLE=$((AVAILABLE * 1024)) # df reports in KB
if [ "$TOTAL_SIZE" -gt "$AVAILABLE" ]; then
echo "Error: Not enough space on device. Required: $TOTAL_SIZE bytes, Available: $AVAILABLE bytes"
exit 1
fi
echo "Enough space available. Starting conversion..."
sanitize_filename() {
local name="$1"
# Remove path, keep only base name
name=$(basename "$name" .m4a)
# Replace spaces and special chars with underscore
name=$(echo "$name" | tr ' ' '_' | tr -cd '[:alnum:]_-')
# Truncate to max 50 chars
echo "${name:0:50}"
}
# Convert and copy files
for f in "${FILES[@]}"; do
if [ ! -f "$f" ]; then
continue
fi
# Determine the next prefix
existing_prefixes=$(ls "$MOUNT_POINT" | grep -E '^[0-9].*\.mp3$' | sed -E 's/^([0-9]).*/\1/' | sort -n | uniq)
for i in {0..9}; do
if ! echo "$existing_prefixes" | grep -q "^$i$"; then
PREFIX=$i
break
fi
done
echo "Using prefix: $PREFIX"
BASENAME=$(sanitize_filename "$f")
OUT_PATTERN="$MOUNT_POINT/${PREFIX}%02d_${BASENAME}.mp3"
echo "Converting '$f' to '$OUT_PATTERN' at speed $SPEED..."
ffmpeg -i "$f" \
-filter:a "atempo=$SPEED" -ar 44100 -ac 2 -c:a libmp3lame -b:a 128k \
-f segment -segment_time 300 \
"$OUT_PATTERN"
# Update prefix for next file
# Count how many segments were created
SEG_COUNT=$(ls "$MOUNT_POINT" | grep -E "^${PREFIX}[0-9]{2}_" | wc -l)
PREFIX=$((PREFIX + SEG_COUNT))
done
echo "All files processed successfully."

View File

@@ -85,7 +85,7 @@ in {
'';
in
{
nixi = "nix repl '<nixpkgs>'";
nixi = "nix repl nixpkgs";
take = "source ${take}";
wcd = "source ${wcd}";
where = "source ${where}";

View File

@@ -4,9 +4,11 @@
lib,
niveumPackages,
...
}: let
}:
let
inherit (import ../lib/email.nix) defaults thunderbirdProfile;
in {
in
{
age.secrets = {
email-password-ical-ephemeris = {
file = ../secrets/email-password-ical-ephemeris.age;
@@ -50,7 +52,8 @@ in {
programs.mbsync = {
enable = true;
extraConfig = lib.concatStringsSep "\n\n" (lib.mapAttrsToList (name: account: ''
extraConfig = lib.concatStringsSep "\n\n" (
lib.mapAttrsToList (name: account: ''
IMAPAccount ${name}
CertificateFile /etc/ssl/certs/ca-certificates.crt
Host ${account.imap.host}
@@ -74,30 +77,35 @@ in {
Patterns *
Remove None
SyncState *
'')
config.home-manager.users.me.accounts.email.accounts);
'') config.home-manager.users.me.accounts.email.accounts
);
};
accounts.email.accounts = {
cock =
lib.recursiveUpdate defaults
rec {
let
mailhost = "mail.cock.li";
address = "2210@cock.li";
in
lib.recursiveUpdate defaults {
address = address;
userName = address;
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-cock.path}";
realName = "2210";
imap.host = "mail.cock.li";
imap.host = mailhost;
imap.port = 993;
smtp.host = imap.host;
smtp.host = mailhost;
smtp.port = 25;
smtp.tls.useStartTls = true;
};
ical-ephemeris =
lib.recursiveUpdate defaults
rec {
userName = "ical.ephemeris@web.de";
let
address = "ical.ephemeris@web.de";
in
lib.recursiveUpdate defaults {
userName = address;
realName = "Kieran from iCal Ephemeris";
address = userName;
address = address;
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-ical-ephemeris.path}";
imap.host = "imap.web.de";
imap.port = 993;
@@ -106,15 +114,18 @@ in {
smtp.tls.useStartTls = true;
};
posteo =
lib.recursiveUpdate defaults
rec {
let
mailhost = "posteo.de";
address = "kieran.meinhardt@posteo.net";
aliases = ["kmein@posteo.de"];
in
lib.recursiveUpdate defaults {
address = address;
aliases = [ "kmein@posteo.de" ];
userName = address;
imap.host = "posteo.de";
imap.host = mailhost;
imap.port = 993;
imap.tls.enable = true;
smtp.host = imap.host;
smtp.host = mailhost;
smtp.port = 465;
smtp.tls.enable = true;
primary = true;
@@ -141,10 +152,8 @@ in {
"msgcompose.text_color" = config.lib.stylix.colors.withHashtag.base00;
"msgcompose.background_color" = config.lib.stylix.colors.withHashtag.base05;
};
userChrome = ''
'';
userContent = ''
'';
userChrome = '''';
userContent = '''';
withExternalGnupg = false;
};
};
@@ -279,7 +288,9 @@ in {
ui.spinner = ". , .";
general.unsafe-accounts-conf = true;
general.pgp-provider = "gpg";
viewer = {pager = "${pkgs.less}/bin/less -R";};
viewer = {
pager = "${pkgs.less}/bin/less -R";
};
compose = {
# address-book-cmd = "khard email --remove-first-line --parsable '%s'";
no-attachment-warning = "(attach|attached|attachments?|anbei|Anhang|angehängt|beigefügt)";
@@ -296,24 +307,26 @@ in {
"message/rfc822" = "${pkgs.aerc}/libexec/aerc/filters/colorize";
"application/x-sh" = "${pkgs.bat}/bin/bat -fP -l sh";
};
openers = let
as-pdf = pkgs.writers.writeDash "as-pdf" ''
d=$(mktemp -d)
trap clean EXIT
clean() {
rm -rf "$d"
}
${pkgs.libreoffice}/bin/libreoffice --headless --convert-to pdf "$1" --outdir "$d"
${pkgs.zathura}/bin/zathura "$d"/*.pdf
'';
in {
"image/*" = "${pkgs.nsxiv}/bin/nsxiv";
"application/pdf" = "${pkgs.zathura}/bin/zathura";
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = toString as-pdf;
"application/vnd.oasis.opendocument.text" = toString as-pdf;
"video/*" = "${pkgs.mpv}/bin/mpv";
"audio/*" = "${pkgs.mpv}/bin/mpv";
};
openers =
let
as-pdf = pkgs.writers.writeDash "as-pdf" ''
d=$(mktemp -d)
trap clean EXIT
clean() {
rm -rf "$d"
}
${pkgs.libreoffice}/bin/libreoffice --headless --convert-to pdf "$1" --outdir "$d"
${pkgs.zathura}/bin/zathura "$d"/*.pdf
'';
in
{
"image/*" = "${pkgs.nsxiv}/bin/nsxiv";
"application/pdf" = "${pkgs.zathura}/bin/zathura";
"application/vnd.openxmlformats-officedocument.wordprocessingml.document" = toString as-pdf;
"application/vnd.oasis.opendocument.text" = toString as-pdf;
"video/*" = "${pkgs.mpv}/bin/mpv";
"audio/*" = "${pkgs.mpv}/bin/mpv";
};
};
templates = {

View File

@@ -1,8 +1,9 @@
{pkgs, ...}:
# https://paste.sr.ht/~erictapen/11716989e489b600f237041b6d657fdf0ee17b34
let
certificate = pkgs.stdenv.mkDerivation rec {
name = "dst-root-ca-x3.pem";
name = "dst-root-ca-x3.pem";
certificate = pkgs.stdenv.mkDerivation {
inherit name;
src = builtins.toFile "${name}.sed" ''
1,/DST Root CA X3/d
1,/-----END CERTIFICATE-----/p

View File

@@ -140,9 +140,9 @@ in
agent = {
enable = true;
pinentryPackage = pkgs.pinentry-qt;
settings = rec {
default-cache-ttl = 2 * 60 * 60;
max-cache-ttl = 4 * default-cache-ttl;
settings = let defaultCacheTtl = 2 * 60 * 60; in {
default-cache-ttl = defaultCacheTtl;
max-cache-ttl = 4 * defaultCacheTtl;
};
};
};
@@ -161,7 +161,7 @@ in
}
{
services.getty = {
greetingLine = lib.mkForce "";
greetingLine = lib.mkForce "As-salamu alaykum wa rahmatullahi wa barakatuh!";
helpLine = lib.mkForce "";
};
}
@@ -232,7 +232,6 @@ in
./flameshot.nix
./packages.nix
./virtualization.nix
./picom.nix
./stardict.nix
./polkit.nix
./printing.nix
@@ -257,36 +256,17 @@ in
}
./tor.nix
./mastodon-bot.nix
{
fileSystems."${remoteDir}/fritz" = {
device = "//192.168.178.1/FRITZ.NAS/Backup";
fsType = "cifs";
options = [
"username=ftpuser"
"password=ftppassword"
"noauto"
"nounix"
"rw"
# "noserverino" # ref https://askubuntu.com/a/1265165
"uid=${toString config.users.users.me.uid}"
"gid=${toString config.users.groups.users.gid}"
"x-systemd.automount"
"x-systemd.device-timeout=1"
"x-systemd.idle-timeout=1min"
];
};
}
{
home-manager.users.me = {
xdg.userDirs = rec {
xdg.userDirs = let pictures = "${config.users.users.me.home}/cloud/nextcloud/Bilder"; in {
enable = true;
documents = "${config.users.users.me.home}/cloud/nextcloud/Documents";
desktop = "/tmp";
download = "${config.users.users.me.home}/sync/Downloads";
music = "${config.users.users.me.home}/mobile/audio";
pictures = "${config.users.users.me.home}/cloud/nextcloud/Bilder";
publicShare = "${config.users.users.me.home}/cloud/nextcloud/tmp";
videos = pictures;
pictures = pictures;
};
};
}

View File

@@ -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;
}

View File

@@ -119,11 +119,11 @@ in {
vollkorn
zilla-slab
]; # google-fonts league-of-moveable-type
fontconfig.defaultFonts = rec {
fontconfig.defaultFonts = let emoji = ["Noto Color Emoji"]; in {
monospace = ["Noto Sans Mono"] ++ emoji;
serif = ["Noto Serif" "Noto Naskh Arabic" "Noto Serif Devanagari"];
sansSerif = ["Noto Sans Display" "Noto Naskh Arabic" "Noto Sans Hebrew" "Noto Sans Devanagari" "Noto Sans CJK JP" "Noto Sans Coptic" "Noto Sans Syriac Western"];
emoji = ["Noto Color Emoji"];
inherit emoji;
};
# xelatex fails with woff files
# ref https://tex.stackexchange.com/questions/392144/xelatex-and-fontspec-crash-trying-to-find-woff-file-for-some-fonts-but-not-other

View File

@@ -1,55 +0,0 @@
{
config,
lib,
pkgs,
...
}: let
inherit (import ../lib/email.nix) defaults;
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
in {
age.secrets = {
email-password-fysi = {
file = ../secrets/email-password-fysi.age;
owner = config.users.users.me.name;
group = config.users.users.me.group;
mode = "400";
};
};
home-manager.users.me = {
accounts.email.accounts = {
fysi =
lib.recursiveUpdate defaults
rec {
address = "kieran@fysi.tech";
userName = address;
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-fysi.path}";
flavor = "fastmail.com";
};
};
programs.ssh.matchBlocks = rec {
"nextcloud.fysi.dev" = {
hostname = "116.203.82.203";
user = "root";
};
"lingua.miaengiadina.ch" = {
hostname = "135.181.85.233";
user = "root";
};
"cms-dev.woc2023.app".identityFile = sshIdentity "fysiweb";
"cms-master.woc2023.app".identityFile = sshIdentity "fysiweb";
"fysi-dev1" = {
hostname = "94.130.229.139";
user = "root";
identityFile = sshIdentity "fysiweb";
};
${fysi-dev1.hostname} = fysi-dev1;
"fysi-shared0" = {
hostname = "49.12.205.235";
user = "root";
identityFile = sshIdentity "fysiweb";
};
};
};
}

View File

@@ -5,9 +5,11 @@
};
home-manager.users.me = {
programs.fzf = rec {
enable = true;
programs.fzf = let
defaultCommand = "${pkgs.fd}/bin/fd --type f --strip-cwd-prefix --follow --no-ignore-vcs --exclude .git";
in {
enable = true;
defaultCommand = defaultCommand;
defaultOptions = ["--height=40%"];
changeDirWidgetCommand = "${pkgs.fd}/bin/fd --type d";
changeDirWidgetOptions = [

View File

@@ -4,6 +4,12 @@
pkgs.zeroad
pkgs.mari0
pkgs.luanti # fka minetest
# pkgs.openarena
# pkgs.teeworlds
pkgs.nethack
# pkgs.freeciv
# pkgs.lincity-ng
# pkgs.superTuxKart
];
networking.firewall = {
# for 0ad multiplayer

View File

@@ -5,11 +5,6 @@
niveumPackages,
...
}: let
dashboard = pkgs.writers.writeDashBin "dashboard" ''
${pkgs.alacritty}/bin/alacritty --option font.size=4 --class dashboard --command ${pkgs.writers.writeDash "dashboard-inner" ''
exec ${pkgs.procps}/bin/watch -c -n 10 ${niveumPackages.q}/bin/q
''}
'';
inherit (import ../lib) defaultApplications;
klem = niveumPackages.klem.override {
config.dmenu = "${pkgs.dmenu}/bin/dmenu -i -p klem";
@@ -86,9 +81,14 @@ in {
};
};
programs.slock.enable = true;
environment.systemPackages = [dashboard];
environment.systemPackages = [
pkgs.xsecurelock
];
environment.sessionVariables = {
XSECURELOCK_NO_COMPOSITE = "1";
XSECURELOCK_BACKGROUND_COLOR = "navy";
XSECURELOCK_PASSWORD_PROMPT = "time_hex";
};
services.displayManager.defaultSession = "none+i3";
services.xserver = {
@@ -113,7 +113,6 @@ in {
'';
};
home-manager.users.me = let
modifier = "Mod4";
infoWorkspace = "";
@@ -131,12 +130,12 @@ in {
titlebar = false;
border = 1;
};
bars = [
(config.home-manager.users.me.stylix.targets.i3.exportedBarConfig
// rec {
bars = let position = "bottom"; in [
(lib.recursiveUpdate config.home-manager.users.me.stylix.targets.i3.exportedBarConfig
{
workspaceButtons = true;
mode = "hide"; # "dock";
position = "bottom";
inherit position;
statusCommand = toString (pkgs.writers.writeDash "i3status-rust" ''
export I3RS_GITHUB_TOKEN="$(cat ${config.age.secrets.github-token-i3status-rust.path})"
export OPENWEATHERMAP_API_KEY="$(cat ${config.age.secrets.openweathermap-api-key.path})"
@@ -275,7 +274,7 @@ in {
xsession.windowManager.i3 = {
enable = true;
extraConfig = ''
bindsym --release ${modifier}+Shift+w exec /run/wrappers/bin/slock
bindsym --release ${modifier}+Shift+w exec xsecurelock
exec "${pkgs.obsidian}/bin/obsidian"
for_window [class="obsidian"] , move scratchpad
@@ -284,8 +283,7 @@ in {
exec "${pkgs.writers.writeDash "irc" "exec ${pkgs.alacritty}/bin/alacritty --class message -e ssh weechat@makanek -t tmux attach-session -t IM"}"
exec "${pkgs.writers.writeDash "email" "exec ${pkgs.alacritty}/bin/alacritty --class message -e aerc"}"
assign [class="dashboard"] ${infoWorkspace}
exec ${dashboard}/bin/dashboard
exec --no-startup-id ${pkgs.xss-lock}/bin/xss-lock -- xsecurelock
'';
config = {
inherit modifier gaps modes bars floating window colors;

View File

@@ -94,9 +94,9 @@ in
home-manager.users.me = {
home.file =
lib.mapAttrs' (name: path: lib.nameValuePair ".xkb/symbols/${name}" { source = path; })
(lib.filterAttrs (_: value: !(value ? "code")) languages) // {
(lib.recursiveUpdate (lib.filterAttrs (_: value: !(value ? "code")) languages) {
".xkb/symbols/ir".source = ../lib/keyboards/farsi;
};
});
};
console.keyMap = "de";

View File

@@ -10,11 +10,6 @@
username = "kieran";
passwordFile = config.age.secrets.nextcloud-password-kieran.path;
};
fysiCloud = {
davEndpoint = "https://nextcloud.fysi.dev/remote.php/dav";
username = "kmein";
passwordFile = config.age.secrets.nextcloud-password-fysi.path;
};
in {
age.secrets = {
nextcloud-password-kieran = {

View File

@@ -1,25 +0,0 @@
{
services.picom = {
enable = true;
# activeOpacity = 1;
fade = true;
fadeDelta = 1;
# inactiveOpacity = 0.9;
# shadow = true;
# menuOpacity = 0.9;
# shadowOpacity = 0.3;
fadeExclude = [
"class_g = 'slock'" # don't want a transparent lock screen!
"name *?= 'slock'"
"focused = 1"
];
opacityRules = [
# opacity-rule overrides both inactive and active opacity
# video in browser tabs
# substring /regex match of title bar text
"99:name *?= 'Youtube'"
"99:WM_CLASS@:s *= 'mpv$'"
];
};
}

View File

@@ -1 +1 @@
{services.redshift.enable = false;}
{ services.redshift.enable = true; }

View File

@@ -12,33 +12,8 @@ in {
eval $(${pkgs.gnome3.gnome-keyring}/bin/gnome-keyring-daemon --daemonize --components=ssh,secrets)
export SSH_AUTH_SOCK
'';
# services.gpg-agent = rec {
# enable = false;
# enableSshSupport = true;
# defaultCacheTtlSsh = 2 * 60 * 60;
# maxCacheTtlSsh = 4 * defaultCacheTtlSsh;
# sshKeys = [
# "568047C91DE03A23883E340F15A9C24D313E847C"
# "BB3EE102DB8CD45540A78A6B18B511B67061F6B4" # kfm@manakish ed25519
# "3F8986755818B5762A096BE212777EAAC441DD9D" # fysiweb rsa
# "0E4ABD229432486CC432639BB0986B2CDE365105" # agenix ed25519
# "A1E8D32CBFCDBD2DE798E2298D795CCFD785AE06" # kfm@kabsa ed25519
# ];
# };
};
# environment.extraInit = ''
# if [[ -z "$SSH_AUTH_SOCK" ]]; then
# export SSH_AUTH_SOCK="$(${pkgs.gnupg}/bin/gpgconf --list-dirs agent-ssh-socket)"
# fi
# '';
# environment.interactiveShellInit = ''
# GPG_TTY="$(tty)"
# export GPG_TTY
# ${pkgs.gnupg}/bin/gpg-connect-agent updatestartuptty /bye > /dev/null
# '';
home-manager.users.me.programs.ssh = {
enable = true;
enableDefaultConfig = false;

View File

@@ -7,11 +7,11 @@
username = "meinhak99";
inherit (import ../lib/email.nix) defaults pronouns;
inherit (import ../lib) remoteDir;
fu-defaults = rec {
imap.host = "mail.zedat.fu-berlin.de";
fu-defaults = let mailhost = "mail.zedat.fu-berlin.de"; in {
imap.host = mailhost;
imap.port = 993;
imap.tls.enable = true;
smtp.host = imap.host;
smtp.host = mailhost;
smtp.port = 465;
smtp.tls.enable = true;
folders.drafts = "Entwürfe";
@@ -45,8 +45,8 @@ in {
fu =
lib.recursiveUpdate defaults
(lib.recursiveUpdate fu-defaults
rec {
userName = "meinhak99";
(let userName = "meinhak99"; in {
userName = userName;
address = "kieran.meinhardt@fu-berlin.de";
aliases = ["${userName}@fu-berlin.de"];
passwordCommand = "${pkgs.coreutils}/bin/cat ${config.age.secrets.email-password-meinhak99.path}";
@@ -54,7 +54,7 @@ in {
enable = true;
settings.backend = "imap";
};
});
}));
};
};

View File

@@ -6,15 +6,6 @@
promptColours.success = "cyan";
promptColours.failure = "red";
in {
environment.systemPackages = [pkgs.atuin];
environment.variables.ATUIN_CONFIG_DIR = toString (pkgs.writeTextDir "/config.toml" ''
auto_sync = true
update_check = false
sync_address = "http://zaatar.r:8888"
sync_frequency = 0
style = "compact"
'');
programs.zsh = let
zsh-completions = pkgs.fetchFromGitHub {
owner = "zsh-users";
@@ -67,13 +58,6 @@ in {
zstyle ':vcs_info:*' formats "%c%u%F{cyan}%b%f"
zstyle ':vcs_info:*' actionformats "(%a) %c%u%F{cyan}%b%f"
# atuin distributed shell history
export ATUIN_NOBIND="true" # disable all keybdinings of atuin
eval "$(atuin init zsh)"
bindkey '^r' _atuin_search_widget # bind ctrl+r to atuin
# use zsh only session history
fc -p
precmd () {
vcs_info
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] || [ -n "$SSH_CONNECTION" ]; then

39
flake.lock generated
View File

@@ -456,24 +456,7 @@
},
"flake-utils_3": {
"inputs": {
"systems": "systems_3"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"id": "flake-utils",
"type": "indirect"
}
},
"flake-utils_4": {
"inputs": {
"systems": "systems_5"
"systems": "systems_4"
},
"locked": {
"lastModified": 1731533236,
@@ -1393,7 +1376,6 @@
"agenix": "agenix",
"autorenkalender": "autorenkalender",
"coptic-dictionary": "coptic-dictionary",
"flake-utils": "flake-utils_3",
"home-manager": "home-manager_2",
"menstruation-backend": "menstruation-backend_2",
"menstruation-telegram": "menstruation-telegram_2",
@@ -1611,7 +1593,7 @@
"nixpkgs"
],
"nur": "nur_3",
"systems": "systems_4",
"systems": "systems_3",
"tinted-foot": "tinted-foot",
"tinted-kitty": "tinted-kitty",
"tinted-schemes": "tinted-schemes",
@@ -1693,21 +1675,6 @@
"type": "github"
}
},
"systems_5": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"telebots": {
"inputs": {
"flake-utils": "flake-utils_2",
@@ -1959,7 +1926,7 @@
},
"wallpaper-generator_2": {
"inputs": {
"flake-utils": "flake-utils_4",
"flake-utils": "flake-utils_3",
"nixpkgs": "nixpkgs_13"
},
"locked": {

653
flake.nix
View File

@@ -44,7 +44,7 @@
};
outputs =
inputs@{
{
self,
nixpkgs,
nixpkgs-unstable,
@@ -53,9 +53,18 @@
agenix,
retiolum,
nixinate,
flake-utils,
menstruation-backend,
menstruation-telegram,
scripts,
tinc-graph,
recht,
autorenkalender,
wallpaper-generator,
telebots,
stockholm,
nix-index-database,
stylix,
voidrice,
...
}:
let
@@ -69,61 +78,64 @@
pkgs = nixpkgs.legacyPackages.x86_64-linux;
lib = nixpkgs.lib;
in
nixinate.nixinate.x86_64-linux self
// {
mock-secrets = {
type = "app";
program = toString (
pkgs.writers.writeDash "mock-secrets" ''
${pkgs.findutils}/bin/find secrets -not -path '*/.*' -type f | ${pkgs.coreutils}/bin/sort > secrets.txt
''
);
};
}
# the following error prevents remote building of ful: https://github.com/NixOS/nixpkgs/issues/177873
// builtins.listToAttrs (
map (
hostname:
let
targets = {
ful = "root@ful";
zaatar = "root@zaatar";
makanek = "root@makanek";
manakish = "root@manakish";
tahina = "root@tahina";
tabula = "root@tabula";
kabsa = "root@kabsa";
fatteh = "root@fatteh";
kibbeh = "root@kibbeh";
};
in
lib.attrsets.nameValuePair "deploy-${hostname}" {
lib.mergeAttrsList [
nixinate.nixinate.x86_64-linux
self
{
mock-secrets = {
type = "app";
program = toString (
pkgs.writers.writeDash "deploy-${hostname}" ''
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
--max-jobs 2 \
--log-format internal-json \
--flake .#${hostname} \
--target-host ${targets.${hostname}} 2>&1 \
pkgs.writers.writeDash "mock-secrets" ''
${pkgs.findutils}/bin/find secrets -not -path '*/.*' -type f | ${pkgs.coreutils}/bin/sort > secrets.txt
''
);
};
}
# the following error prevents remote building of ful: https://github.com/NixOS/nixpkgs/issues/177873
(builtins.listToAttrs (
map (
hostname:
let
targets = {
ful = "root@ful";
zaatar = "root@zaatar";
makanek = "root@makanek";
manakish = "root@manakish";
tahina = "root@tahina";
tabula = "root@tabula";
kabsa = "root@kabsa";
fatteh = "root@fatteh";
kibbeh = "root@kibbeh";
};
in
lib.attrsets.nameValuePair "deploy-${hostname}" {
type = "app";
program = toString (
pkgs.writers.writeDash "deploy-${hostname}" ''
exec ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch \
--max-jobs 2 \
--log-format internal-json \
--flake .#${hostname} \
--target-host ${targets.${hostname}} 2>&1 \
| ${pkgs.nix-output-monitor}/bin/nom --json
''
);
}
) (builtins.attrNames self.nixosConfigurations)
))
{
deploy-ful = {
type = "app";
program = toString (
pkgs.writers.writeDash "deploy-ful" ''
exec ${pkgs.nix}/bin/nix run .#nixinate.ful \
--log-format internal-json 2>&1 \
| ${pkgs.nix-output-monitor}/bin/nom --json
''
);
}
) (builtins.attrNames self.nixosConfigurations)
)
// {
deploy-ful = {
type = "app";
program = toString (
pkgs.writers.writeDash "deploy-ful" ''
exec ${pkgs.nix}/bin/nix run .#nixinate.ful \
--log-format internal-json 2>&1 \
| ${pkgs.nix-output-monitor}/bin/nom --json
''
);
};
};
};
}
];
};
# TODO overlay for packages
@@ -131,7 +143,6 @@
nixosModules = {
moodle-dl = import modules/moodle-dl.nix;
networkmanager-declarative = import modules/networkmanager-declarative.nix;
passport = import modules/passport.nix;
panoptikon = import modules/panoptikon.nix;
power-action = import modules/power-action.nix;
@@ -144,259 +155,303 @@
panoptikon = import lib/panoptikon.nix;
};
nixosConfigurations = let
niveumSpecialArgs = system: {
unstablePackages = import nixpkgs-unstable {
inherit system;
config.allowUnfreePredicate = pkg:
builtins.elem (nixpkgs-unstable.lib.getName pkg) [
"obsidian"
"zoom"
];
nixosConfigurations =
let
niveumSpecialArgs = system: {
unstablePackages = import nixpkgs-unstable {
inherit system;
overlays = [];
config.allowUnfreePredicate =
pkg:
builtins.elem (nixpkgs-unstable.lib.getName pkg) [
"obsidian"
"zoom"
];
};
niveumPackages = self.packages.${system};
niveumLib = self.lib;
inputs = {
inherit
tinc-graph
self
telebots
menstruation-telegram
menstruation-backend
scripts
agenix
recht
autorenkalender
nixpkgs
wallpaper-generator
;
};
};
in
{
ful = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/ful/configuration.nix
agenix.nixosModules.default
self.nixosModules.passport
self.nixosModules.panoptikon
self.nixosModules.go-webring
stockholm.nixosModules.reaktor2
retiolum.nixosModules.retiolum
nur.modules.nixos.default
{ nixpkgs.overlays = [ stockholm.overlays.default ]; }
{
_module.args.nixinate = {
host = "ful";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
];
};
zaatar = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/zaatar/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
kibbeh = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/kibbeh/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
];
};
makanek = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
# for using inputs in other config files
specialArgs = niveumSpecialArgs system;
modules = [
systems/makanek/configuration.nix
self.nixosModules.telegram-bot
self.nixosModules.passport
agenix.nixosModules.default
retiolum.nixosModules.retiolum
nur.modules.nixos.default
];
};
tahina = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/tahina/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
tabula = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/tabula/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
manakish = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/manakish/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nix-index-database.nixosModules.default
nur.modules.nixos.default
stylix.nixosModules.stylix
];
};
kabsa = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/kabsa/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nur.modules.nixos.default
nix-index-database.nixosModules.default
stylix.nixosModules.stylix
];
};
fatteh = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/fatteh/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nur.modules.nixos.default
nix-index-database.nixosModules.default
stylix.nixosModules.stylix
];
};
niveumPackages = inputs.self.packages.${system};
niveumLib = inputs.self.lib;
inherit inputs;
};
in {
ful = nixpkgs.lib.nixosSystem rec {
system = "aarch64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/ful/configuration.nix
agenix.nixosModules.default
inputs.self.nixosModules.passport
inputs.self.nixosModules.panoptikon
inputs.self.nixosModules.go-webring
inputs.stockholm.nixosModules.reaktor2
retiolum.nixosModules.retiolum
nur.modules.nixos.default
{ nixpkgs.overlays = [ inputs.stockholm.overlays.default ]; }
packages = eachSupportedSystem (
system:
let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
nur.overlays.default
(self: super: {
mpv = super.mpv.override {
scripts = [
super.mpvScripts.visualizer
super.mpvScripts.mpris
];
};
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
})
];
};
wrapScript =
{
_module.args.nixinate = {
host = "ful";
sshUser = "root";
buildOn = "remote";
substituteOnTarget = true;
hermetic = false;
};
}
];
};
zaatar = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/zaatar/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
kibbeh = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/kibbeh/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
];
};
makanek = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
# for using inputs in other config files
specialArgs = niveumSpecialArgs system;
modules = [
systems/makanek/configuration.nix
inputs.self.nixosModules.telegram-bot
inputs.self.nixosModules.passport
agenix.nixosModules.default
retiolum.nixosModules.retiolum
nur.modules.nixos.default
];
};
tahina = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/tahina/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
tabula = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/tabula/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
];
};
manakish = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/manakish/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nix-index-database.nixosModules.default
nur.modules.nixos.default
stylix.nixosModules.stylix
];
};
kabsa = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/kabsa/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nur.modules.nixos.default
nix-index-database.nixosModules.default
stylix.nixosModules.stylix
];
};
fatteh = nixpkgs.lib.nixosSystem rec {
system = "x86_64-linux";
specialArgs = niveumSpecialArgs system;
modules = [
systems/fatteh/configuration.nix
agenix.nixosModules.default
retiolum.nixosModules.retiolum
home-manager.nixosModules.home-manager
nur.modules.nixos.default
nix-index-database.nixosModules.default
stylix.nixosModules.stylix
];
};
};
packages ? [ ],
name,
script,
}:
pkgs.writers.writeDashBin name ''PATH=$PATH:${
nixpkgs.lib.makeBinPath (
packages
++ [
pkgs.findutils
pkgs.coreutils
pkgs.gnused
pkgs.gnugrep
]
)
} ${script} "$@"'';
in
{
# linguistics and ancient world
auc = pkgs.callPackage packages/auc.nix { };
betacode = pkgs.callPackage packages/betacode.nix { };
brassica = pkgs.callPackage packages/brassica.nix { }; # TODO upstream
devanagari = pkgs.callPackage packages/devanagari { };
stardict-tools = pkgs.callPackage packages/stardict-tools.nix { };
heuretes = pkgs.callPackage packages/heuretes.nix { };
ipa = pkgs.writers.writePython3Bin "ipa" { flakeIgnore = [ "E501" ]; } (
builtins.readFile packages/ipa.py
);
jsesh = pkgs.callPackage packages/jsesh.nix { }; # TODO upstream
kirciuoklis = pkgs.callPackage packages/kirciuoklis.nix { };
polyglot = pkgs.callPackage packages/polyglot.nix { };
tocharian-font = pkgs.callPackage packages/tocharian-font.nix { };
gfs-fonts = pkgs.callPackage packages/gfs-fonts.nix { };
closest = pkgs.callPackage packages/closest { };
packages = eachSupportedSystem (system: let
pkgs = import nixpkgs {
inherit system;
config.allowUnfree = true;
overlays = [
nur.overlays.default
(self: super: {
mpv = super.mpv.override {scripts = [super.mpvScripts.visualizer super.mpvScripts.mpris];};
dmenu = super.writers.writeDashBin "dmenu" ''exec ${pkgs.rofi}/bin/rofi -dmenu "$@"'';
})
];
};
wrapScript = {
packages ? [],
name,
script,
}:
pkgs.writers.writeDashBin name ''PATH=$PATH:${nixpkgs.lib.makeBinPath (packages ++ [pkgs.findutils pkgs.coreutils pkgs.gnused pkgs.gnugrep])} ${script} "$@"'';
in {
# linguistics and ancient world
auc = pkgs.callPackage packages/auc.nix {};
betacode = pkgs.callPackage packages/betacode.nix {};
brassica = pkgs.callPackage packages/brassica.nix {}; # TODO upstream
devanagari = pkgs.callPackage packages/devanagari {};
stardict-tools = pkgs.callPackage packages/stardict-tools.nix {};
heuretes = pkgs.callPackage packages/heuretes.nix {};
ipa = pkgs.writers.writePython3Bin "ipa" {flakeIgnore = ["E501"];} (builtins.readFile packages/ipa.py);
jsesh = pkgs.callPackage packages/jsesh.nix {}; # TODO upstream
kirciuoklis = pkgs.callPackage packages/kirciuoklis.nix {};
polyglot = pkgs.callPackage packages/polyglot.nix {};
tocharian-font = pkgs.callPackage packages/tocharian-font.nix {};
gfs-fonts = pkgs.callPackage packages/gfs-fonts.nix {};
closest = pkgs.callPackage packages/closest {};
# lit
random-zeno = pkgs.callPackage packages/random-zeno.nix { };
literature-quote = pkgs.callPackage packages/literature-quote.nix { };
# lit
random-zeno = pkgs.callPackage packages/random-zeno.nix {};
literature-quote = pkgs.callPackage packages/literature-quote.nix {};
# krebs
brainmelter = pkgs.callPackage packages/brainmelter.nix { };
cyberlocker-tools = pkgs.callPackage packages/cyberlocker-tools.nix { };
hc = pkgs.callPackage packages/hc.nix { };
kpaste = pkgs.callPackage packages/kpaste.nix { };
pls = pkgs.callPackage packages/pls.nix { };
untilport = pkgs.callPackage packages/untilport.nix { };
radio-news = pkgs.callPackage packages/radio-news.nix { };
# krebs
brainmelter = pkgs.callPackage packages/brainmelter.nix {};
cyberlocker-tools = pkgs.callPackage packages/cyberlocker-tools.nix {};
hc = pkgs.callPackage packages/hc.nix {};
kpaste = pkgs.callPackage packages/kpaste.nix {};
pls = pkgs.callPackage packages/pls.nix {};
untilport = pkgs.callPackage packages/untilport.nix {};
radio-news = pkgs.callPackage packages/radio-news.nix {};
# window manager
swallow = pkgs.callPackage packages/swallow.nix { };
devour = pkgs.callPackage packages/devour.nix { };
# window manager
swallow = pkgs.callPackage packages/swallow.nix {};
devour = pkgs.callPackage packages/devour.nix {};
cheat-sh = pkgs.callPackage packages/cheat-sh.nix { };
vimPlugins-cheat-sh-vim = pkgs.callPackage packages/vimPlugins/cheat-sh.nix { }; # TODO upstream
cro = pkgs.callPackage packages/cro.nix { };
default-gateway = pkgs.callPackage packages/default-gateway.nix { };
depp = pkgs.callPackage packages/depp.nix { };
fkill = pkgs.callPackage packages/fkill.nix { };
fzfmenu = pkgs.callPackage packages/fzfmenu.nix { };
gpt35 = pkgs.callPackage packages/gpt.nix { model = "gpt-3.5-turbo"; };
gpt4 = pkgs.callPackage packages/gpt.nix { model = "gpt-4"; };
image-convert-favicon = pkgs.callPackage packages/image-convert-favicon.nix { };
image-convert-tolino = pkgs.callPackage packages/image-convert-tolino.nix { };
k-lock = pkgs.callPackage packages/k-lock.nix { };
klem = pkgs.callPackage packages/klem.nix { };
man-pandoc = pkgs.callPackage packages/man/pandoc.nix { }; # TODO upstream
man-pdf = pkgs.callPackage packages/man-pdf.nix { };
mansplain = pkgs.callPackage packages/mansplain.nix { };
manual-sort = pkgs.callPackage packages/manual-sort.nix { };
menu-calc = pkgs.callPackage packages/menu-calc.nix { };
noise-waves = pkgs.callPackage packages/noise-waves.nix { };
mpv-radio = pkgs.callPackage packages/mpv-radio.nix { di-fm-key-file = "/dev/null"; };
mpv-tuner = pkgs.callPackage packages/mpv-tuner.nix { di-fm-key-file = "/dev/null"; };
mpv-tv = pkgs.callPackage packages/mpv-tv.nix { };
mpv-iptv = pkgs.callPackage packages/mpv-iptv.nix { };
new-mac = pkgs.callPackage packages/new-mac.nix { };
nix-git = pkgs.callPackage packages/nix-git.nix { };
notemenu = pkgs.callPackage packages/notemenu.nix { niveumPackages = self.packages.${system}; };
opustags = pkgs.callPackage packages/opustags.nix { }; # TODO upstream
q = pkgs.callPackage packages/q.nix { };
qrpaste = pkgs.callPackage packages/qrpaste.nix { };
go-webring = pkgs.callPackage packages/go-webring.nix { }; # TODO upstream
rfc = pkgs.callPackage packages/rfc.nix { };
gimp = pkgs.callPackage packages/gimp.nix { };
scanned = pkgs.callPackage packages/scanned.nix { };
text2pdf = pkgs.callPackage packages/text2pdf.nix { }; # TODO upstream
timer = pkgs.callPackage packages/timer.nix { };
trans = pkgs.callPackage packages/trans.nix { }; # TODO upstream
ttspaste = pkgs.callPackage packages/ttspaste.nix { };
unicodmenu = pkgs.callPackage packages/unicodmenu.nix { };
emailmenu = pkgs.callPackage packages/emailmenu.nix { };
stag = pkgs.callPackage packages/stag.nix { }; # TODO upstream
vg = pkgs.callPackage packages/vg.nix { };
vim = pkgs.callPackage packages/vim.nix { niveumPackages = self.packages.${system}; };
obsidian-vim = pkgs.callPackage packages/obsidian-vim.nix { };
vimPlugins-icalendar-vim = pkgs.callPackage packages/vimPlugins/icalendar-vim.nix { }; # TODO upstream
vimPlugins-jq-vim = pkgs.callPackage packages/vimPlugins/jq-vim.nix { }; # TODO upstream
vimPlugins-typst-vim = pkgs.callPackage packages/vimPlugins/typst-vim.nix { }; # TODO upstream
vimPlugins-mdwa-nvim = pkgs.callPackage packages/vimPlugins/mdwa-nvim.nix { }; # TODO upstream
vimPlugins-vim-ernest = pkgs.callPackage packages/vimPlugins/vim-ernest.nix { }; # TODO upstream
vimPlugins-vim-256noir = pkgs.callPackage packages/vimPlugins/vim-256noir.nix { }; # TODO upstream
vimPlugins-vim-colors-paramount =
pkgs.callPackage packages/vimPlugins/vim-colors-paramount.nix
{ }; # TODO upstream
vimPlugins-vim-fetch = pkgs.callPackage packages/vimPlugins/vim-fetch.nix { }; # TODO upstream
vimPlugins-vim-fsharp = pkgs.callPackage packages/vimPlugins/vim-fsharp.nix { }; # TODO upstream
vimPlugins-vim-mail = pkgs.callPackage packages/vimPlugins/vim-mail.nix { }; # TODO upstream
vimPlugins-vim-reason-plus = pkgs.callPackage packages/vimPlugins/vim-reason-plus.nix { }; # TODO upstream
vimv = pkgs.callPackage packages/vimv.nix { };
weechat-declarative = pkgs.callPackage packages/weechat-declarative.nix { }; # TODO upstream
weechatScripts-hotlist2extern = pkgs.callPackage packages/weechatScripts/hotlist2extern.nix { }; # TODO upstream
dmenu-randr = pkgs.callPackage packages/dmenu-randr.nix { };
wttr = pkgs.callPackage packages/wttr.nix { }; # TODO upstream
cheat-sh = pkgs.callPackage packages/cheat-sh.nix {};
vimPlugins-cheat-sh-vim = pkgs.callPackage packages/vimPlugins/cheat-sh.nix {}; # TODO upstream
cro = pkgs.callPackage packages/cro.nix {};
default-gateway = pkgs.callPackage packages/default-gateway.nix {};
depp = pkgs.callPackage packages/depp.nix {};
dashboard = pkgs.callPackage packages/dashboard {};
fkill = pkgs.callPackage packages/fkill.nix {};
fzfmenu = pkgs.callPackage packages/fzfmenu.nix {};
gpt35 = pkgs.callPackage packages/gpt.nix {model = "gpt-3.5-turbo";};
gpt4 = pkgs.callPackage packages/gpt.nix {model = "gpt-4";};
image-convert-favicon = pkgs.callPackage packages/image-convert-favicon.nix {};
image-convert-tolino = pkgs.callPackage packages/image-convert-tolino.nix {};
k-lock = pkgs.callPackage packages/k-lock.nix {};
klem = pkgs.callPackage packages/klem.nix {};
man-pandoc = pkgs.callPackage packages/man/pandoc.nix {}; # TODO upstream
man-pdf = pkgs.callPackage packages/man-pdf.nix {};
mansplain = pkgs.callPackage packages/mansplain.nix {};
manual-sort = pkgs.callPackage packages/manual-sort.nix {};
menu-calc = pkgs.callPackage packages/menu-calc.nix {};
noise-waves = pkgs.callPackage packages/noise-waves.nix {};
mpv-radio = pkgs.callPackage packages/mpv-radio.nix {di-fm-key-file = "/dev/null";};
mpv-tuner = pkgs.callPackage packages/mpv-tuner.nix {di-fm-key-file = "/dev/null";};
mpv-tv = pkgs.callPackage packages/mpv-tv.nix {};
mpv-iptv = pkgs.callPackage packages/mpv-iptv.nix {};
new-mac = pkgs.callPackage packages/new-mac.nix {};
nix-git = pkgs.callPackage packages/nix-git.nix {};
notemenu = pkgs.callPackage packages/notemenu.nix {niveumPackages = self.packages.${system};};
opustags = pkgs.callPackage packages/opustags.nix {}; # TODO upstream
q = pkgs.callPackage packages/q.nix {};
qrpaste = pkgs.callPackage packages/qrpaste.nix {};
go-webring = pkgs.callPackage packages/go-webring.nix {}; # TODO upstream
rfc = pkgs.callPackage packages/rfc.nix {};
gimp = pkgs.callPackage packages/gimp.nix {};
scanned = pkgs.callPackage packages/scanned.nix {};
text2pdf = pkgs.callPackage packages/text2pdf.nix {}; # TODO upstream
timer = pkgs.callPackage packages/timer.nix {};
trans = pkgs.callPackage packages/trans.nix {}; # TODO upstream
ttspaste = pkgs.callPackage packages/ttspaste.nix {};
unicodmenu = pkgs.callPackage packages/unicodmenu.nix {};
emailmenu = pkgs.callPackage packages/emailmenu.nix {};
stag = pkgs.callPackage packages/stag.nix {}; # TODO upstream
vg = pkgs.callPackage packages/vg.nix {};
vim = pkgs.callPackage packages/vim.nix {niveumPackages = self.packages.${system};};
obsidian-vim = pkgs.callPackage packages/obsidian-vim.nix {};
vimPlugins-icalendar-vim = pkgs.callPackage packages/vimPlugins/icalendar-vim.nix {}; # TODO upstream
vimPlugins-jq-vim = pkgs.callPackage packages/vimPlugins/jq-vim.nix {}; # TODO upstream
vimPlugins-typst-vim = pkgs.callPackage packages/vimPlugins/typst-vim.nix {}; # TODO upstream
vimPlugins-mdwa-nvim = pkgs.callPackage packages/vimPlugins/mdwa-nvim.nix {}; # TODO upstream
vimPlugins-vim-ernest = pkgs.callPackage packages/vimPlugins/vim-ernest.nix {}; # TODO upstream
vimPlugins-vim-256noir = pkgs.callPackage packages/vimPlugins/vim-256noir.nix {}; # TODO upstream
vimPlugins-vim-colors-paramount = pkgs.callPackage packages/vimPlugins/vim-colors-paramount.nix {}; # TODO upstream
vimPlugins-vim-fetch = pkgs.callPackage packages/vimPlugins/vim-fetch.nix {}; # TODO upstream
vimPlugins-vim-fsharp = pkgs.callPackage packages/vimPlugins/vim-fsharp.nix {}; # TODO upstream
vimPlugins-vim-mail = pkgs.callPackage packages/vimPlugins/vim-mail.nix {}; # TODO upstream
vimPlugins-vim-reason-plus = pkgs.callPackage packages/vimPlugins/vim-reason-plus.nix {}; # TODO upstream
vimv = pkgs.callPackage packages/vimv.nix {};
weechat-declarative = pkgs.callPackage packages/weechat-declarative.nix {}; # TODO upstream
weechatScripts-hotlist2extern = pkgs.callPackage packages/weechatScripts/hotlist2extern.nix {}; # TODO upstream
dmenu-randr = pkgs.callPackage packages/dmenu-randr.nix {};
wttr = pkgs.callPackage packages/wttr.nix {}; # TODO upstream
booksplit = wrapScript {
script = inputs.voidrice.outPath + "/.local/bin/booksplit";
name = "booksplit";
packages = [pkgs.ffmpeg pkgs.glibc.bin];
};
tag = wrapScript {
script = inputs.voidrice.outPath + "/.local/bin/tag";
name = "tag";
packages = [pkgs.ffmpeg];
};
});
booksplit = wrapScript {
script = voidrice.outPath + "/.local/bin/booksplit";
name = "booksplit";
packages = [
pkgs.ffmpeg
pkgs.glibc.bin
];
};
tag = wrapScript {
script = voidrice.outPath + "/.local/bin/tag";
name = "tag";
packages = [ pkgs.ffmpeg ];
};
}
);
};
}

View File

@@ -1,4 +1,4 @@
pkgs: rec {
pkgs: {
terminal = "alacritty";
browser = "${pkgs.firefox}/bin/firefox";
fileManager = "${pkgs.pcmanfm}/bin/pcmanfm";

View File

@@ -9,9 +9,8 @@
argument ? "-",
}: "${type} '${path}' ${mode} ${user} ${group} ${age} ${argument}";
restic = rec {
port = 3571;
host = "zaatar.r";
restic = let host = "zaatar.r"; port = 3571; in {
inherit host port;
repository = "rest:http://${host}:${toString port}/";
};

View File

@@ -1,5 +1,8 @@
rec {
let
thunderbirdProfile = "donnervogel";
in
{
inherit thunderbirdProfile;
pronouns = builtins.concatStringsSep "/" [
"er"
"he"
@@ -14,7 +17,7 @@ rec {
defaults = {
thunderbird = {
enable = true;
profiles = [thunderbirdProfile];
profiles = [ thunderbirdProfile ];
};
aerc.enable = true;
realName = "Kierán Meinhardt";

View File

@@ -1,69 +0,0 @@
# https://github.com/jmackie/nixos-networkmanager-profiles/
{
lib,
config,
...
}:
with lib; let
nm = config.networking.networkmanager;
mkProfile = profileAttrs:
if !(isAttrs profileAttrs)
then throw "error 1"
else {
enable = true;
mode = "0400"; # readonly (user)
text =
(foldlAttrs (accum: {
name,
value,
}: ''
${accum}
[${name}] ${mkProfileEntry value}'')
"# Generated by nixos-networkmanager-profiles"
profileAttrs)
+ "\n";
};
mkProfileEntry = entryAttrs:
if !(isAttrs entryAttrs)
then throw "error 2"
else
foldlAttrs (accum: {
name,
value,
}: ''
${accum}
${name}=${toString value}'') ""
entryAttrs;
foldlAttrs = op: nul: attrs:
foldl (accum: {
fst,
snd,
}:
op accum (nameValuePair fst snd))
nul
(lists.zipLists (attrNames attrs) (attrValues attrs));
attrLength = attrs: length (attrValues attrs);
in {
options.networking.networkmanager.profiles = mkOption {
type = types.attrs;
default = {};
};
config = mkIf (attrLength nm.profiles > 0) {
environment.etc = foldlAttrs (accum: {
name,
value,
}:
accum
// {
"NetworkManager/system-connections/${name}.nmconnection" =
mkProfile value;
}) {}
nm.profiles;
};
}

View File

@@ -56,7 +56,7 @@ with lib; let
imp = {
systemd.services.power-action = {
serviceConfig = rec {
serviceConfig = {
ExecStart = startScript;
User = cfg.user;
};

View File

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

View File

@@ -1,247 +0,0 @@
{
writers,
formats,
acpi,
wtf,
himalaya,
lib,
jq,
gh,
curl,
khal,
todoman,
gnused,
coreutils,
astrolog,
weatherCityIds ? [2950159],
}: let
rowCount = 10;
columnCount = 6;
yaml = formats.yaml {};
command = args:
{
enabled = true;
type = "cmdrunner";
}
// args;
configuration.wtf = rec {
grid = {
columns = lib.replicate columnCount 32;
rows = lib.replicate rowCount 5;
};
mods.vdir_khal = command {
title = "Calendar";
cmd = "${khal}/bin/khal";
args = ["--color" "list" "--exclude-calendar" "calendarium-tridentinum"];
refreshInterval = "1m";
position = {
top = 4;
left = 0;
height = 4;
width = 2;
};
};
mods.vdir_todo = command {
enabled = true;
title = "Agenda";
cmd = writers.writeDash "vdir_todo" "${todoman}/bin/todo --color=always -h | ${coreutils}/bin/tac";
refreshInterval = "1m";
position = {
top = 4;
left = 2;
height = 4;
width = 2;
};
};
mods.weather = {
enabled = true;
cityids = weatherCityIds;
position = {
top = 8;
left = 2;
height = 2;
width = 2;
};
refreshInterval = "15m";
language = "DE";
tempUnit = "C";
useEmoji = true;
compact = true;
};
mods.top = command {
title = "uptime";
cmd = writers.writeDash "top" "top -b -n 1 -E g | ${gnused}/bin/sed -n '1,5p'";
refreshInterval = "30s";
position = {
top = 4;
left = 4;
height = 2;
width = 2;
};
enabled = true;
};
mods.resourceusage = {
enabled = true;
cpuCombined = false;
position = {
top = 6;
left = 4;
height = 2;
width = 2;
};
refreshInterval = "1s";
showCPU = true;
showMem = true;
showSwp = false;
};
mods.ipapi = {
enabled = false;
position = {
top = 0;
left = 1;
height = 2;
width = 2;
};
refreshInterval = "150s";
};
mods.battery-status = command {
enabled = true;
cmd = writers.writeDash "battery-status" ''
${acpi}/bin/acpi --battery --details | sed 's/^Battery //'
'';
refreshInterval = "1m";
position = {
top = 8;
left = 4;
height = 2;
width = 2;
};
};
mods.disk-usage = command {
enabled = false;
cmd = "df";
args = ["-h"];
refreshInterval = "1m";
position = {
top = 8;
left = 4;
height = 2;
width = 2;
};
};
mods.email = command {
title = "Email";
cmd = writers.writeDash "email" ''
${himalaya}/bin/himalaya accounts --output json \
| ${jq}/bin/jq -r 'map(.name) | join("\n")' \
| while read -r account
do
${himalaya}/bin/himalaya list --account "$account" -o json \
| ${jq}/bin/jq -r '
map(select(.flags == [])
| "\u001b[33m\(.from.addr)\u001b[0m \(.subject)") | join("\n")
'
done
'';
refreshInterval = "5m";
position = {
top = 0;
left = 0;
height = 4;
width = 2;
};
};
mods.gh-status = command {
enabled = true;
title = "GitHub";
cmd = writers.writeDash "gh-status" ''
${gh}/bin/gh api notifications \
| ${jq}/bin/jq -r 'map("\u001b[35m\(.repository.full_name)\u001b[0m \(.subject.title)") | join("\n")'
'';
refreshInterval = "5m";
position = {
top = 0;
left = 2;
height = 2;
width = 2;
};
};
mods.gh-issues = command {
enabled = true;
title = "GitHub";
cmd = writers.writeDash "gh-issues" ''
${gh}/bin/gh api issues \
| ${jq}/bin/jq -r 'map(select(.repository.owner.login == "kmein") | "\u001b[35m\(.repository.name)\u001b[0m \(.title)") | join("\n")'
'';
refreshInterval = "5m";
position = {
top = 2;
left = 2;
height = 2;
width = 2;
};
};
mods.calendar = command {
title = "Calendar";
cmd = "cal";
args = ["-3" "-m" "-w"];
pty = true;
refreshInterval = "5m";
position = {
top = 8;
left = 0;
height = 2;
width = 2;
};
};
mods.astro-aspects = command {
title = "Aspects";
enabled = false;
cmd = writers.writeDash "astro-aspects" "${astrolog}/bin/astrolog -n -zN Berlin -d";
refreshInterval = "1h";
position = {
top = 7;
left = 3;
height = 1;
width = 2;
};
};
mods.feed = command {
enabled = true;
title = "Feed";
cmd = writers.writeDash "feed" ''
${curl}/bin/curl -u "$WTF_MINIFLUX_API_KEY" --basic -s 'https://feed.kmein.de/v1/entries?status=unread&direction=desc' \
| ${jq}/bin/jq -r '
.total as $total | (
.entries
| map(select(.feed | .hide_globally| not) | "\(.feed.category.title) \u001b[32m\(.author)\u001b[0m \(.title)")
| join("\n")
)'
'';
# position = { top = 0; left = 5; height = 5; width = 1; };
position = {
top = 0;
left = 4;
height = 4;
width = 2;
};
refreshInterval = "15m";
};
mods.astro-positions = command {
enabled = false;
title = "Positions";
cmd = writers.writeDash "astro-positions" "${astrolog}/bin/astrolog -q $(date +'%m %d %Y %H:%M') -zN Berlin | ${gnused}/bin/sed -n '4,16p' | ${coreutils}/bin/cut -c 1-33";
refreshInterval = "1h";
position = {
top = 5;
left = 5;
height = 3;
width = 1;
};
};
};
in
writers.writeDashBin "dashboard" ''
exec ${wtf}/bin/wtfutil --config=${yaml.generate "config.yml" configuration}
''

View File

@@ -1,7 +1,13 @@
{yarn2nix-moretea}:
{yarn2nix-moretea, lib}:
yarn2nix-moretea.mkYarnPackage {
name = "devanagari";
src = ./.;
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.unions [
./devanagari.js
./package.json
];
};
packageJson = ./package.json;
yarnLock = ./yarn.lock;
}

View File

@@ -12,16 +12,17 @@
util-linux,
zbar,
}:
stdenv.mkDerivation rec {
name = "hc-${meta.version}";
stdenv.mkDerivation (finalAttrs: {
name = "hc-${finalAttrs.version}";
version = "1.0.0";
src = fetchgit {
url = "https://cgit.krebsco.de/hc";
rev = "refs/tags/v${meta.version}";
rev = "refs/tags/v${finalAttrs.version}";
sha256 = "09349gja22p0j3xs082kp0fnaaada14bafszn4r3q7rg1id2slfb";
};
nativeBuildInputs = [makeWrapper];
nativeBuildInputs = [ makeWrapper ];
buildPhase = null;
@@ -31,19 +32,21 @@ stdenv.mkDerivation rec {
cp $src/bin/hc $out/bin/hc
wrapProgram $out/bin/hc \
--prefix PATH : ${lib.makeBinPath [
coreutils
findutils
gawk
gnugrep
qrencode
texlive.combined.scheme-full
util-linux
zbar
]}
--prefix PATH : ${
lib.makeBinPath [
coreutils
findutils
gawk
gnugrep
qrencode
texlive.combined.scheme-full
util-linux
zbar
]
}
'';
meta = {
version = "1.0.0";
version = finalAttrs.version;
};
}
})

View File

@@ -1,7 +1,13 @@
{pkgs ? import <nixpkgs> {}}:
pkgs.writers.writeDashBin "jsesh" ''
${pkgs.jre}/bin/java -jar ${pkgs.fetchzip {
url = "https://github.com/rosmord/jsesh/releases/download/release-7.5.5/JSesh-7.5.5.zip";
sha256 = "1z7ln51cil9pypz855x9a8p9ip2aflvknh566wcaah1kmz3fp57r";
}}/lib/jseshAppli-7.5.5.jar
{
writers,
jre,
fetchzip,
}:
writers.writeDashBin "jsesh" ''
${jre}/bin/java -jar ${
fetchzip {
url = "https://github.com/rosmord/jsesh/releases/download/release-7.5.5/JSesh-7.5.5.zip";
sha256 = "1z7ln51cil9pypz855x9a8p9ip2aflvknh566wcaah1kmz3fp57r";
}
}/lib/jseshAppli-7.5.5.jar
''

View File

@@ -6,14 +6,14 @@
libogg,
fetchFromGitHub,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
name = "opustags";
version = "1.3.0";
src = fetchFromGitHub {
owner = "fmang";
repo = "opustags";
rev = version;
rev = finalAttrs.version;
sha256 = "09z0cdg20algaj2yyhfz3hxh1biwjjvzx1pc2vdc64n8lkswqsc1";
};
@@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
"-DCMAKE_INSTALL_PREFIX=$out"
];
doCheck = true;
buildInputs = [libogg];
nativeBuildInputs = [cmake pkg-config];
@@ -30,4 +32,4 @@ stdenv.mkDerivation rec {
description = "Ogg Opus tags editor";
platforms = platforms.all;
};
}
})

View File

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

View File

@@ -6,14 +6,14 @@
taglib,
zlib,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "stag";
version = "1.0";
src = fetchFromGitHub {
owner = "smabie";
repo = "stag";
rev = "v${version}";
rev = "v${finalAttrs.version}";
hash = "sha256-IWb6ZbPlFfEvZogPh8nMqXatrg206BTV2DYg7BMm7R4=";
};
@@ -27,6 +27,8 @@ stdenv.mkDerivation rec {
make all
'';
doCheck = true;
installPhase = ''
mkdir -p $out/bin
cp stag $out/bin/
@@ -40,6 +42,5 @@ stdenv.mkDerivation rec {
license = lib.licenses.publicDomain;
maintainers = [ lib.maintainers.kmein ];
platforms = lib.platforms.unix;
source = src;
};
}
})

View File

@@ -27,8 +27,9 @@ stdenv.mkDerivation {
env.NIX_CFLAGS_COMPILE = toString [
"-Wno-error=format-security"
];
patchPhase = ''
${gnused}/bin/sed -i s/noinst_PROGRAMS/bin_PROGRAMS/ tools/src/Makefile.am
postPatch = ''
substituteInPlace tools/src/Makefile.am \
--replace-fail noinst_PROGRAMS bin_PROGRAMS
'';
installFlags = ["INSTALL_PREFIX=$(out)"];
autoreconfPhase = ''
@@ -39,6 +40,7 @@ stdenv.mkDerivation {
mkdir $out
make install
'';
doCheck = true;
src = fetchFromGitHub {
owner = "huzheng001";
repo = "stardict-3";

View File

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

View File

@@ -64,10 +64,9 @@
vim-repeat
vim-sensible
vim-surround
(vimUtils.buildVimPlugin rec {
(vimUtils.buildVimPlugin {
pname = "vim-dim";
version = "1.1.0";
name = "${pname}-${version}";
src = fetchFromGitHub {
owner = "jeffkreeftmeijer";
repo = pname;

View File

@@ -9,8 +9,8 @@
config = args.config or {};
lib =
args.lib
// rec {
lib.recursiveUpdate args.lib
(let
attrPaths = let
recurse = path: value:
if builtins.isAttrs value
@@ -18,6 +18,8 @@
else [(lib.nameValuePair path value)];
in
attrs: lib.flatten (recurse [] attrs);
in {
inherit attrPaths;
attrPathsSep = sep: attrs: lib.listToAttrs (map (x: x // {name = lib.concatStringsSep sep x.name;}) (attrPaths attrs));
@@ -33,7 +35,7 @@
setCommand = name: value: "/set ${name} \"${toWeechatValue value}\"";
filterAddreplace = name: filter: "/filter addreplace ${name} ${filter.buffer} ${toWeechatValue filter.tags} ${filter.regex}";
};
});
cfg = eval.config;

Submodule secrets updated: 3f3a8d1334...83d9103f20

View File

@@ -16,8 +16,17 @@
boot.initrd.kernelModules = [];
boot.kernelModules = ["kvm-intel"];
boot.extraModulePackages = [];
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
boot = {
loader = {
efi.canTouchEfiVariables = true;
systemd-boot = {
enable = true;
configurationLimit = 5;
consoleMode = "max";
};
};
};
boot.initrd.luks.devices."luks-aa6beb1b-3e54-4a0e-ac9c-e0c007d73cd5".device = "/dev/disk/by-uuid/aa6beb1b-3e54-4a0e-ac9c-e0c007d73cd5";

View File

@@ -20,7 +20,7 @@ in {
./scrabble.nix
# ./onlyoffice.nix
./retiolum-map.nix
./tarot.nix
./oracle
./tt-rss.nix
./weechat.nix
../../configs/monitoring.nix

View File

@@ -405,15 +405,11 @@ in
static_configs = [
{
targets = [
"https://alew.hu-berlin.de"
"https://beta.alew.hu-berlin.de"
"https://alew.hu-berlin.de/api/search?substring=die&domain=lemma&derivations=true&addition=true&diacritics=false&position=infix"
"https://beta.alew.hu-berlin.de/api/search?substring=die&domain=lemma&derivations=true&addition=true&diacritics=false&position=infix"
"https://zodiac.fly.dev/api/lemma/get?lemmaId=2582"
"https://pad.kmein.de"
"https://code.kmein.de"
"https://radio.kmein.de"
"https://tarot.kmein.de"
"https://iching.kmein.de"
"https://social.krebsco.de"
"https://cloud.kmein.de"
"http://grafana.kmein.r"

View File

@@ -6,6 +6,7 @@
}:
let
tarotPort = 7407;
ichingPort = 1819;
tarotFiles = pkgs.fetchzip {
url = "https://c.krebsco.de/tarot.zip";
sha256 = "0jl5vdwlj17pqp94yj02xgsb1gyvs9i08m83kac0jdnhfjl2f75a";
@@ -21,49 +22,53 @@ in
enable = true;
serviceConfig.Type = "simple";
wantedBy = [ "multi-user.target" ];
environment = {
TAROT_FILES = tarotFiles;
TAROT_PORT = toString tarotPort;
};
serviceConfig.ExecStart = pkgs.writers.writePython3 "tarot-server" {
libraries = py: [ py.pillow py.flask ];
} ''
from flask import Flask, send_file
from pathlib import Path
from random import choice, randint
from io import BytesIO
from PIL import Image
libraries = py: [
py.pillow
py.flask
];
} ./tarot.py;
};
app = Flask(__name__)
TAROT_DIR = Path("${tarotFiles}")
@app.route("/")
def tarot():
card_path = choice(list(TAROT_DIR.glob("*")))
with Image.open(card_path) as img:
if randint(0, 1):
img = img.rotate(180)
buf = BytesIO()
img.save(buf, format="JPEG")
buf.seek(0)
return send_file(
buf,
mimetype='image/jpeg',
as_attachment=False
)
if __name__ == "__main__":
app.run(port=${toString tarotPort})
'';
systemd.services.iching = {
enable = true;
serviceConfig.Type = "simple";
wantedBy = [ "multi-user.target" ];
environment = {
ICHING_PORT = toString ichingPort;
};
serviceConfig.ExecStart = pkgs.writers.writePython3 "iching-server" {
libraries = py: [
py.flask
];
} ./iching.py;
};
niveum.passport.services = [
rec {
{
link = "https://tarot.kmein.de";
title = "Tarot";
description = "draws Tarot cards for you. See <a href=\"${link}/files/key.pdf\">here</a> for information on how to interpret them.";
description = "draws Tarot cards for you.";
}
{
link = "https://iching.kmein.de";
title = "I Ching";
description = "draws I Ching hexagrams for you.";
}
];
services.nginx.virtualHosts."iching.kmein.de" = {
enableACME = true;
forceSSL = true;
locations = {
"/".proxyPass = "http://127.0.0.1:${toString ichingPort}/";
};
};
services.nginx.virtualHosts."tarot.kmein.de" = {
enableACME = true;
forceSSL = true;

View File

@@ -0,0 +1,202 @@
from flask import Flask
import random
from typing import List
from enum import Enum
import os
app = Flask(__name__)
KING_WEN_SEQUENCE: List[int] = [
0b111111,
0b000000,
0b100010,
0b010001,
0b111010,
0b010111,
0b010000,
0b000010,
0b111011,
0b110111,
0b111000,
0b000111,
0b101111,
0b111101,
0b001000,
0b000100,
0b100110,
0b011001,
0b110000,
0b000011,
0b100101,
0b101001,
0b000001,
0b100000,
0b100111,
0b111001,
0b100001,
0b011110,
0b010010,
0b101101,
0b001110,
0b011100,
0b001111,
0b111100,
0b000101,
0b101000,
0b101011,
0b110101,
0b001010,
0b010100,
0b110001,
0b100011,
0b111110,
0b011111,
0b000110,
0b011000,
0b010110,
0b011010,
0b101110,
0b011101,
0b100100,
0b001001,
0b001011,
0b110100,
0b101100,
0b001101,
0b011011,
0b110110,
0b010011,
0b110010,
0b110011,
0b001100,
0b101010,
0b010101,
]
class Line(Enum):
"""
Represents a line in an I Ching hexagram.
Each line can be one of the following:
- 6: Old Yin (changing yin)
- 7: Young Yang (static yang)
- 8: Young Yin (static yin)
- 9: Old Yang (changing yang)
"""
OLD_YIN = 6 # changing yin
YOUNG_YANG = 7 # static yang
YOUNG_YIN = 8 # static yin
OLD_YANG = 9 # changing yang
def is_changing(self) -> bool:
"""Returns True if the line is changing (old)."""
return self in [Line.OLD_YIN, Line.OLD_YANG]
def symbol(self) -> str:
"""Returns the textual representation of the line."""
symbols = {
Line.YOUNG_YANG: "───────",
Line.YOUNG_YIN: "─── ───",
Line.OLD_YANG: "───o───",
Line.OLD_YIN: "───x───",
}
return symbols[self]
def binary_value(self) -> int:
"""Returns the binary value of the line (1 for yang, 0 for yin)."""
return 1 if self in [Line.YOUNG_YANG, Line.OLD_YANG] else 0
class Hexagram:
"""
Represents an I Ching hexagram.
Each hexagram consists of six lines.
"""
def __init__(self, lines: List[Line] | None = None) -> None:
"""
Initializes a Hexagram.
If lines are not provided, generates a random hexagram.
:param lines: List of six integers = the lines of the hexagram.
"""
if lines is None:
self.lines = random.choices(
[Line.OLD_YIN, Line.YOUNG_YANG, Line.YOUNG_YIN, Line.OLD_YANG],
weights=[1, 5, 7, 3],
k=6,
)
else:
self.lines = lines
def print(self) -> str:
"""Prints the hexagram details."""
return "\n".join(
[
"HEXAGRAM {} {}".format(
self.king_wen_number(), self.unicode_representation()
),
"Binary: {:06b}".format(self.binary_representation()),
"Lines (bottom → top): {}".format(
" ".join(str(line.value) for line in self.lines)
),
self.render_text(),
]
)
def render_text(self) -> str:
"""Renders the hexagram in a textual box format."""
lines = []
lines.append("┌─────────┐")
for line in reversed(self.lines):
body = line.symbol()
lines.append(f"{body}")
lines.append("└─────────┘")
return "\n".join(lines)
def binary_representation(self) -> int:
"""Returns the binary representation of the hexagram."""
return sum(
val << i
for i, val in enumerate(
line.binary_value() for line in reversed(self.lines)
)
)
def king_wen_number(self) -> int:
"""Returns the King Wen number of the hexagram."""
return KING_WEN_SEQUENCE.index(self.binary_representation()) + 1
def unicode_representation(self) -> str:
"""Returns the Unicode character representing the hexagram."""
return chr(0x4DC0 + self.king_wen_number() - 1)
def changing_hexagram(self):
"""Returns the changing hexagram
if there are changing lines, else None."""
if any(line.is_changing() for line in self.lines):
new_lines = [
(
Line.YOUNG_YIN
if line == Line.OLD_YANG
else Line.YOUNG_YANG if line == Line.OLD_YIN else line
)
for line in self.lines
]
return Hexagram(new_lines)
return None
@app.route("/")
def main():
result = ""
hexagram = Hexagram()
result += hexagram.print()
if changing_hex := hexagram.changing_hexagram():
result += "\n"
result += changing_hex.print()
return f"<pre>{result}</pre>"
if __name__ == "__main__":
app.run(port=int(os.environ["ICHING_PORT"]))

View File

@@ -0,0 +1,26 @@
from flask import Flask, send_file
from pathlib import Path
from random import choice, randint
from io import BytesIO
from PIL import Image
import os
app = Flask(__name__)
TAROT_DIR = Path(os.environ["TAROT_FILES"])
@app.route("/")
def tarot():
card_path = choice(list(TAROT_DIR.glob("*")))
with Image.open(card_path) as img:
if randint(0, 1):
img = img.rotate(180)
buf = BytesIO()
img.save(buf, format="JPEG")
buf.seek(0)
return send_file(buf, mimetype="image/jpeg", as_attachment=False)
if __name__ == "__main__":
app.run(port=int(os.environ["TAROT_PORT"]))

View File

@@ -1,16 +0,0 @@
{pkgs, ...}: {
services.postgresqlBackup = {
enable = true;
databases = ["atuin"];
};
services.postgresql.package = pkgs.postgresql_14;
services.atuin = {
host = "0.0.0.0";
openFirewall = true;
openRegistration = true;
port = 8888;
enable = true;
};
}

View File

@@ -7,11 +7,9 @@
inherit (import ../../lib) retiolumAddresses restic;
in {
imports = [
./atuin.nix
./backup.nix
./gaslight.nix
./hardware-configuration.nix
./nas.nix
../../configs/mycelium.nix
./home-assistant.nix
../../configs/monitoring.nix
@@ -66,11 +64,9 @@ in {
];
};
services.logind = {
lidSwitch = "ignore";
lidSwitchDocked = "ignore";
lidSwitchExternalPower = "ignore";
};
services.logind.settings.Login.HandleLidSwitchDocked = "ignore";
services.logind.settings.Login.HandleLidSwitchExternalPower = "ignore";
services.logind.settings.Login.HandleLidSwitch = "ignore";
services.illum.enable = true;
@@ -88,9 +84,6 @@ in {
pkgs.python3 # for sshuttle
];
# since 22.05 timeout fails?
# systemd.services.systemd-networkd-wait-online.enable = false;
networking = {
hostName = "zaatar";
wireless.interfaces = ["wlp2s0"];

View File

@@ -1,78 +0,0 @@
{ config, ... }:
{
users.extraUsers.nas = {
isSystemUser = true;
group = "nas";
uid = 7451;
};
users.extraGroups.nas = {
gid = 7452;
};
fileSystems."/media/sd" = {
device = "/dev/disk/by-id/5E4S5_0x4c585d15-part1";
fsType = "ext4";
options = [
"nofail"
"defaults"
"uid=${toString config.users.extraUsers.nas.uid}"
"gid=${toString config.users.extraGroups.nas.gid}"
];
};
fileSystems."/media/hdd" = {
device = "/dev/disk/by-id/0x50014ee658872039-part1";
fsType = "ntfs";
options = [ # ref https://askubuntu.com/a/113746
"nofail"
"defaults"
"nls=utf8"
"umask=000"
"dmask=027"
"fmask=137"
"uid=${toString config.users.extraUsers.nas.uid}"
"gid=${toString config.users.extraGroups.nas.gid}"
"windows_names"
];
};
# ref https://dataswamp.org/~solene/2020-10-18-nixos-nas.html
# ref https://www.reddit.com/r/NixOS/comments/relwsh/comment/hoapgrr/
services.samba = {
enable = true;
securityType = "user";
openFirewall = true;
settings = {
global = {
"guest account" = "nobody";
"hosts allow" = ["192.168.178." "127.0.0.1" "localhost"];
"hosts deny" = ["0.0.0.0/0"];
"map to guest" = "Bad User";
"netbios name" = "zaatar";
"security" = "user";
"server role" = "standalone server";
"server string" = "zaatar";
"workgroup" = "WORKGROUP";
};
};
shares.nas = {
path = "/media";
browseable = "yes";
writable = "yes";
# "read only" = "no";
"guest ok" = "yes";
"create mask" = "0644";
"directory mask" = "0755";
"force user" = config.users.extraUsers.nas.name;
"force group" = config.users.extraUsers.nas.group;
};
};
services.samba-wsdd = {
enable = true;
openFirewall = true;
};
networking.firewall.enable = true;
networking.firewall.allowPing = true;
}

View File

@@ -1,47 +0,0 @@
{config, ...}: {
nixpkgs.config.packageOverrides = pkgs: {
# mpris is a dbus service for controlling all music players with e.g. playerctl
# I do not need this, because I only interact with the service via Spotify Connect
# otherẃise it will pull in DBus which fails without X11
spotifyd = pkgs.spotifyd.overrideAttrs {
withMpris = false;
withKeyring = false;
};
};
services.spotifyd = {
enable = true;
settings = {
global = {
username_cmd = "cat $CREDENTIALS_DIRECTORY/username";
password_cmd = "cat $CREDENTIALS_DIRECTORY/password";
bitrate = 320;
use_mpris = false;
device_type = "s_t_b"; # set-top box
device_name = config.networking.hostName;
};
};
};
systemd.services.spotifyd = {
serviceConfig.LoadCredential = [
"username:${config.age.secrets.spotify-username.path}"
"password:${config.age.secrets.spotify-password.path}"
];
serviceConfig.RuntimeMaxSec = "${toString (5 * 60 * 60)}s";
serviceConfig.SupplementaryGroups = ["pipewire"];
};
networking.firewall.allowedTCPPorts = [4713];
age.secrets = {
spotify-username.file = ../../secrets/spotify-username.age;
spotify-password.file = ../../secrets/spotify-password.age;
};
# ref https://github.com/NixOS/nixpkgs/issues/71362#issuecomment-753461502
hardware.pulseaudio.extraConfig = ''
unload-module module-native-protocol-unix
load-module module-native-protocol-unix auth-anonymous=1
'';
}