From 2ba6c3c602753f27bec5d5f45107aed26f8d0ab4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 21 May 2023 14:12:33 +0200 Subject: [PATCH 01/20] l mail: remove broken gpg config --- lass/2configs/mail.nix | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index 0adef8f8c..fe7de15b7 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -124,15 +124,6 @@ let ''; muttrc = pkgs.writeText "muttrc" '' - # gpg - source ${pkgs.neomutt}/share/doc/neomutt/samples/gpg.rc - set pgp_use_gpg_agent = yes - set pgp_sign_as = 0xDC2A43EF4F11E854B44D599A89E82952976A7E4D - set crypt_autosign = no - set crypt_replyencrypt = yes - set crypt_verify_sig = yes - set pgp_verify_command = "gpg --no-verbose --batch --output - --verify %s %f" - # read html mails auto_view text/html From 7b42561a70af6831da729f36207004a03fba804c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 21 May 2023 14:12:47 +0200 Subject: [PATCH 02/20] l mail: fix muchsync macro --- lass/2configs/mail.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lass/2configs/mail.nix b/lass/2configs/mail.nix index fe7de15b7..bf8904b89 100644 --- a/lass/2configs/mail.nix +++ b/lass/2configs/mail.nix @@ -178,8 +178,7 @@ let until ${pkgs.muchsync}/bin/muchsync -F lass@green.r; do sleep 1 done - ''} \ - 'run muchsync to green.r' + ''} #killed bind index d noop From 4af256589a79d09954f17dbaaec04a22fcd1cebb Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 24 May 2023 16:31:55 +0200 Subject: [PATCH 03/20] nixpkgs: a08e061 -> a17f99d --- krebs/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 4ba72d00d..d4d9cc743 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "a08e061a4ee8329747d54ddf1566d34c55c895eb", - "date": "2023-05-09T12:11:35+02:00", - "path": "/nix/store/lwy9r49c92ml9mbvp2kx1m31p7bcpzxd-nixpkgs", - "sha256": "1h0yd0xka6wj9sbbq34gw7a9qlp044b7dhg16bmn8bv96ix55vzj", + "rev": "a17f99dfcb9643200b3884ca195c69ae41d7f059", + "date": "2023-05-23T18:09:00+02:00", + "path": "/nix/store/2n82i65gv1y54xj3dplkvhfyc8rs1j90-nixpkgs", + "sha256": "180ipicp351s99nvn9xvf5nzs5fzxhawfbykaijvaqj63siss13m", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From e3863bdf7479e4418b6a8ac74648f8ac4b3d75a5 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 24 May 2023 16:34:55 +0200 Subject: [PATCH 04/20] nixpkgs-unstable: 897876e -> 7084250 --- krebs/nixpkgs-unstable.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json index d9e81ad37..9b4622275 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7", - "date": "2023-05-06T22:28:42+01:00", - "path": "/nix/store/55lpvam2wgdmrbzx0j5gf51dqrqn8wqv-nixpkgs", - "sha256": "0i9j45jwmqhiv7v8i4dmigaras3iw4hmrds2vvd5x8riln3hyizn", + "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", + "date": "2023-05-22T13:19:02+02:00", + "path": "/nix/store/zgv3fzg2lywfqdrv4mghd62s9i6zxhrw-nixpkgs", + "sha256": "0nkg8h5ix0sbjqb0gdj5124nbg2gd1nmyl1p14cvlg77fs7afld6", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From 9fe6e5bb4f320876bff02bc75c51050d16593ad0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 24 May 2023 17:39:54 +0200 Subject: [PATCH 05/20] syncthing: add workaround for infinite recursion on unstable --- krebs/2configs/syncthing.nix | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/krebs/2configs/syncthing.nix b/krebs/2configs/syncthing.nix index dac1863d5..d6d42ca11 100644 --- a/krebs/2configs/syncthing.nix +++ b/krebs/2configs/syncthing.nix @@ -1,17 +1,21 @@ -{ config, pkgs, ... }: with import ; let +{ options, config, pkgs, ... }: with import ; let mk_peers = mapAttrs (n: v: { id = v.syncthing.id; }); all_peers = filterAttrs (n: v: v.syncthing.id != null) config.krebs.hosts; - used_peer_names = unique (flatten (mapAttrsToList (n: v: v.devices) config.services.syncthing.declarative.folders)); + used_peer_names = unique (filter isString (flatten (mapAttrsToList (n: v: v.devices) config.services.syncthing.folders))); used_peers = filterAttrs (n: v: elem n used_peer_names) all_peers; in { services.syncthing = { enable = true; configDir = "/var/lib/syncthing"; - devices = mk_peers used_peers; key = toString ; cert = toString ; - }; + # workaround for infinite recursion on unstable, remove in 23.11 + } // (if builtins.hasAttr "settings" options.services.syncthing then + { settings.devices = mk_peers used_peers; } + else + { devices = mk_peers used_peers; } + ); boot.kernel.sysctl."fs.inotify.max_user_watches" = 524288; } From aade31e65bad45c567b64591b06be806a74fc31a Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 25 May 2023 00:06:33 +0200 Subject: [PATCH 06/20] l radio: use larynx tts --- lass/2configs/services/radio/news.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lass/2configs/services/radio/news.nix b/lass/2configs/services/radio/news.nix index 0dc711e6c..d726692d8 100644 --- a/lass/2configs/services/radio/news.nix +++ b/lass/2configs/services/radio/news.nix @@ -44,13 +44,17 @@ in send_to_radio gc_news get_current_news - pkgs.curl pkgs.retry + pkgs.larynx ]; script = '' set -efu - retry -t 5 -d 10 -- newsshow | - retry -t 5 -d 10 -- curl -fSsG http://tts.r/api/tts --data-urlencode 'text@-' | + retry -t 5 -d 10 -- newsshow | tr '\n' ' ' | + retry -t 5 -d 10 -- larynx --model ${pkgs.fetchzip { + url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-libritts-high.tar.gz"; + hash = "sha256-jCoK4p0O7BuF0nr6Sfj40tpivCvU5M3GHKQRg1tfIO8="; + stripRoot = false; + }}/en-us-libritts-high.onnx -s $[ $RANDOM % 900 ] -f - | retry -t 5 -d 10 -- send_to_radio ''; startAt = "*:00:00"; From b99a78b18e37ad38d9bdd63b44ade091ab8c7919 Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 25 May 2023 00:06:58 +0200 Subject: [PATCH 07/20] l radio.r: run nixos-unstable --- lass/1systems/radio/source.nix | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 lass/1systems/radio/source.nix diff --git a/lass/1systems/radio/source.nix b/lass/1systems/radio/source.nix new file mode 100644 index 000000000..4acdb0c26 --- /dev/null +++ b/lass/1systems/radio/source.nix @@ -0,0 +1,6 @@ +{ lib, pkgs, test, ... }: let + npkgs = lib.importJSON ../../../krebs/nixpkgs-unstable.json; +in if test then {} else { + nixpkgs.git.ref = lib.mkForce npkgs.rev; + nixpkgs-unstable = lib.mkForce { file = "/var/empty"; }; +} From 63573a5fa0807a334d35e900d9df8db7c1539acf Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 25 May 2023 11:19:04 +0200 Subject: [PATCH 08/20] l radio: createHome of user --- lass/2configs/services/radio/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lass/2configs/services/radio/default.nix b/lass/2configs/services/radio/default.nix index a511196fd..16ef31b6f 100644 --- a/lass/2configs/services/radio/default.nix +++ b/lass/2configs/services/radio/default.nix @@ -82,7 +82,7 @@ in { users.users = { "${name}" = rec { inherit name; - createHome = lib.mkForce false; + createHome = true; group = name; uid = pkgs.stockholm.lib.genid_uint31 name; description = "radio manager"; From 6ebc5693d6a57233115d968723dd20961857920d Mon Sep 17 00:00:00 2001 From: lassulus Date: Thu, 25 May 2023 11:19:37 +0200 Subject: [PATCH 09/20] l radio: fix tts for long texts --- lass/2configs/services/radio/news.nix | 35 +++++++++++++++++++++------ 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/lass/2configs/services/radio/news.nix b/lass/2configs/services/radio/news.nix index d726692d8..62f7f548c 100644 --- a/lass/2configs/services/radio/news.nix +++ b/lass/2configs/services/radio/news.nix @@ -1,6 +1,31 @@ { config, lib, pkgs, ... }: let + tts = pkgs.writers.writeBashBin "tts" '' + set -efu + + offset=0 + OUTPUT=$(mktemp -d) + trap 'rm -rf "$OUTPUT"' EXIT + SPEAKER=$[ $RANDOM % 900 ] + while read line; do + echo "$line" | + ${pkgs.larynx}/bin/larynx \ + --model ${pkgs.fetchzip { + url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-libritts-high.tar.gz"; + hash = "sha256-jCoK4p0O7BuF0nr6Sfj40tpivCvU5M3GHKQRg1tfIO8="; + stripRoot = false; + }}/en-us-libritts-high.onnx \ + -s "$SPEAKER" \ + -f "$OUTPUT"/"$offset".wav + + ((offset+=1)) + done + + ${pkgs.sox}/bin/sox "$OUTPUT"/*.wav "$OUTPUT"/all.wav + cat "$OUTPUT"/all.wav + ''; + send_to_radio = pkgs.writers.writeDashBin "send_to_radio" '' ${pkgs.vorbis-tools}/bin/oggenc - | ${pkgs.cyberlocker-tools}/bin/cput news.ogg @@ -41,20 +66,16 @@ in systemd.services.newsshow = { path = [ newsshow + tts send_to_radio gc_news get_current_news pkgs.retry - pkgs.larynx ]; script = '' set -efu - retry -t 5 -d 10 -- newsshow | tr '\n' ' ' | - retry -t 5 -d 10 -- larynx --model ${pkgs.fetchzip { - url = "https://github.com/rhasspy/piper/releases/download/v0.0.2/voice-en-us-libritts-high.tar.gz"; - hash = "sha256-jCoK4p0O7BuF0nr6Sfj40tpivCvU5M3GHKQRg1tfIO8="; - stripRoot = false; - }}/en-us-libritts-high.onnx -s $[ $RANDOM % 900 ] -f - | + retry -t 5 -d 10 -- newsshow | + retry -t 5 -d 10 -- tts | retry -t 5 -d 10 -- send_to_radio ''; startAt = "*:00:00"; From 7c3b3400b71678617ac042b522c26e747b8312c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 29 May 2023 20:03:26 +0200 Subject: [PATCH 10/20] l pipewire: skip configuring wireplumber, add bluetooth config --- lass/2configs/pipewire.nix | 19 +++++++++---------- lass/2configs/weron/client.nix | 20 ++++++++++++++++++++ lass/2configs/weron/signaler.nix | 13 +++++++++++++ 3 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 lass/2configs/weron/client.nix create mode 100644 lass/2configs/weron/signaler.nix diff --git a/lass/2configs/pipewire.nix b/lass/2configs/pipewire.nix index ec5a67b6e..da9408669 100644 --- a/lass/2configs/pipewire.nix +++ b/lass/2configs/pipewire.nix @@ -22,15 +22,14 @@ pulse.enable = true; jack.enable = true; }; - - systemd.services.wireplumber = { - environment = { - HOME = "/var/lib/wireplumber"; - DISPLAY = ":0"; - }; - path = [ - pkgs.dbus - ]; - serviceConfig.StateDirectory = "wireplumber"; + environment.etc = { + "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + ''; }; } diff --git a/lass/2configs/weron/client.nix b/lass/2configs/weron/client.nix new file mode 100644 index 000000000..55bc8a0da --- /dev/null +++ b/lass/2configs/weron/client.nix @@ -0,0 +1,20 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services.weron = { + wantedBy = [ "multi-user.target" ]; + environment = { + WERON_RADDR = "ws://lassul.us:23420/"; + }; + serviceConfig = { + ExecStart = pkgs.writers.writeDash "weron" '' + ${pkgs.weron}/bin/weron vpn ip \ + --community krebs \ + --password aidsballs \ + --key aidsballs \ + --ips 10.249.1.0/24 \ + --verbose 7 \ + --dev weron + ''; + }; + }; +} diff --git a/lass/2configs/weron/signaler.nix b/lass/2configs/weron/signaler.nix new file mode 100644 index 000000000..9e817583b --- /dev/null +++ b/lass/2configs/weron/signaler.nix @@ -0,0 +1,13 @@ +{ config, lib, pkgs, ... }: +{ + systemd.services.weron-signaler = { + wantedBy = [ "multi-user.target" ]; + environment = { + }; + serviceConfig = { + ExecStart = ''${pkgs.weron}/bin/weron signaler --verbose=7 --laddr ":23420"''; + }; + }; + + networking.firewall.allowedTCPPorts = [ 23420 ]; +} From 68ebb1a9cabf00fbb5f8bd29de9cf6c4e6fd620c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 3 Jun 2023 22:10:25 +0200 Subject: [PATCH 11/20] l: move wallpaper to wallpaper.r --- kartei/lass/prism.nix | 1 + lass/2configs/fetchWallpaper.nix | 2 +- lass/2configs/realwallpaper.nix | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/kartei/lass/prism.nix b/kartei/lass/prism.nix index d72b167b6..ac7974731 100644 --- a/kartei/lass/prism.nix +++ b/kartei/lass/prism.nix @@ -71,6 +71,7 @@ rec { "c.r" "p.r" "search.r" + "wallpaper.r" ]; tinc = { pubkey = '' diff --git a/lass/2configs/fetchWallpaper.nix b/lass/2configs/fetchWallpaper.nix index 381df494d..781dad032 100644 --- a/lass/2configs/fetchWallpaper.nix +++ b/lass/2configs/fetchWallpaper.nix @@ -5,7 +5,7 @@ let in { krebs.fetchWallpaper = { enable = true; - url = "prism/realwallpaper-krebs-stars-berlin.png"; + url = "http://wallpaper.r/realwallpaper-krebs-stars-berlin.png"; }; } diff --git a/lass/2configs/realwallpaper.nix b/lass/2configs/realwallpaper.nix index a82e1d010..d81642da1 100644 --- a/lass/2configs/realwallpaper.nix +++ b/lass/2configs/realwallpaper.nix @@ -19,8 +19,7 @@ in { } ''; serverAliases = [ - hostname - "${hostname}.r" + "wallpaper.r" ]; locations."/realwallpaper/".extraConfig = '' index on; From d453d911ceee894a7c94e015fa982ead0947fa9e Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 4 Jun 2023 21:59:42 +0200 Subject: [PATCH 12/20] vicuna-chat: init --- krebs/5pkgs/simple/vicuna-chat/default.nix | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 krebs/5pkgs/simple/vicuna-chat/default.nix diff --git a/krebs/5pkgs/simple/vicuna-chat/default.nix b/krebs/5pkgs/simple/vicuna-chat/default.nix new file mode 100644 index 000000000..11a11aabe --- /dev/null +++ b/krebs/5pkgs/simple/vicuna-chat/default.nix @@ -0,0 +1,33 @@ +{ pkgs, ... }: +pkgs.writers.writeDashBin "vicuna-chat" '' + set -efu + + export PATH=${with pkgs; lib.makeBinPath [ + coreutils + curl + jq + ]} + + CONTEXT=''${CONTEXT:-$(date -Id)} + PROMPT=$* + + if ! test -e "$CONTEXT"; then + echo -n 'null' > "$CONTEXT" + fi + + add_to_context() { + jq -rc --argjson message "$1" '. + [$message]' "$CONTEXT" > "$CONTEXT.tmp" + mv "$CONTEXT.tmp" "$CONTEXT" + } + + add_to_context "{\"role\": \"user\", \"content\": \"$PROMPT\"}" + response=$( + jq -nc --slurpfile context "$CONTEXT" '{ + model: "vicuna-13b", + messages: $context[0], + }' | + curl -Ss http://vicuna.r/v1/chat/completions -H 'Content-Type: application/json' -d @- + ) + add_to_context "$(jq -rcn --argjson response "$response" '$response.choices[0].message')" + jq -rcn --argjson response "$response" '$response.choices[0].message.content' +'' From f2e4142dff1c20857437d821db5006348df0ba56 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 5 Jun 2023 19:52:52 +0200 Subject: [PATCH 13/20] cal: use radicale with git sync --- krebs/2configs/cal.nix | 127 ++++++++++++++++++++++++++++++++++------- 1 file changed, 105 insertions(+), 22 deletions(-) diff --git a/krebs/2configs/cal.nix b/krebs/2configs/cal.nix index 90093e8eb..15f0027b3 100644 --- a/krebs/2configs/cal.nix +++ b/krebs/2configs/cal.nix @@ -1,33 +1,116 @@ -{ config, lib, pkgs, ... }: -{ - users.users.testing = { - uid = pkgs.stockholm.lib.genid_uint31 "testing"; - isNormalUser = true; - openssh.authorizedKeys.keys = [ - config.krebs.users.xkey.pubkey - config.krebs.users.lass.pubkey - ]; - packages = [ - pkgs.calendar-cli - pkgs.tmux - ]; - }; +{ config, lib, pkgs, ... }: let - services.xandikos = { + setupGit = '' + export PATH=${lib.makeBinPath [ + pkgs.coreutils + pkgs.git + ]} + export GIT_SSH_COMMAND='${pkgs.openssh}/bin/ssh -i /var/lib/radicale/.ssh/id_ed25519' + repo='git@localhost:cal' + cd /var/lib/radicale/collections + if ! test -d .git; then + git init + git config user.name "radicale" + git config user.email "radicale@${config.networking.hostName}" + elif ! url=$(git config remote.origin.url); then + git remote add origin "$repo" + elif test "$url" != "$repo"; then + git remote set-url origin "$repo" + fi + cp ${pkgs.writeText "gitignore" '' + .Radicale.cache + ''} .gitignore + git add .gitignore + ''; + + pushCal = pkgs.writeDash "push_cal" '' + ${setupGit} + git fetch origin + git merge --ff-only origin/master || : + ''; + + pushCgit = pkgs.writeDash "push_cgit" '' + ${setupGit} + git push origin master + ''; + +in { + services.radicale = { enable = true; - extraOptions = [ - "--autocreate" - "--defaults" - "--current-user-principal /krebs" - "--dump-dav-xml" - ]; + rights = { + krebs = { + user = ".*"; + collection = ".*"; + permissions = "rRwW"; + }; + }; + settings = { + auth.type = "none"; + server.hosts = [ + "0.0.0.0:5232" + "[::]:5232" + ]; + storage.filesystem_folder = "/var/lib/radicale/collections"; + storage.hook = "${pkgs.writers.writeDash "radicale-hook" '' + set -efu + ${setupGit} + ${pkgs.git}/bin/git add -A + (${pkgs.git}/bin/git diff --cached --quiet || ${pkgs.git}/bin/git commit -m "Changes by \"$1\"") + ${pushCgit} + ''} %(user)s"; + }; }; services.nginx = { enable = true; virtualHosts = { - "calendar.r".locations."/".proxyPass = "http://localhost:${toString config.services.xandikos.port}/"; + "calendar.r".locations."/".proxyPass = "http://localhost:5232/"; }; }; + krebs.git = { + enable = true; + cgit.settings = { + root-title = "krebs repos"; + }; + rules = with pkgs.stockholm.lib.git; [ + { + user = [ + { + name = "cal"; + pubkey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGe1jtHaNFZKmWemWQVEGVYj+s4QGJaL9WYH+wokOZie"; + } + ] ++ (lib.attrValues config.krebs.users); + repo = [ config.krebs.git.repos.cal ]; + perm = push ''refs/heads/master'' [ create merge ]; + } + ]; + repos.cal = { + public = true; + name = "cal"; + hooks = { + post-receive = '' + ${pkgs.git-hooks.irc-announce { + channel = "#xxx"; + refs = [ + "refs/heads/master" + ]; + nick = config.networking.hostName; + server = "irc.r"; + verbose = true; + }} + /run/wrappers/bin/sudo -S -u radicale ${pushCal} + ''; + }; + }; + }; + krebs.secret.files.calendar = { + path = "/var/lib/radicale/.ssh/id_ed25519"; + owner = { name = "radicale"; }; + source-path = "${}"; + }; + + security.sudo.extraConfig = '' + git ALL=(radicale) NOPASSWD: ${pushCal} + ''; } From 1a8b5c8e2a63247d82aed570c4bd224ee1c718c0 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 6 Jun 2023 17:32:38 +0200 Subject: [PATCH 14/20] nixpkgs-unstable: 7084250 -> 7409480 --- krebs/nixpkgs-unstable.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json index 9b4622275..6decb1fd3 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "7084250df3d7f9735087d3234407f3c1fc2400e3", - "date": "2023-05-22T13:19:02+02:00", - "path": "/nix/store/zgv3fzg2lywfqdrv4mghd62s9i6zxhrw-nixpkgs", - "sha256": "0nkg8h5ix0sbjqb0gdj5124nbg2gd1nmyl1p14cvlg77fs7afld6", + "rev": "7409480d5c8584a1a83c422530419efe4afb0d19", + "date": "2023-06-04T22:13:39-04:00", + "path": "/nix/store/ljhvmls6vxsg7x93zvaa087y77wh2nzc-nixpkgs", + "sha256": "14rv5zjrq5rpqlzc1wzh30yhn8aivwkm2zrh0bh0facbkqwrwigh", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From c1ef7c79b6783bc4289c085f43aec67b98c2a8ef Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 6 Jun 2023 17:32:54 +0200 Subject: [PATCH 15/20] nixpkgs: a17f99d -> d4a9ff8 --- krebs/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index d4d9cc743..795b07fa7 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "a17f99dfcb9643200b3884ca195c69ae41d7f059", - "date": "2023-05-23T18:09:00+02:00", - "path": "/nix/store/2n82i65gv1y54xj3dplkvhfyc8rs1j90-nixpkgs", - "sha256": "180ipicp351s99nvn9xvf5nzs5fzxhawfbykaijvaqj63siss13m", + "rev": "d4a9ff82fc18723219b60c66fb2ccb0734c460eb", + "date": "2023-06-04T14:52:07+02:00", + "path": "/nix/store/hnnbh80g4jx19h0ac76qrirai16ld2px-nixpkgs", + "sha256": "0ly23mqjzlygsnr0avji6ylyrl90rcqsmkcavg71kd60v8ydmw6c", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From 0156323836b3e5ca311ff7eb9a0213aacfe9be10 Mon Sep 17 00:00:00 2001 From: lassulus Date: Tue, 6 Jun 2023 19:25:35 +0200 Subject: [PATCH 16/20] l themes: make wayland compatible --- lass/2configs/themes.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lass/2configs/themes.nix b/lass/2configs/themes.nix index eb1a53987..e9f83deea 100644 --- a/lass/2configs/themes.nix +++ b/lass/2configs/themes.nix @@ -15,6 +15,7 @@ ${pkgs.coreutils}/bin/chown lass:users /var/theme/current_theme ${pkgs.xorg.xrdb}/bin/xrdb -merge /var/theme/config/xresources ${pkgs.procps}/bin/pkill -HUP xsettingsd + ${pkgs.glib}/bin/gsettings set org.gnome.desktop.interface gtk-theme "$(cat /var/theme/config/gtk-theme)" else echo "theme $1 not found" fi @@ -37,17 +38,25 @@ in { ]; environment.systemPackages = [ switch-theme + pkgs.dracula-theme + pkgs.gnome3.adwaita-icon-theme ]; environment.etc = { + "themes/light/gtk-theme".text = '' + Adwaita + ''; "themes/light/xsettings.conf".text = '' - Net/ThemeName "Adwaita" + Net/ThemeName "Adwaita" ''; "themes/light/xresources".text = '' *background: #ffffff *foreground: #000000 ''; + "themes/dark/gtk-theme".text = '' + Dracula + ''; "themes/dark/xsettings.conf".text = '' - Net/ThemeName "Adwaita-dark" + Net/ThemeName "Dracula" ''; "themes/dark/xresources".text = '' *background: #000000 From d0ab4abe01f1110cc7948e221f886e6ae867f940 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 7 Jun 2023 20:29:49 +0200 Subject: [PATCH 17/20] nixpkgs-unstable: 7409480 -> 4729ffa --- krebs/nixpkgs-unstable.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs-unstable.json b/krebs/nixpkgs-unstable.json index 6decb1fd3..a30dffd71 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "7409480d5c8584a1a83c422530419efe4afb0d19", - "date": "2023-06-04T22:13:39-04:00", - "path": "/nix/store/ljhvmls6vxsg7x93zvaa087y77wh2nzc-nixpkgs", - "sha256": "14rv5zjrq5rpqlzc1wzh30yhn8aivwkm2zrh0bh0facbkqwrwigh", + "rev": "4729ffac6fd12e26e5a8de002781ffc49b0e94b7", + "date": "2023-06-05T20:59:20-06:00", + "path": "/nix/store/6r3d9mpbl3px7y8y6wcwsg60bvish21w-nixpkgs", + "sha256": "0gha78rczp5gbl6v39i2bm11kmi974akgqkj3hck5s2ri6abprsr", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From a4af7cdf7e3c883f699bd309f98324f9ea586c9d Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 7 Jun 2023 20:31:12 +0200 Subject: [PATCH 18/20] nixpkgs: d4a9ff8 -> d83945c --- krebs/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 795b07fa7..5435dd9bd 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "d4a9ff82fc18723219b60c66fb2ccb0734c460eb", - "date": "2023-06-04T14:52:07+02:00", - "path": "/nix/store/hnnbh80g4jx19h0ac76qrirai16ld2px-nixpkgs", - "sha256": "0ly23mqjzlygsnr0avji6ylyrl90rcqsmkcavg71kd60v8ydmw6c", + "rev": "d83945caa7624015f11b152bf5c6c4363ffe9f7c", + "date": "2023-06-06T09:06:53+02:00", + "path": "/nix/store/vzqz4lhcfjg5npn2fm7w3qpm7h0i5baz-nixpkgs", + "sha256": "0l4axff9lqc6qq1dkm1dgdp2zv7165a42d9l2zmf4njnhm91f5w5", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From ab0812fa5ac2a3d378a3eaa155ef734aa2a3b196 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sat, 10 Jun 2023 22:38:40 +0200 Subject: [PATCH 19/20] reaktor2: use new bing api --- krebs/2configs/reaktor2.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index 67c2dd4cd..45ff61baf 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -77,7 +77,7 @@ let if [ "$?" -ne 0 ]; then report_error "$response" else - if ! text=$(printf '%s' "$response" | jq -er '.item.messages[1].text'); then + if ! text=$(printf '%s' "$response" | jq -er '.item.messages[-1].text'); then echo "$_from: $(report_error "$response")" exit 0 fi @@ -85,7 +85,7 @@ let echo "$_from: $text" | fold -s -w 426 printf '%s' "$response" | - jq -r '[.item.messages[1].sourceAttributions[].seeMoreUrl] | to_entries[] | "[\(.key + 1)]: \(.value)"' + jq -r '[.item.messages[-1].sourceAttributions[].seeMoreUrl] | to_entries[] | "[\(.key + 1)]: \(.value)"' fi ''; }; @@ -158,6 +158,7 @@ let ''; }; }; + interrogate = { pattern = "^!interrogate (.*)$"; activate = "match"; From ccf29b838bb6865f940597a1bd6e6cb4f3522b0c Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 11 Jun 2023 16:01:24 +0200 Subject: [PATCH 20/20] l: extract fonts, switch to compiled iosevka --- lass/2configs/baseX.nix | 65 ++++------------------------------------ lass/2configs/fonts.nix | 14 +++++++++ lass/2configs/xmonad.nix | 2 +- 3 files changed, 20 insertions(+), 61 deletions(-) create mode 100644 lass/2configs/fonts.nix diff --git a/lass/2configs/baseX.nix b/lass/2configs/baseX.nix index 79777429a..bb01d3dcd 100644 --- a/lass/2configs/baseX.nix +++ b/lass/2configs/baseX.nix @@ -14,6 +14,7 @@ in { ./tmux.nix ./xmonad.nix ./themes.nix + ./fonts.nix { users.users.mainUser.packages = [ pkgs.sshuttle @@ -26,15 +27,15 @@ in { options.lass.fonts = { regular = mkOption { type = types.str; - default = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; + default = "xft:Iosevka Term SS15:style=regular"; }; bold = mkOption { type = types.str; - default = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; + default = "xft:Iosevka Term SS15:style=bold"; }; italic = mkOption { type = types.str; - default = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1"; + default = "xft:Iosevka Term SS15:style=italic"; }; }; config.krebs.xresources.resources.X = '' @@ -98,65 +99,9 @@ in { ${pkgs.flameshot}/bin/flameshot gui ${pkgs.klem}/bin/klem '') + ]; - fonts = { - fontDir.enable = true; - enableGhostscriptFonts = true; - - fonts = with pkgs; [ - xorg.fontschumachermisc - inconsolata - noto-fonts - (iosevka.override { - # https://typeof.net/Iosevka/customizer - privateBuildPlan = { - family = "Iosevka"; - spacing = "term"; - serifs = "slab"; - no-ligation = true; - - variants.design = { - capital-j = "serifless"; - a = "double-storey-tailed"; - b = "toothless-corner"; - d = "toothless-corner-serifless"; - f = "flat-hook-tailed"; - g = "earless-corner"; - i = "hooky"; - j = "serifless"; - l = "tailed"; - - m = "earless-corner-double-arch"; - n = "earless-corner-straight"; - p = "earless-corner"; - q = "earless-corner"; - r = "earless-corner"; - u = "toothless-rounded"; - y = "cursive-flat-hook"; - - one = "no-base-long-top-serif"; - two = "straight-neck"; - three = "flat-top"; - four = "open"; - six = "open-contour"; - seven = "straight-serifless"; - eight = "two-circles"; - nine = "open-contour"; - tilde = "low"; - asterisk = "hex-low"; - number-sign = "upright"; - at = "short"; - dollar = "open"; - percent = "dots"; - question = "corner-flat-hooked"; - }; - }; - set = "kookiefonts"; - }) - ]; - }; - services.udev.extraRules = '' SUBSYSTEM=="backlight", ACTION=="add", \ RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness", \ diff --git a/lass/2configs/fonts.nix b/lass/2configs/fonts.nix new file mode 100644 index 000000000..3d047e513 --- /dev/null +++ b/lass/2configs/fonts.nix @@ -0,0 +1,14 @@ +{ config, lib, pkgs, ... }: +{ + fonts = { + fontDir.enable = true; + enableGhostscriptFonts = true; + + fonts = with pkgs; [ + xorg.fontschumachermisc + inconsolata + noto-fonts + (iosevka-bin.override { variant = "ss15"; }) + ]; + }; +} diff --git a/lass/2configs/xmonad.nix b/lass/2configs/xmonad.nix index 1789725d1..e2d9cff5d 100644 --- a/lass/2configs/xmonad.nix +++ b/lass/2configs/xmonad.nix @@ -68,7 +68,7 @@ myTerm :: FilePath myTerm = "/run/current-system/sw/bin/alacritty" myFont :: String -myFont = "-*-clean-*-*-*-*-*-*-*-*-*-*-iso10646-1" +myFont = "${config.lass.fonts.regular}" main :: IO () main = do