From a8ed13aef988c4dc1c0d86c3c24ea8e6c0e6f9fd Mon Sep 17 00:00:00 2001 From: makefu Date: Tue, 3 Nov 2020 22:59:13 +0100 Subject: [PATCH 01/11] puyak.r,wolf.r: move all services from wolf to puyak --- 2configs/urlwatch/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/2configs/urlwatch/default.nix b/2configs/urlwatch/default.nix index 838c262..5b059a3 100644 --- a/2configs/urlwatch/default.nix +++ b/2configs/urlwatch/default.nix @@ -34,6 +34,7 @@ in { https://pypi.python.org/simple/pyserial/ https://pypi.python.org/simple/semantic_version/ # weird shit + https://www.zigbee2mqtt.io/information/supported_adapters.html http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/ https://erdgeist.org/gitweb/opentracker/info/refs?service=git-upload-pack From e0c9a041afbac40775cfa4a0f82b1433f25cecf3 Mon Sep 17 00:00:00 2001 From: makefu Date: Thu, 5 Nov 2020 10:30:05 +0100 Subject: [PATCH 02/11] ma minimal: keep nscd enabled --- 2configs/minimal.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/2configs/minimal.nix b/2configs/minimal.nix index 78a9dcf..445e6c5 100644 --- a/2configs/minimal.nix +++ b/2configs/minimal.nix @@ -82,5 +82,4 @@ "net.ipv6.conf.default.use_tempaddr" = 2; }; - services.nscd.enable = false; } From 9fb39175d38a0aba7e0e6c6181c45055f7b61b0f Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:22:52 +0100 Subject: [PATCH 03/11] ma omo.r: enable direct connect to gum share --- 1systems/omo/config.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/1systems/omo/config.nix b/1systems/omo/config.nix index dd89b40..cbe97e2 100644 --- a/1systems/omo/config.nix +++ b/1systems/omo/config.nix @@ -47,6 +47,7 @@ in { # + { krebs.airdcpp.dcpp.shares = let d = path: "/media/cryptX/${path}"; From 618105b6e3e189c4ed0a42cebce613a804c0098e Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:31:17 +0100 Subject: [PATCH 04/11] ma bureautomation/kalauerbot: enterprise restart after 12h --- 2configs/bureautomation/kalauerbot.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/2configs/bureautomation/kalauerbot.nix b/2configs/bureautomation/kalauerbot.nix index d61b888..ff045e2 100644 --- a/2configs/bureautomation/kalauerbot.nix +++ b/2configs/bureautomation/kalauerbot.nix @@ -12,6 +12,9 @@ WorkingDirectory = "/var/lib/kalauerbot"; ExecStart = "${pkgs.kalauerbot}/bin/kalauerbot"; PrivateTmp = true; + + Restart = "always"; + RuntimeMaxSec = "12h"; }; }; } From 1f3a3fba166bfd3e49b0c03889a00026cd44ec2f Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:31:58 +0100 Subject: [PATCH 05/11] ma printer: use extraconfig for magicolor, new netconfig for lan devices --- 2configs/printer.nix | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/2configs/printer.nix b/2configs/printer.nix index d297483..6fd1c18 100644 --- a/2configs/printer.nix +++ b/2configs/printer.nix @@ -21,16 +21,20 @@ in { hardware.sane = { enable = true; extraBackends = [ ]; + netConf = + # drucker.lan SCX-3205W + '' + 192.168.1.6'' + # uhrenkind.shack magicolor 1690mf + + '' + 10.42.20.30''; # $ scanimage -p --format=jpg --mode=Gray --source="Automatic Document Feeder" -v --batch="lol%d.jpg" --resolution=150 # requires 'sane-extra', scan via: - #extraConfig."magicolor" = '' - # net 10.42.20.30 0x2098 - #''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf - extraConfig."xerox_mfp" = '' - tcp 192.168.1.5 - ''; #home printer SCX-3205W + extraConfig."magicolor" = '' + net 10.42.20.30 0x2098 + ''; # 10.42.20.30: uhrenkind.shack magicolor 1690mf }; state = [ "/var/lib/cups" ]; } From 4185a02e3b77aa511329ab4884e1c6507031f11c Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:32:27 +0100 Subject: [PATCH 06/11] ma remote-build: enable gum for arm6l cross-build --- 2configs/remote-build/gum.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/2configs/remote-build/gum.nix b/2configs/remote-build/gum.nix index 98e2e58..39e90f1 100644 --- a/2configs/remote-build/gum.nix +++ b/2configs/remote-build/gum.nix @@ -10,6 +10,14 @@ system = "x86_64-linux"; supportedFeatures = [ ]; } + { + hostName = "gum.krebsco.de"; + maxJobs = 8; + sshKey = toString ; + sshUser = "nixBuild"; + system = "armv6l-linux"; + supportedFeatures = [ ]; + } ]; }; } From cd921ac7a839a03a8eb3e2baee27dbee1f0a8a26 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:33:58 +0100 Subject: [PATCH 07/11] ma share/omo: set workgroup and netbios name --- 2configs/share/omo.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/2configs/share/omo.nix b/2configs/share/omo.nix index 732dc20..1a488e6 100644 --- a/2configs/share/omo.nix +++ b/2configs/share/omo.nix @@ -82,6 +82,9 @@ in { printing = bsd printcap name = /dev/null disable spoolss = yes + workgroup = WORKGROUP + server string = ${config.networking.hostName} + netbios name = ${config.networking.hostName} ''; }; } From dc744a6a43fe0c939c0c941e6442e79d86ed294f Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:35:30 +0100 Subject: [PATCH 08/11] ma urlwatch: watch zigbee2mqtt supported adapters --- 2configs/urlwatch/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/2configs/urlwatch/default.nix b/2configs/urlwatch/default.nix index 5b059a3..ecd0371 100644 --- a/2configs/urlwatch/default.nix +++ b/2configs/urlwatch/default.nix @@ -34,7 +34,9 @@ in { https://pypi.python.org/simple/pyserial/ https://pypi.python.org/simple/semantic_version/ # weird shit - https://www.zigbee2mqtt.io/information/supported_adapters.html + { url = "https://www.zigbee2mqtt.io/information/supported_adapters.html"; + filter = "html2text"; + } http://ftp.debian.org/debian/pool/main/a/apt-cacher-ng/ https://erdgeist.org/gitweb/opentracker/info/refs?service=git-upload-pack From c7c4b0580073017a31f19491399fb621dbeb6176 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:36:10 +0100 Subject: [PATCH 09/11] ma wireguard/server: add workaround for failing tunnel behind nat --- 2configs/wireguard/server.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/2configs/wireguard/server.nix b/2configs/wireguard/server.nix index ae10f34..1b81cf5 100644 --- a/2configs/wireguard/server.nix +++ b/2configs/wireguard/server.nix @@ -54,4 +54,10 @@ in { # wireguard server } ]; }; + # TODO: this issue is related to the router which connects to the host but is + # unable to re-connect once restarted + systemd.services.wireguard-wg0.serviceConfig = { + Restart = "always"; + RuntimeMaxSec = "12h"; + }; } From 46cc7f47fa992ff9c323fc813b34d793950e6036 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:37:03 +0100 Subject: [PATCH 10/11] ma pkgs.droidcam: init software + kernel module --- 2configs/hw/droidcam.nix | 7 ++++ 5pkgs/droidcam/default.nix | 55 +++++++++++++++++++++++++++++++ 5pkgs/v4l2loopback-dc/default.nix | 36 ++++++++++++++++++++ 3 files changed, 98 insertions(+) create mode 100644 2configs/hw/droidcam.nix create mode 100644 5pkgs/droidcam/default.nix create mode 100644 5pkgs/v4l2loopback-dc/default.nix diff --git a/2configs/hw/droidcam.nix b/2configs/hw/droidcam.nix new file mode 100644 index 0000000..c638123 --- /dev/null +++ b/2configs/hw/droidcam.nix @@ -0,0 +1,7 @@ +{ pkgs, config, ... }: +{ + boot.extraModprobeConfig = "options v4l2loopback_dc width=640 height=480"; + boot.extraModulePackages = [ + (pkgs.callPackage ../../5pkgs/v4l2loopback-dc { kernel = config.boot.kernelPackages.kernel; }) + ]; +} diff --git a/5pkgs/droidcam/default.nix b/5pkgs/droidcam/default.nix new file mode 100644 index 0000000..d30fb01 --- /dev/null +++ b/5pkgs/droidcam/default.nix @@ -0,0 +1,55 @@ +{ stdenv, fetchFromGitHub +, pkg-config +, alsaLib +, libjpeg_turbo +, ffmpeg +, libusbmuxd +, speex +, gtk3 +, libappindicator-gtk3 +}: + +stdenv.mkDerivation rec { + pname = "droidcam"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "aramg"; + repo = "droidcam"; + rev = "v${version}"; + sha256 = "1d9qpnmqa3pfwsrpjnxdz76ipk4w37bbxyrazchh4vslnfc886fx"; + }; + + sourceRoot = "source/linux"; + + nativeBuildInputs = [ pkg-config ]; + buildInputs = [ + alsaLib + libjpeg_turbo + ffmpeg + libusbmuxd + speex + gtk3 + libappindicator-gtk3 + ]; + + buildPhase = '' + runHook preBuild + make JPEG_DIR="" JPEG_INCLUDE="" JPEG_LIB="" JPEG="$(pkg-config --libs --cflags libturbojpeg)" + ''; + installPhase = '' + runHook preInstall + install -Dm755 "droidcam" "$out/bin/droidcam" + install -Dm755 "droidcam-cli" "$out/bin/droidcam-cli" + install -Dm644 icon2.png "$out/share/pixmaps/droidcam.png" + install -Dm644 README.md "$out/share/licenses/droidcam/LICENSE" + ''; + + meta = with stdenv.lib; { + description = "A kernel module to create V4L2 loopback devices"; + homepage = "https://github.com/aramg/droidcam"; + license = licenses.gpl2; + maintainers = [ maintainers.makefu ]; + platforms = platforms.linux; + }; +} diff --git a/5pkgs/v4l2loopback-dc/default.nix b/5pkgs/v4l2loopback-dc/default.nix new file mode 100644 index 0000000..2bb9d3d --- /dev/null +++ b/5pkgs/v4l2loopback-dc/default.nix @@ -0,0 +1,36 @@ +{ stdenv, fetchFromGitHub, kernel, kmod }: + +stdenv.mkDerivation rec { + name = "v4l2loopback-dc-${version}-${kernel.version}"; + version = "1.6"; + + src = fetchFromGitHub { + owner = "aramg"; + repo = "droidcam"; + rev = "v${version}"; + sha256 = "1d9qpnmqa3pfwsrpjnxdz76ipk4w37bbxyrazchh4vslnfc886fx"; + }; + + sourceRoot = "source/linux/v4l2loopback"; + + buildTargets = "v4l2loopback-dc"; + hardeningDisable = [ "pic" ]; + + nativeBuildInputs = kernel.moduleBuildDependencies; + buildInputs = [ kmod ]; + + + makeFlags = [ + "KERNELRELEASE=${kernel.modDirVersion}" + "KERNEL_DIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" + "INSTALL_MOD_PATH=$(out)" + ]; + + meta = with stdenv.lib; { + description = "A kernel module to create V4L2 loopback devices"; + homepage = "https://github.com/aramg/droidcam"; + license = licenses.gpl2; + maintainers = [ maintainers.makefu ]; + platforms = platforms.linux; + }; +} From a9a49a77e2772afab68f3cf1c2d508547797f928 Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 16 Nov 2020 21:37:51 +0100 Subject: [PATCH 11/11] ma pkgs.kalauerbot: use patched matrix-client --- 5pkgs/kalauerbot/badsync.patch | 14 ++++++++++++++ 5pkgs/kalauerbot/default.nix | 7 ++++++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 5pkgs/kalauerbot/badsync.patch diff --git a/5pkgs/kalauerbot/badsync.patch b/5pkgs/kalauerbot/badsync.patch new file mode 100644 index 0000000..842129b --- /dev/null +++ b/5pkgs/kalauerbot/badsync.patch @@ -0,0 +1,14 @@ +diff --git a/matrix_client/client.py b/matrix_client/client.py +index af0e08f..f848c4f 100644 +--- a/matrix_client/client.py ++++ b/matrix_client/client.py +@@ -471,7 +471,7 @@ class MatrixClient(object): + self._sync(timeout_ms) + + def listen_forever(self, timeout_ms=30000, exception_handler=None, +- bad_sync_timeout=5): ++ bad_sync_timeout=61): + """ Keep listening for events forever. + + Args: + diff --git a/5pkgs/kalauerbot/default.nix b/5pkgs/kalauerbot/default.nix index 2cecbc3..ee90fde 100644 --- a/5pkgs/kalauerbot/default.nix +++ b/5pkgs/kalauerbot/default.nix @@ -8,7 +8,12 @@ rev = "08d98aa"; sha256 = "017hh61smgq4zsxd10brgwmykwgwabgllxjs31xayvs1hnqmkv2v"; }; propagatedBuildInputs = with python3.pkgs;[ - (callPackage ./python-matrixbot.nix {}) + (callPackage ./python-matrixbot.nix { + matrix-client = (stdenv.lib.overrideDerivation matrix-client (self: { + patches = [ ./badsync.patch ]; + })); + }) + (stdenv.lib.overrideDerivation googletrans (self: { patches = [ ./translate.patch ]; }))