From 0390e201048c8ff1f6a18d09f4a6eb11eded487b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 23 Apr 2023 14:34:21 +0200 Subject: [PATCH 01/32] tv imagescan-plugin-networkscan: add old comments --- .../simple/imagescan-plugin-networkscan.nix | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tv/5pkgs/simple/imagescan-plugin-networkscan.nix b/tv/5pkgs/simple/imagescan-plugin-networkscan.nix index 4f9b84b22..0bd1c5e12 100644 --- a/tv/5pkgs/simple/imagescan-plugin-networkscan.nix +++ b/tv/5pkgs/simple/imagescan-plugin-networkscan.nix @@ -4,14 +4,39 @@ stdenv.mkDerivation rec { pname = "imagescan-plugin-networkscan"; version = "1.1.3"; + # TODO mirror://epson/imagescanv3/debian/latest1/deb/x86/imagescan-bundle-debian-9-${utsushiVersion}.x86.deb.tar.gz using NIX_MIRRORS_epson= + # TODO http://support.epson.net/linux/en/imagescanv3.php#debian + # TODO https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=imagescan-plugin-networkscan is using the RPM file + #src = let + # add = a: b: a + b; + # append = rhs: lhs: lhs + rhs; + # mirrors.i686-linux = [ + # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x86" + # "http://ni.r/~tv/mirrors/epson" + # ]; + # mirrors.x86_64-linux = [ + # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64" + # "http://ni.r/~tv/mirrors/epson" + # ]; + #in src = if stdenv.system == "x86_64-linux" then fetchurl { + #urls = [ + # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-10-3.62.0.x64.deb.tar.gz" + # "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-10-3.62.0.x64.deb.tar.gz" + #]; + #hash = "sha256:1ha1h7xw23p96mpixgcg1sy8lzv8q414rr9n8h4vli0bdkl8i6x9"; urls = [ "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-10-3.63.0.x64.deb.tar.gz" "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-10-3.63.0.x64.deb.tar.gz" ]; hash = "sha256:1rbz6mjfinag7c2vnyl7lls3gpn8n91sv0p18ilnbw0vaddssn4j"; + #urls = [ + # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-10-3.65.0.x64.deb.tar.gz" + # "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-10-3.65.0.x64.deb.tar.gz" + #]; + #hash = "sha256:0ad4kx20fsw5j7fhcvmlpyxr44imy9x6g36zpr8z0ghwqg17ljm5"; } else throw "${pname} is not supported on ${stdenv.system}; supported systems: x86_64-linux"; From 57072433742bc07847d7f7a3b2d3033c8efdf8b2 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 23 Apr 2023 14:34:27 +0200 Subject: [PATCH 02/32] tv imagescan-plugin-networkscan: RIP --- .../simple/imagescan-plugin-networkscan.nix | 80 ------------------- 1 file changed, 80 deletions(-) delete mode 100644 tv/5pkgs/simple/imagescan-plugin-networkscan.nix diff --git a/tv/5pkgs/simple/imagescan-plugin-networkscan.nix b/tv/5pkgs/simple/imagescan-plugin-networkscan.nix deleted file mode 100644 index 0bd1c5e12..000000000 --- a/tv/5pkgs/simple/imagescan-plugin-networkscan.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ fetchurl, lib, pkgs, stdenv }: - -stdenv.mkDerivation rec { - pname = "imagescan-plugin-networkscan"; - version = "1.1.3"; - - # TODO mirror://epson/imagescanv3/debian/latest1/deb/x86/imagescan-bundle-debian-9-${utsushiVersion}.x86.deb.tar.gz using NIX_MIRRORS_epson= - # TODO http://support.epson.net/linux/en/imagescanv3.php#debian - # TODO https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=imagescan-plugin-networkscan is using the RPM file - #src = let - # add = a: b: a + b; - # append = rhs: lhs: lhs + rhs; - # mirrors.i686-linux = [ - # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x86" - # "http://ni.r/~tv/mirrors/epson" - # ]; - # mirrors.x86_64-linux = [ - # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64" - # "http://ni.r/~tv/mirrors/epson" - # ]; - #in - src = - if stdenv.system == "x86_64-linux" then - fetchurl { - #urls = [ - # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-10-3.62.0.x64.deb.tar.gz" - # "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-10-3.62.0.x64.deb.tar.gz" - #]; - #hash = "sha256:1ha1h7xw23p96mpixgcg1sy8lzv8q414rr9n8h4vli0bdkl8i6x9"; - urls = [ - "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-10-3.63.0.x64.deb.tar.gz" - "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-10-3.63.0.x64.deb.tar.gz" - ]; - hash = "sha256:1rbz6mjfinag7c2vnyl7lls3gpn8n91sv0p18ilnbw0vaddssn4j"; - #urls = [ - # "https://download2.ebz.epson.net/imagescanv3/debian/latest1/deb/x64/imagescan-bundle-debian-10-3.65.0.x64.deb.tar.gz" - # "http://ni.r/~tv/mirrors/epson/imagescan-bundle-debian-10-3.65.0.x64.deb.tar.gz" - #]; - #hash = "sha256:0ad4kx20fsw5j7fhcvmlpyxr44imy9x6g36zpr8z0ghwqg17ljm5"; - } - else throw "${pname} is not supported on ${stdenv.system}; supported systems: x86_64-linux"; - - dontBuild = true; - - nativeBuildInputs = [ - pkgs.dpkg - ]; - - installPhase = '' - # Wildcard * stand for either i386 or amd64 - dpkg -x \ - plugins/imagescan-plugin-networkscan_${version}-1epson4debian10_*.deb \ - tmp - - mv tmp/usr $out - ''; - - preFixup = '' - patchelf --set-interpreter \ - ${pkgs.pkgsi686Linux.glibc}/lib/ld-linux-x86-64.so.2 \ - $out/lib/utsushi/networkscan - - # libstdc++.so.6 - patchelf --set-rpath \ - ${stdenv.cc.cc.lib}/lib \ - $out/lib/utsushi/networkscan - ''; - - meta = { - description = "Epson Image Scan v3 networkscan plugin"; - longDescription = '' - This package provides the unfree networkscan plugin from the Epson - Image Scan v3 scanner driver bundle, which can be used by Utsushi. - ''; - homepage = "http://support.epson.net/linux/en/imagescanv3.php?version=${version}"; - license = lib.licenses.eapl; - maintainers = [ lib.maintainers.tv ]; - platforms = lib.platforms.linux; - }; -} From 23ea133db94ec1da4454438fb33ce670747be59f Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 25 Apr 2023 13:10:39 +0200 Subject: [PATCH 03/32] tv xp-332: RIP --- tv/1systems/querel/config.nix | 1 - tv/1systems/xu/config.nix | 1 - tv/2configs/xp-332.nix | 42 ----------------------------------- 3 files changed, 44 deletions(-) delete mode 100644 tv/2configs/xp-332.nix diff --git a/tv/1systems/querel/config.nix b/tv/1systems/querel/config.nix index 8df29f75e..7ba7d1620 100644 --- a/tv/1systems/querel/config.nix +++ b/tv/1systems/querel/config.nix @@ -3,7 +3,6 @@ with import ./lib; imports = [ - ]; krebs.build.host = config.krebs.hosts.querel; diff --git a/tv/1systems/xu/config.nix b/tv/1systems/xu/config.nix index b83d01f02..80d16e686 100644 --- a/tv/1systems/xu/config.nix +++ b/tv/1systems/xu/config.nix @@ -17,7 +17,6 @@ with import ./lib; - diff --git a/tv/2configs/xp-332.nix b/tv/2configs/xp-332.nix deleted file mode 100644 index 51fd1ae8c..000000000 --- a/tv/2configs/xp-332.nix +++ /dev/null @@ -1,42 +0,0 @@ -with import ./lib; -{ config, pkgs, ... }: { - - environment.etc."utsushi.conf".text = '' - [devices] - dev1.udi = esci:networkscan://ep.hkw:1865 - dev1.model = XP-332 - dev1.vendor = EPSON - ''; - - hardware.sane = { - enable = true; - extraBackends = [ - pkgs.utsushi-customized - ]; - }; - - krebs.nixpkgs.allowUnfreePredicate = pkg: - packageName pkg == "imagescan-plugin-networkscan"; - - nixpkgs.overlays = singleton (self: super: { - utsushi-customized = self.utsushi.overrideAttrs (old: { - postInstall = '' - ${old.postInstall or ""} - ln -s /etc/utsushi.conf $out/etc/utsushi/utsushi.conf - ln -s ${pkgs.imagescan-plugin-networkscan}/lib/utsushi/networkscan \ - $out/libexec/utsushi/ - ''; - }); - }); - - services = { - printing = { - drivers = [ - pkgs.epson-escpr - ]; - enable = true; - }; - saned.enable = true; - }; - -} From 72de0dd65937dde91c9926bac3ba053d69e0769e Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 25 Apr 2023 12:56:06 +0200 Subject: [PATCH 04/32] kartei tv pi: init --- kartei/tv/hosts/pi.nix | 4 ++++ kartei/tv/wiregrill/pi.pub | 1 + 2 files changed, 5 insertions(+) create mode 100644 kartei/tv/hosts/pi.nix create mode 100644 kartei/tv/wiregrill/pi.pub diff --git a/kartei/tv/hosts/pi.nix b/kartei/tv/hosts/pi.nix new file mode 100644 index 000000000..991bc0086 --- /dev/null +++ b/kartei/tv/hosts/pi.nix @@ -0,0 +1,4 @@ +{ + nets.wiregrill.ip4.addr = "10.244.3.102"; + syncthing.id = "NLR6FLV-2MJQSZ6-4M5QBBB-X2UM225-YGB6IYW-F2EGFV6-D7ZDCWY-27EQAAM"; +} diff --git a/kartei/tv/wiregrill/pi.pub b/kartei/tv/wiregrill/pi.pub new file mode 100644 index 000000000..8d5b3f103 --- /dev/null +++ b/kartei/tv/wiregrill/pi.pub @@ -0,0 +1 @@ +HlKTr86mTywYtRIQNhxs8jeSw5hwVTeKFiSUYglc4T8= From a67143a6ce08a48f11f87bb12be3695385a0242b Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 28 Apr 2023 15:28:48 +0200 Subject: [PATCH 05/32] nixpkgs-unstable: 645bc49 -> d6b863f --- 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 bd1ab98c0..11ac1c6e4 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "645bc49f34fa8eff95479f0345ff57e55b53437e", - "date": "2023-04-19T18:04:47+02:00", - "path": "/nix/store/jh86824939585dinrs1zlkh6cvz8l8l7-nixpkgs", - "sha256": "0kfndc7xdkm89yl0f27wdnwd6gdad3i49jx7gvaib1hz0ifpmxzv", + "rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891", + "date": "2023-04-26T18:35:28+02:00", + "path": "/nix/store/kyr8hz9d55f9fffr4y8d3hz3zb7h9fhb-nixpkgs", + "sha256": "02rd1n6d453rdp2978bvnp99nyfa26jxgbsg78yb9mmdxvha3hnr", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From b7c249b620f6431e673732f43904ab7d8126c6bf Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 28 Apr 2023 15:29:09 +0200 Subject: [PATCH 06/32] nixpkgs: fd901ef -> 15b7580 --- krebs/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index 7e478e9cf..bc350d0d7 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "fd901ef4bf93499374c5af385b2943f5801c0833", - "date": "2023-04-22T11:27:49+08:00", - "path": "/nix/store/gpfv5hbki6g1b63nqw7md5bjlcpzsz1w-nixpkgs", - "sha256": "1fd7xyfna0klfbv37qq1ms2j4gzjpy14a8vbnw1i8ix6fijkywjf", + "rev": "15b75800dce80225b44f067c9012b09de37dfad2", + "date": "2023-04-26T21:45:16+02:00", + "path": "/nix/store/5d3a0nazp51ndfgf9dpgyyw14g5i02mh-nixpkgs", + "sha256": "0xmza136qf0hssh2a4dq62w7w1xs6rdfxs314pqxqjvvqibf1qb2", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From b91011c9ec595bde7de1b9766cfff3edf03fcdce Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 28 Apr 2023 17:40:14 +0200 Subject: [PATCH 07/32] l aergia.r: disable vbox --- lass/1systems/aergia/config.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lass/1systems/aergia/config.nix b/lass/1systems/aergia/config.nix index 6992db4a5..d49040a7a 100644 --- a/lass/1systems/aergia/config.nix +++ b/lass/1systems/aergia/config.nix @@ -65,8 +65,4 @@ ]; boot.cleanTmpDir = true; - - # vbox - virtualisation.virtualbox.host.enable = true; - users.users.mainUser.extraGroups = [ "vboxusers" ]; } From 67a2ab17a6b06527a31b03770615d5f64c18cded Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 27 Apr 2023 18:08:16 +0200 Subject: [PATCH 08/32] kartei/mic92/blob64: add ip addressses --- kartei/mic92/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kartei/mic92/default.nix b/kartei/mic92/default.nix index 952b5fd40..003c66c66 100644 --- a/kartei/mic92/default.nix +++ b/kartei/mic92/default.nix @@ -809,7 +809,14 @@ in { blob64 = { owner = config.krebs.users.mic92; nets = rec { + internet = { + # of2.dse.cit.tum.de. + ip4.addr = "131.159.38.25"; + ip6.addr = "2a09:80c0:38::25"; + aliases = [ "blob64.i" ]; + }; retiolum = { + via = internet; aliases = [ "blob64.r" ]; tinc.pubkey = '' -----BEGIN RSA PUBLIC KEY----- From d3b150416989aae2fa4aebf097dac96d53cd2164 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 28 Apr 2023 23:11:21 +0200 Subject: [PATCH 09/32] vendor htgen-paste --- krebs/5pkgs/simple/htgen-paste/default.nix | 27 ++++++++ .../5pkgs/simple/htgen-paste/src/htgen-paste | 63 +++++++++++++++++++ lass/2configs/paste.nix | 11 +--- 3 files changed, 93 insertions(+), 8 deletions(-) create mode 100644 krebs/5pkgs/simple/htgen-paste/default.nix create mode 100644 krebs/5pkgs/simple/htgen-paste/src/htgen-paste diff --git a/krebs/5pkgs/simple/htgen-paste/default.nix b/krebs/5pkgs/simple/htgen-paste/default.nix new file mode 100644 index 000000000..48b72833e --- /dev/null +++ b/krebs/5pkgs/simple/htgen-paste/default.nix @@ -0,0 +1,27 @@ +{ pkgs, stockholm, stdenv }: +with stockholm.lib; + +stdenv.mkDerivation rec { + pname = "htgen-paste"; + version = "1.0.0"; + + src = ./src; + + buildPhase = '' + ( + exec > htgen-paste + echo PATH=${makeBinPath [ + pkgs.nix + pkgs.file + pkgs.coreutils + pkgs.findutils + ]} + echo STATEDIR=${shell.escape "\${STATEDIR-$HOME}"} + cat $src/htgen-paste + ) + ''; + + installPhase = '' + install -D htgen-paste $out/bin/htgen-paste + ''; +} diff --git a/krebs/5pkgs/simple/htgen-paste/src/htgen-paste b/krebs/5pkgs/simple/htgen-paste/src/htgen-paste new file mode 100644 index 000000000..bec238dca --- /dev/null +++ b/krebs/5pkgs/simple/htgen-paste/src/htgen-paste @@ -0,0 +1,63 @@ +find_item() { + if test ${#1} -ge 7; then + set -- "$(find "$STATEDIR/items" -mindepth 1 -maxdepth 1 \ + -regex "$STATEDIR/items/$1[0-9A-Za-z]*$")" + if test -n "$1" && test $(echo "$1" | wc -l) = 1; then + echo "$1" + return 0 + fi + fi + return 1 +} + +abs_path=${Request_URI%%\?*} + +case "$Method $abs_path" in + "GET /"[0-9a-z]*) + if item=$(find_item ${abs_path#/}); then + printf 'HTTP/1.1 200 OK\r\n' + printf 'Content-Type: %s\r\n' "$(file -ib $item)" + printf 'Server: %s\r\n' "$Server" + printf 'Connection: close\r\n' + printf 'Content-Length: %d\r\n' $(wc -c < $item) + printf '\r\n' + cat $item + exit + fi + ;; + "POST /") + content=$(mktemp -t htgen.$$.content.XXXXXXXX) + trap "rm $content >&2" EXIT + + case ${req_expect-} in 100-continue) + printf 'HTTP/1.1 100 Continue\r\n\r\n' + esac + + head -c $req_content_length > $content + + sha256=$(sha256sum -b $content | cut -d\ -f1) + base32=$(nix-hash --to-base32 --type sha256 $sha256) + item=$STATEDIR/items/$base32 + ref=http://$req_host/$base32 + + if ! test -e $item; then + mkdir -v -p $STATEDIR/items >&2 + cp -v $content $item >&2 + fi + + base32short=$(echo $base32 | cut -b-7) + if item=$(find_item $base32short); then + ref=$(echo "$ref"; echo "http://$req_host/$base32short") + fi + + printf 'HTTP/1.1 200 OK\r\n' + printf 'Content-Type: text/plain; charset=UTF-8\r\n' + printf 'Server: %s\r\n' "$Server" + printf 'Connection: close\r\n' + printf 'Content-Length: %d\r\n' $(expr ${#ref} + 1) + printf '\r\n' + printf '%s\n' "$ref" + + exit + ;; +esac diff --git a/lass/2configs/paste.nix b/lass/2configs/paste.nix index cfd7f5576..87768a452 100644 --- a/lass/2configs/paste.nix +++ b/lass/2configs/paste.nix @@ -82,14 +82,9 @@ with import ; krebs.htgen.paste = { port = 9081; - script = toString [ - "PATH=${makeBinPath [ - pkgs.nix - pkgs.file - ]}:$PATH" - "STATEDIR=$HOME" - ". ${pkgs.htgen}/examples/paste" - ]; + script = /* sh */ '' + (. ${pkgs.htgen-paste}/bin/htgen-paste) + ''; }; systemd.services.paste-gc = { From 40345c34bf6ff873e89e12ec66927cc5ec996d93 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 28 Apr 2023 23:49:03 +0200 Subject: [PATCH 10/32] htgen-paste: allow setting of Content-Type --- krebs/5pkgs/simple/htgen-paste/src/htgen-paste | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/htgen-paste/src/htgen-paste b/krebs/5pkgs/simple/htgen-paste/src/htgen-paste index bec238dca..bc806e870 100644 --- a/krebs/5pkgs/simple/htgen-paste/src/htgen-paste +++ b/krebs/5pkgs/simple/htgen-paste/src/htgen-paste @@ -15,8 +15,9 @@ abs_path=${Request_URI%%\?*} case "$Method $abs_path" in "GET /"[0-9a-z]*) if item=$(find_item ${abs_path#/}); then + content_type=$(cat "$item".content_type 2>/dev/null || file -ib "$item") printf 'HTTP/1.1 200 OK\r\n' - printf 'Content-Type: %s\r\n' "$(file -ib $item)" + printf 'Content-Type: %s\r\n' "$content_type" printf 'Server: %s\r\n' "$Server" printf 'Connection: close\r\n' printf 'Content-Length: %d\r\n' $(wc -c < $item) @@ -45,6 +46,10 @@ case "$Method $abs_path" in cp -v $content $item >&2 fi + if test -n ${reg_content_type-}; then + echo -n "$req_content_type" > "$item".content_type + fi + base32short=$(echo $base32 | cut -b-7) if item=$(find_item $base32short); then ref=$(echo "$ref"; echo "http://$req_host/$base32short") From 3cc91cc0dafa1b299100f06c8389d04d8b95d3b3 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 1 May 2023 11:17:14 +0200 Subject: [PATCH 11/32] q-power_supply: print status --- krebs/5pkgs/simple/q-power_supply.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/krebs/5pkgs/simple/q-power_supply.nix b/krebs/5pkgs/simple/q-power_supply.nix index 627e3f905..ef133bfbd 100644 --- a/krebs/5pkgs/simple/q-power_supply.nix +++ b/krebs/5pkgs/simple/q-power_supply.nix @@ -63,6 +63,7 @@ writeDashBin "q-power_supply" '' END { name = ENVIRON["POWER_SUPPLY_NAME"] + status = ENVIRON["POWER_SUPPLY_STATUS"] charge_unit = "Ah" charge_now = ENVIRON["POWER_SUPPLY_CHARGE_NOW"] / 10^6 @@ -132,6 +133,8 @@ writeDashBin "q-power_supply" '' out = out sprintf(" %s", print_hm(charge_now / current_now)) } + out = out " " status + print out } ' From b60be1128bf5525cf78b9b57afd19e001cd5a9d3 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 2 May 2023 20:39:46 +0200 Subject: [PATCH 12/32] konsens: all directories are safe --- krebs/3modules/konsens.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/krebs/3modules/konsens.nix b/krebs/3modules/konsens.nix index 439bcc7f4..d27a702fb 100644 --- a/krebs/3modules/konsens.nix +++ b/krebs/3modules/konsens.nix @@ -66,6 +66,8 @@ let Type = "simple"; PermissionsStartOnly = true; ExecStart = pkgs.writeDash "konsens-${name}" '' + set -efu + git config --global --replace-all safe.directory * if ! test -e ${name}; then git clone ${repo.url} ${name} fi From 4faebce3c6a2e9c3a5c6a3f4bd89ab683b65ca58 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 2 May 2023 21:28:13 +0200 Subject: [PATCH 13/32] konsens: add ssh to pkgs --- krebs/3modules/konsens.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/krebs/3modules/konsens.nix b/krebs/3modules/konsens.nix index d27a702fb..81dbb33e1 100644 --- a/krebs/3modules/konsens.nix +++ b/krebs/3modules/konsens.nix @@ -60,7 +60,10 @@ let systemd.services = mapAttrs' (name: repo: nameValuePair "konsens-${name}" { after = [ "network.target" ]; - path = [ pkgs.git ]; + path = [ + pkgs.git + pkgs.openssh + ]; restartIfChanged = false; serviceConfig = { Type = "simple"; From 194781fa5eb2fd5e9be3ac4fa57872659fec512b Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 3 May 2023 12:28:46 +0200 Subject: [PATCH 14/32] kpaste: allow override of Content-Type --- krebs/5pkgs/simple/kpaste/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/kpaste/default.nix b/krebs/5pkgs/simple/kpaste/default.nix index 9820c931d..1c0225af7 100644 --- a/krebs/5pkgs/simple/kpaste/default.nix +++ b/krebs/5pkgs/simple/kpaste/default.nix @@ -1,6 +1,7 @@ { curl, gnused, writeDashBin }: writeDashBin "kpaste" '' - ${curl}/bin/curl -sS http://p.r --data-binary @"''${1:--}" | + ${curl}/bin/curl -sS http://p.r --data-binary @"''${1:--}" \ + -H "Content-Type-Override: ''${KPASTE_CONTENT_TYPE-}" ${gnused}/bin/sed '$ {p;s|http://p.r|https://p.krebsco.de|}' '' From a2b03cb28c97be3e9ccd382f7003f128508f1018 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 5 May 2023 01:32:18 +0200 Subject: [PATCH 15/32] kpaste: fix public url --- krebs/5pkgs/simple/kpaste/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/kpaste/default.nix b/krebs/5pkgs/simple/kpaste/default.nix index 1c0225af7..de2de4721 100644 --- a/krebs/5pkgs/simple/kpaste/default.nix +++ b/krebs/5pkgs/simple/kpaste/default.nix @@ -2,6 +2,6 @@ writeDashBin "kpaste" '' ${curl}/bin/curl -sS http://p.r --data-binary @"''${1:--}" \ - -H "Content-Type-Override: ''${KPASTE_CONTENT_TYPE-}" + -H "Content-Type-Override: ''${KPASTE_CONTENT_TYPE-}" | ${gnused}/bin/sed '$ {p;s|http://p.r|https://p.krebsco.de|}' '' From d39c0b2d18ea48a824b37d58746151b77451e0e8 Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 5 May 2023 01:50:19 +0200 Subject: [PATCH 16/32] reaktor2: add bing-img --- krebs/2configs/reaktor2.nix | 47 +++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index 0a5031415..de1e01a35 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -90,6 +90,52 @@ let }; }; + bing-img = { + pattern = "!bing-img (.*)$"; + activate = "match"; + arguments = [1]; + timeoutSec = 1337; + command = { + filename = pkgs.writeDash "bing-img" '' + set -efu + report_error() { + printf '%s' "$*" | + curl -Ss http://p.r --data-binary @- | + tail -1 | + echo "error $(cat)" + exit 0 + } + export PATH=${makeBinPath [ + pkgs.dash + pkgs.coreutils + pkgs.curl + pkgs.findutils + pkgs.jq + ]} + response=$(printf '%s' "$*" | + curl -SsG http://bing-gpt.r/api/images --data-urlencode 'prompt@-' + ) + if [ "$?" -ne 0 ]; then + report_error "$response" + else + if ! text=$( + printf '%s' "$response" | + jq -er '.[].url' + ); then + echo "$_from: $(report_error "$response")" + exit 0 + fi + echo "$text" | + xargs -I {} dash -c 'curl -Ss {} | + curl -Ss https://p.krebsco.de --data-binary @- | + tail -1' | + tr '\n' ' ' | + echo "$_from: $(cat)" + fi + ''; + }; + }; + confuse = { pattern = "!confuse (.*)$"; activate = "match"; @@ -362,6 +408,7 @@ let bedger-add bedger-balance bing + bing-img hooks.sed interrogate say From 5c242487a88ecd1b0b84989782568534b65767fe Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 12 May 2023 09:58:26 +0200 Subject: [PATCH 17/32] nixpkgs: 15b7580 -> a08e061 --- krebs/nixpkgs.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/krebs/nixpkgs.json b/krebs/nixpkgs.json index bc350d0d7..4ba72d00d 100644 --- a/krebs/nixpkgs.json +++ b/krebs/nixpkgs.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "15b75800dce80225b44f067c9012b09de37dfad2", - "date": "2023-04-26T21:45:16+02:00", - "path": "/nix/store/5d3a0nazp51ndfgf9dpgyyw14g5i02mh-nixpkgs", - "sha256": "0xmza136qf0hssh2a4dq62w7w1xs6rdfxs314pqxqjvvqibf1qb2", + "rev": "a08e061a4ee8329747d54ddf1566d34c55c895eb", + "date": "2023-05-09T12:11:35+02:00", + "path": "/nix/store/lwy9r49c92ml9mbvp2kx1m31p7bcpzxd-nixpkgs", + "sha256": "1h0yd0xka6wj9sbbq34gw7a9qlp044b7dhg16bmn8bv96ix55vzj", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From 6db3832db5e60838a925916ad095683d7272106f Mon Sep 17 00:00:00 2001 From: lassulus Date: Fri, 12 May 2023 09:58:42 +0200 Subject: [PATCH 18/32] nixpkgs-unstable: d6b863f -> 897876e --- 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 11ac1c6e4..d9e81ad37 100644 --- a/krebs/nixpkgs-unstable.json +++ b/krebs/nixpkgs-unstable.json @@ -1,9 +1,9 @@ { "url": "https://github.com/NixOS/nixpkgs", - "rev": "d6b863fd9b7bb962e6f9fdf292419a775e772891", - "date": "2023-04-26T18:35:28+02:00", - "path": "/nix/store/kyr8hz9d55f9fffr4y8d3hz3zb7h9fhb-nixpkgs", - "sha256": "02rd1n6d453rdp2978bvnp99nyfa26jxgbsg78yb9mmdxvha3hnr", + "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7", + "date": "2023-05-06T22:28:42+01:00", + "path": "/nix/store/55lpvam2wgdmrbzx0j5gf51dqrqn8wqv-nixpkgs", + "sha256": "0i9j45jwmqhiv7v8i4dmigaras3iw4hmrds2vvd5x8riln3hyizn", "fetchLFS": false, "fetchSubmodules": false, "deepClone": false, From df09f8293f326235d417ec750edf05298ba468de Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 14 May 2023 19:56:47 +0200 Subject: [PATCH 19/32] reaktor2 bing: split lines after 426 chars --- krebs/2configs/reaktor2.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/krebs/2configs/reaktor2.nix b/krebs/2configs/reaktor2.nix index de1e01a35..67c2dd4cd 100644 --- a/krebs/2configs/reaktor2.nix +++ b/krebs/2configs/reaktor2.nix @@ -81,7 +81,8 @@ let echo "$_from: $(report_error "$response")" exit 0 fi - printf '%s' "$text" | echo "$_from: $(cat)" + # value seems to be 512 - overhead + echo "$_from: $text" | fold -s -w 426 printf '%s' "$response" | jq -r '[.item.messages[1].sourceAttributions[].seeMoreUrl] | to_entries[] | "[\(.key + 1)]: \(.value)"' From 882bbfd606fd65f36951967a530d914a08f1b9a6 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 15 May 2023 12:07:53 +0200 Subject: [PATCH 20/32] tv gitrepos: add nixpkgs --- tv/2configs/gitrepos.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/2configs/gitrepos.nix b/tv/2configs/gitrepos.nix index eb87f26d1..58dffe6a6 100644 --- a/tv/2configs/gitrepos.nix +++ b/tv/2configs/gitrepos.nix @@ -96,6 +96,9 @@ with import ./lib; nix-writers = { cgit.desc = "collection of package builders"; }; + nixpkgs = { + cgit.desc = "Nix Packages collection"; + }; pager = { }; populate = { From e3c8492f30a2c73acfb43478d8ceb8c38d7fa777 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 15 May 2023 13:31:19 +0200 Subject: [PATCH 21/32] tinc: use DynamicUser --- krebs/3modules/tinc.nix | 37 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 27 deletions(-) diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index 52cdafe67..437f3b633 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -190,35 +190,16 @@ with import ; default = 3; }; - user = mkOption { - type = types.user; - default = { - name = tinc.config.netname; - home = "/var/lib/${tinc.config.user.name}"; - }; - defaultText = { - name = "‹netname›"; - home = "/var/lib/‹netname›"; - }; + username = mkOption { + type = types.username; + default = tinc.config.netname; + defaultText = literalExample "netname"; }; }; })); }; config = { - users.users = mapAttrs' (netname: cfg: - nameValuePair "${netname}" { - inherit (cfg.user) home name uid; - createHome = true; - isSystemUser = true; - group = netname; - } - ) config.krebs.tinc; - - users.groups = mapAttrs' (netname: cfg: - nameValuePair netname {} - ) config.krebs.tinc; - krebs.systemd.services = mapAttrs (netname: cfg: { restartIfCredentialsChange = true; }) config.krebs.tinc; @@ -238,11 +219,11 @@ with import ; ) "rsa_key.priv:${cfg.privkey}" ]; - ExecStartPre = pkgs.writers.writeDash "init-tinc-${netname}" '' + ExecStartPre = "+" + pkgs.writers.writeDash "init-tinc-${netname}" '' set -efu ${pkgs.coreutils}/bin/mkdir -p /etc/tinc ${pkgs.rsync}/bin/rsync -Lacv --delete \ - --chown ${cfg.user.name} \ + --chown ${cfg.username} \ --chmod u=rwX,g=rX \ --exclude='/*.priv' \ ${cfg.confDir}/ /etc/tinc/${netname}/ @@ -255,14 +236,16 @@ with import ; "$CREDENTIALS_DIRECTORY"/rsa_key.priv \ /etc/tinc/${netname}/ ''; - ExecStart = toString [ + ExecStart = "+" + toString [ "${cfg.tincPackage}/sbin/tincd" "-D" - "-U ${cfg.user.name}" + "-U ${cfg.username}" "-d 0" "-n ${netname}" ]; SyslogIdentifier = netname; + DynamicUser = true; + User = cfg.username; }; }) config.krebs.tinc; }; From 2ba6c3c602753f27bec5d5f45107aed26f8d0ab4 Mon Sep 17 00:00:00 2001 From: lassulus Date: Sun, 21 May 2023 14:12:33 +0200 Subject: [PATCH 22/32] 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 23/32] 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 24/32] 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 25/32] 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 26/32] 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 27/32] 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 28/32] 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 29/32] 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 30/32] 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 24b9fc11d6c9345d39a0ec0f97d58cdbdbde7f0c Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 25 May 2023 13:17:57 +0200 Subject: [PATCH 31/32] cunicu: init at g3ed8109 --- krebs/5pkgs/simple/cunicu.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 krebs/5pkgs/simple/cunicu.nix diff --git a/krebs/5pkgs/simple/cunicu.nix b/krebs/5pkgs/simple/cunicu.nix new file mode 100644 index 000000000..4375a760c --- /dev/null +++ b/krebs/5pkgs/simple/cunicu.nix @@ -0,0 +1,22 @@ +{ lib, pkgs }: + +pkgs.buildGo120Module rec { + pname = "cunicu"; + version = "g${lib.substring 0 7 src.rev}"; + + buildInputs = [ + pkgs.libpcap + ]; + + # XXX tries to access https://relay.cunicu.li + doCheck = false; + + src = pkgs.fetchFromGitHub { + owner = "stv0g"; + repo = "cunicu"; + rev = "3ed8109bef97a10a438e5658c41823b7f812db8e"; + hash = "sha256-FpOJ6/jmnbpufc+kgKwlLtFhOcc2CTe+FvqeV8WEGMc="; + }; + + vendorHash = "sha256-eAawhJK9K8/7FCQiYMI9XCPePYsCVF045Di7SpRZvL4="; +} From 7c3b3400b71678617ac042b522c26e747b8312c2 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 29 May 2023 20:03:26 +0200 Subject: [PATCH 32/32] 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 ]; +}