From cb796ce05b00bbdc3fc6d4109483f1bd257cc147 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 19 Jan 2023 15:38:56 +0100 Subject: tinc: remove parentheses of fear --- krebs/3modules/tinc.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index f6727e4d4..7154ecdc3 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -128,9 +128,9 @@ with import ; default = pkgs.write "${tinc.config.netname}-tinc-hosts" (mapAttrs' - (_: host: (nameValuePair "/${host.name}" { + (_: host: nameValuePair "/${host.name}" { text = host.nets.${tinc.config.netname}.tinc.config; - })) + }) tinc.config.hosts); defaultText = "‹netname›-tinc-hosts"; description = '' -- cgit v1.2.3 From ef6ddd1de3f39623d3c7bfa8ec4c616ac6b9fae2 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Jan 2023 16:43:21 +0100 Subject: tv firefox: MOZ_USE_XINPUT2=1 when TOUCHSCREEN==1 --- tv/5pkgs/simple/ff.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tv/5pkgs/simple/ff.nix b/tv/5pkgs/simple/ff.nix index 4ce9c3c75..b6022c6ca 100644 --- a/tv/5pkgs/simple/ff.nix +++ b/tv/5pkgs/simple/ff.nix @@ -1,5 +1,8 @@ { pkgs }: pkgs.writeDashBin "ff" '' + case $TOUCHSCREEN in 1) + export MOZ_USE_XINPUT2=1 + esac exec ${pkgs.firefox}/bin/firefox "$@" '' -- cgit v1.2.3 From c8c916ccf1a95f0e755094fd3d24403af91a0b67 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Jan 2023 18:24:47 +0100 Subject: tinc: untangle tincUp and tincUpExtra --- krebs/3modules/tinc.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index 7154ecdc3..4afd0a3a6 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -26,9 +26,9 @@ with import ; Port = ${toString tinc.config.host.nets.${netname}.tinc.port} ${tinc.config.extraConfig} ''; - "tinc-up" = pkgs.writeDash "${netname}-tinc-up" '' - ${tinc.config.iproutePackage}/sbin/ip link set ${netname} up + "tinc-up" = pkgs.writeDash "${netname}-tinc-up" /* sh */ '' ${tinc.config.tincUp} + ${tinc.config.tincUpExtra} ''; }); }; @@ -60,7 +60,8 @@ with import ; default = let net = tinc.config.host.nets.${netname}; iproute = tinc.config.iproutePackage; - in '' + in /* sh */ '' + ${tinc.config.iproutePackage}/sbin/ip link set ${netname} up ${optionalString (net.ip4 != null) /* sh */ '' ${iproute}/sbin/ip -4 addr add ${net.ip4.addr} dev ${netname} ${iproute}/sbin/ip -4 route add ${net.ip4.prefix} dev ${netname} @@ -69,14 +70,13 @@ with import ; ${iproute}/sbin/ip -6 addr add ${net.ip6.addr} dev ${netname} ${iproute}/sbin/ip -6 route add ${net.ip6.prefix} dev ${netname} ''} - ${tinc.config.tincUpExtra} ''; - defaultText = '' - ip -4 addr add ‹net.ip4.addr› dev ${netname} - ip -4 route add ‹net.ip4.prefix› dev ${netname} - ip -6 addr add ‹net.ip6.addr› dev ${netname} - ip -6 route add ‹net.ip6.prefix› dev ${netname} - ${tinc.config.tincUpExtra} + defaultText = /* sh */ '' + ip link set ‹netname› up + ip -4 addr add ‹net.ip4.addr› dev ‹netname› + ip -4 route add ‹net.ip4.prefix› dev ‹netname› + ip -6 addr add ‹net.ip6.addr› dev ‹netname› + ip -6 route add ‹net.ip6.prefix› dev ‹netname› ''; description = '' tinc-up script to be used. Defaults to setting the -- cgit v1.2.3 From ebd22b2d282d3b718f173a243615d954e00254e9 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 23 Jan 2023 18:44:56 +0100 Subject: tinc: drop tincUpExtra --- krebs/3modules/tinc.nix | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/krebs/3modules/tinc.nix b/krebs/3modules/tinc.nix index 4afd0a3a6..52cdafe67 100644 --- a/krebs/3modules/tinc.nix +++ b/krebs/3modules/tinc.nix @@ -26,10 +26,7 @@ with import ; Port = ${toString tinc.config.host.nets.${netname}.tinc.port} ${tinc.config.extraConfig} ''; - "tinc-up" = pkgs.writeDash "${netname}-tinc-up" /* sh */ '' - ${tinc.config.tincUp} - ${tinc.config.tincUpExtra} - ''; + "tinc-up" = pkgs.writeDash "${netname}-tinc-up" tinc.config.tincUp; }); }; @@ -85,11 +82,6 @@ with import ; ''; }; - tincUpExtra = mkOption { - type = types.str; - default = ""; - }; - tincPackage = mkOption { type = types.package; default = pkgs.tinc_pre; -- cgit v1.2.3 From ef83faadee9c5c77eb1651c8ff57bf795a888e00 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 24 Jan 2023 13:42:24 +0100 Subject: tv iosevka-tv-1: allow using prebuilt font --- tv/5pkgs/override/iosevka-tv-1.nix | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tv/5pkgs/override/iosevka-tv-1.nix diff --git a/tv/5pkgs/override/iosevka-tv-1.nix b/tv/5pkgs/override/iosevka-tv-1.nix new file mode 100644 index 000000000..3b3df6e0f --- /dev/null +++ b/tv/5pkgs/override/iosevka-tv-1.nix @@ -0,0 +1,26 @@ +self: super: + +let + prebuilt = + self.stdenv.mkDerivation rec { + pname = "iosevka-tv-1"; + version = "15.6.3"; + src = self.fetchurl { + urls = [ + "https://c.krebsco.de/iosevka-tv-1-${version}.tar.gz" + "https://ni.krebsco.de/~tv/mirrors/iosevka/iosevka-tv-1-${version}.tar.gz" + ]; + sha256 = "0shsvlb1cmn39l33nzd5bj8g0h9jg7rdq8hvlac8qvnzfhpi5s6k"; + }; + installPhase = '' + mkdir -p $out/share/fonts/truetype + mv -v *.ttf $out/share/fonts/truetype + ''; + }; +in + +if super.iosevka.version == prebuilt.version then + prebuilt + +else + super.iosevka -- cgit v1.2.3 From 4f4b6978d5ffb6c216ec5356d6b9f001242a6e96 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Jan 2023 15:00:21 +0100 Subject: tv ru: add wiregrill pubkey --- kartei/tv/wiregrill/ru.pub | 1 + 1 file changed, 1 insertion(+) create mode 100644 kartei/tv/wiregrill/ru.pub diff --git a/kartei/tv/wiregrill/ru.pub b/kartei/tv/wiregrill/ru.pub new file mode 100644 index 000000000..4a997c968 --- /dev/null +++ b/kartei/tv/wiregrill/ru.pub @@ -0,0 +1 @@ ++3GdhwFYmBr46bBwyqrY3UH9fU1b8c2Vqmx9JTY4syU= -- cgit v1.2.3 From 7efaf1e45f47b63fd585b07ced559ca529c6a6e7 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 25 Jan 2023 19:19:04 +0100 Subject: flameshot: move override to tv --- krebs/5pkgs/override/default.nix | 14 --------- .../flameshot/flameshot_imgur_0.10.2.patch | 35 ---------------------- tv/5pkgs/override/flameshot/default.nix | 15 ++++++++++ .../flameshot/flameshot_imgur_0.10.2.patch | 35 ++++++++++++++++++++++ 4 files changed, 50 insertions(+), 49 deletions(-) delete mode 100644 krebs/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch create mode 100644 tv/5pkgs/override/flameshot/default.nix create mode 100644 tv/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch diff --git a/krebs/5pkgs/override/default.nix b/krebs/5pkgs/override/default.nix index ae42bc1a3..f85f3f678 100644 --- a/krebs/5pkgs/override/default.nix +++ b/krebs/5pkgs/override/default.nix @@ -9,20 +9,6 @@ self: super: { }; }); - flameshot = super.flameshot.overrideAttrs (old: rec { - name = "flameshot-${version}"; - version = "0.10.2"; - src = self.fetchFromGitHub { - owner = "flameshot-org"; - repo = "flameshot"; - rev = "v${version}"; - sha256 = "sha256-rZUiaS32C77tFJmEkw/9MGbVTVscb6LOCyWaWO5FyR4="; - }; - patches = old.patches or [] ++ [ - ./flameshot/flameshot_imgur_0.10.2.patch - ]; - }); - # https://github.com/proot-me/PRoot/issues/106 proot = self.writeDashBin "proot" '' export PROOT_NO_SECCOMP=1 diff --git a/krebs/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch b/krebs/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch deleted file mode 100644 index c4c0bf38a..000000000 --- a/krebs/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch +++ /dev/null @@ -1,35 +0,0 @@ ---- a/src/tools/imgur/imguruploader.cpp -+++ b/src/tools/imgur/imguruploader.cpp -@@ -31,6 +31,7 @@ - #include - #include - #include -+#include - - ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) - : QWidget(parent) -@@ -79,8 +80,11 @@ void ImgurUploader::handleReply(QNetworkReply* reply) - m_imageURL.setUrl(data[QStringLiteral("link")].toString()); - - auto deleteToken = data[QStringLiteral("deletehash")].toString(); -+ char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL"); -+ if (deleteImageURLPattern == NULL) -+ deleteImageURLPattern = "https://imgur.com/delete/%1"; - m_deleteImageURL.setUrl( -- QStringLiteral("https://imgur.com/delete/%1").arg(deleteToken)); -+ QString::fromUtf8(deleteImageURLPattern).arg(deleteToken)); - - // save history - QString imageName = m_imageURL.toString(); -@@ -133,7 +137,10 @@ void ImgurUploader::upload() - QString description = FileNameHandler().parsedPattern(); - urlQuery.addQueryItem(QStringLiteral("description"), description); - -- QUrl url(QStringLiteral("https://api.imgur.com/3/image")); -+ char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL"); -+ if (createImageURLPattern == NULL) -+ createImageURLPattern = "https://api.imgur.com/3/image"; -+ QUrl url(QString::fromUtf8(createImageURLPattern)); - url.setQuery(urlQuery); - QNetworkRequest request(url); - request.setHeader(QNetworkRequest::ContentTypeHeader, diff --git a/tv/5pkgs/override/flameshot/default.nix b/tv/5pkgs/override/flameshot/default.nix new file mode 100644 index 000000000..2f7c5236b --- /dev/null +++ b/tv/5pkgs/override/flameshot/default.nix @@ -0,0 +1,15 @@ +self: super: + +super.flameshot.overrideAttrs (old: rec { + name = "flameshot-${version}"; + version = "0.10.2"; + src = self.fetchFromGitHub { + owner = "flameshot-org"; + repo = "flameshot"; + rev = "v${version}"; + sha256 = "sha256-rZUiaS32C77tFJmEkw/9MGbVTVscb6LOCyWaWO5FyR4="; + }; + patches = old.patches or [] ++ [ + ./flameshot/flameshot_imgur_0.10.2.patch + ]; +}) diff --git a/tv/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch b/tv/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch new file mode 100644 index 000000000..c4c0bf38a --- /dev/null +++ b/tv/5pkgs/override/flameshot/flameshot_imgur_0.10.2.patch @@ -0,0 +1,35 @@ +--- a/src/tools/imgur/imguruploader.cpp ++++ b/src/tools/imgur/imguruploader.cpp +@@ -31,6 +31,7 @@ + #include + #include + #include ++#include + + ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) + : QWidget(parent) +@@ -79,8 +80,11 @@ void ImgurUploader::handleReply(QNetworkReply* reply) + m_imageURL.setUrl(data[QStringLiteral("link")].toString()); + + auto deleteToken = data[QStringLiteral("deletehash")].toString(); ++ char *deleteImageURLPattern = secure_getenv("IMGUR_DELETE_URL"); ++ if (deleteImageURLPattern == NULL) ++ deleteImageURLPattern = "https://imgur.com/delete/%1"; + m_deleteImageURL.setUrl( +- QStringLiteral("https://imgur.com/delete/%1").arg(deleteToken)); ++ QString::fromUtf8(deleteImageURLPattern).arg(deleteToken)); + + // save history + QString imageName = m_imageURL.toString(); +@@ -133,7 +137,10 @@ void ImgurUploader::upload() + QString description = FileNameHandler().parsedPattern(); + urlQuery.addQueryItem(QStringLiteral("description"), description); + +- QUrl url(QStringLiteral("https://api.imgur.com/3/image")); ++ char *createImageURLPattern = secure_getenv("IMGUR_CREATE_URL"); ++ if (createImageURLPattern == NULL) ++ createImageURLPattern = "https://api.imgur.com/3/image"; ++ QUrl url(QString::fromUtf8(createImageURLPattern)); + url.setQuery(urlQuery); + QNetworkRequest request(url); + request.setHeader(QNetworkRequest::ContentTypeHeader, -- cgit v1.2.3 From dae5ba6c304ecd2fa0c442d635ddddf814881054 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 Jan 2023 14:39:47 +0100 Subject: tv winmax2: enable smartd --- tv/2configs/hw/winmax2.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix index 0a207f231..a61119a85 100644 --- a/tv/2configs/hw/winmax2.nix +++ b/tv/2configs/hw/winmax2.nix @@ -1,4 +1,9 @@ { pkgs, ... }: { + + imports = [ + ../smartd.nix + ]; + boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ]; boot.initrd.kernelModules = [ "amdgpu" ]; boot.kernelModules = [ "kvm-amd" ]; -- cgit v1.2.3 From c9da4d8358646425c01dfb82eb0c3e8d7ae3a0d1 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 Jan 2023 14:40:04 +0100 Subject: tv winmax2: enable bluetooth --- tv/2configs/hw/winmax2.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix index a61119a85..fe4a6e4c5 100644 --- a/tv/2configs/hw/winmax2.nix +++ b/tv/2configs/hw/winmax2.nix @@ -8,6 +8,8 @@ boot.initrd.kernelModules = [ "amdgpu" ]; boot.kernelModules = [ "kvm-amd" ]; + hardware.bluetooth.enable = true; + hardware.cpu.amd.updateMicrocode = true; hardware.enableRedistributableFirmware = true; -- cgit v1.2.3 From 57264b76503386e086cc4bb4d5f138bb2cb94856 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 26 Jan 2023 14:40:40 +0100 Subject: tv winmax2: prevent logind from handling powerkey --- tv/2configs/hw/winmax2.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix index fe4a6e4c5..b52ab0fa5 100644 --- a/tv/2configs/hw/winmax2.nix +++ b/tv/2configs/hw/winmax2.nix @@ -32,6 +32,10 @@ services.illum.enable = true; + services.logind.extraConfig = /* ini */ '' + HandlePowerKey=ignore + ''; + tv.lidControl.enable = true; tv.hw.screens.primary.width = 2560; -- cgit v1.2.3 From 1499d5c3934e873041069d6b84bb4704beb83ead Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 13:08:31 +0100 Subject: tv iosevka 1: streamline package --- tv/5pkgs/override/iosevka-tv-1.nix | 8 ++++---- tv/5pkgs/simple/alacritty-tv.nix | 8 ++++---- tv/5pkgs/simple/iosevka-tv-1.nix | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tv/5pkgs/override/iosevka-tv-1.nix b/tv/5pkgs/override/iosevka-tv-1.nix index 3b3df6e0f..99b82d514 100644 --- a/tv/5pkgs/override/iosevka-tv-1.nix +++ b/tv/5pkgs/override/iosevka-tv-1.nix @@ -10,11 +10,11 @@ let "https://c.krebsco.de/iosevka-tv-1-${version}.tar.gz" "https://ni.krebsco.de/~tv/mirrors/iosevka/iosevka-tv-1-${version}.tar.gz" ]; - sha256 = "0shsvlb1cmn39l33nzd5bj8g0h9jg7rdq8hvlac8qvnzfhpi5s6k"; + hash = "sha256-88OfNUbuNbGx3hFzYZ+gAYgOWZ+A8IYo45I1n/qOyhM="; }; installPhase = '' - mkdir -p $out/share/fonts/truetype - mv -v *.ttf $out/share/fonts/truetype + mkdir $out + mv * $out/ ''; }; in @@ -23,4 +23,4 @@ if super.iosevka.version == prebuilt.version then prebuilt else - super.iosevka + super.iosevka-tv-1 diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 1c7730a71..6c2f49db0 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -53,10 +53,10 @@ let window.dimensions.lines = 9; }; variants.hidpi = { - font.normal.family = "iosevka-tv-1"; - font.bold.family = "iosevka-tv-1"; - font.italic.family = "iosevka-tv-1"; - font.bold_italic.family = "iosevka-tv-1"; + font.normal.family = "iosevka tv 1"; + font.bold.family = "iosevka tv 1"; + font.italic.family = "iosevka tv 1"; + font.bold_italic.family = "iosevka tv 1"; font.size = 5; key_bindings = [ { key = "Up"; mods = "Control"; action = "IncreaseFontSize"; } diff --git a/tv/5pkgs/simple/iosevka-tv-1.nix b/tv/5pkgs/simple/iosevka-tv-1.nix index f72565bc7..0f8b4d4b2 100644 --- a/tv/5pkgs/simple/iosevka-tv-1.nix +++ b/tv/5pkgs/simple/iosevka-tv-1.nix @@ -3,7 +3,7 @@ pkgs.iosevka.override { # https://typeof.net/Iosevka/customizer privateBuildPlan = { - family = "iosevka-tv-1"; + family = "iosevka tv 1"; spacing = "term"; serifs = "sans"; export-glyph-names = true; @@ -14,5 +14,5 @@ pkgs.iosevka.override { widths.normal.menu = 5; widths.normal.css = "normal"; }; - set = "iosevka-tv-1"; + set = "tv-1"; } -- cgit v1.2.3 From 09c1d8ce2eef60835b48b6f9826467860edfad86 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 13:10:35 +0100 Subject: tv iosevka 2: init at 15.6.3 --- tv/5pkgs/override/iosevka-tv-2.nix | 26 ++++++++++++++++++++++++++ tv/5pkgs/simple/iosevka-tv-2.nix | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 tv/5pkgs/override/iosevka-tv-2.nix create mode 100644 tv/5pkgs/simple/iosevka-tv-2.nix diff --git a/tv/5pkgs/override/iosevka-tv-2.nix b/tv/5pkgs/override/iosevka-tv-2.nix new file mode 100644 index 000000000..e4702f06c --- /dev/null +++ b/tv/5pkgs/override/iosevka-tv-2.nix @@ -0,0 +1,26 @@ +self: super: + +let + prebuilt = + self.stdenv.mkDerivation rec { + pname = "iosevka-tv-2"; + version = "15.6.3"; + src = self.fetchurl { + urls = [ + "https://c.krebsco.de/iosevka-tv-2-${version}.tar.gz" + "https://ni.krebsco.de/~tv/mirrors/iosevka/iosevka-tv-2-${version}.tar.gz" + ]; + hash = "sha256-W2bOlM0dYKAt+k2OpNJsNx6/hWEItJ2Tob8thtJJ1BA="; + }; + installPhase = '' + mkdir $out + mv * $out/ + ''; + }; +in + +if super.iosevka.version == prebuilt.version then + prebuilt + +else + super.iosevka-tv-2 diff --git a/tv/5pkgs/simple/iosevka-tv-2.nix b/tv/5pkgs/simple/iosevka-tv-2.nix new file mode 100644 index 000000000..888ba6a0c --- /dev/null +++ b/tv/5pkgs/simple/iosevka-tv-2.nix @@ -0,0 +1,20 @@ +{ pkgs }: + +pkgs.iosevka.override { + # https://typeof.net/Iosevka/customizer + privateBuildPlan = { + family = "iosevka tv 2"; + spacing = "term"; + serifs = "sans"; + export-glyph-names = true; + no-ligation = true; + no-cv-ss = false; + + variants.inherits = "ss10"; + + widths.normal.shape = 600; + widths.normal.menu = 5; + widths.normal.css = "normal"; + }; + set = "tv-2"; +} -- cgit v1.2.3 From 6a5b4c73b0655c38f0b6abc6550b2b3cdffc121b Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 13:48:18 +0100 Subject: tv modules: import all Nix dir entries --- tv/3modules/default.nix | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/tv/3modules/default.nix b/tv/3modules/default.nix index 8c1066b71..1a0971ec6 100644 --- a/tv/3modules/default.nix +++ b/tv/3modules/default.nix @@ -1,19 +1,8 @@ +with import ./lib; { - imports = [ - ./charybdis - ./dnsmasq.nix - ./ejabberd - ./focus.nix - ./hosts.nix - ./hw.nix - ./im.nix - ./iptables.nix - ./lidControl.nix - ./org.freedesktop.machine1.host-shell.nix - ./systemd.nix - ./slock.nix - ./x0vncserver.nix - ./Xresources.nix - ./wwan.nix - ]; + imports = + map + (name: ./. + "/${name}") + (attrNames + (filterAttrs isNixDirEntry (readDir ./.))); } -- cgit v1.2.3 From 08009331800e7fa9c1ac1fae8711750bab1ed950 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 16:17:22 +0100 Subject: tv iosevka: use fetchzip --- tv/5pkgs/override/iosevka-tv-1.nix | 32 +++++++++++++------------------- tv/5pkgs/override/iosevka-tv-2.nix | 32 +++++++++++++------------------- 2 files changed, 26 insertions(+), 38 deletions(-) diff --git a/tv/5pkgs/override/iosevka-tv-1.nix b/tv/5pkgs/override/iosevka-tv-1.nix index 99b82d514..880160b3e 100644 --- a/tv/5pkgs/override/iosevka-tv-1.nix +++ b/tv/5pkgs/override/iosevka-tv-1.nix @@ -1,26 +1,20 @@ self: super: let - prebuilt = - self.stdenv.mkDerivation rec { - pname = "iosevka-tv-1"; - version = "15.6.3"; - src = self.fetchurl { - urls = [ - "https://c.krebsco.de/iosevka-tv-1-${version}.tar.gz" - "https://ni.krebsco.de/~tv/mirrors/iosevka/iosevka-tv-1-${version}.tar.gz" - ]; - hash = "sha256-88OfNUbuNbGx3hFzYZ+gAYgOWZ+A8IYo45I1n/qOyhM="; - }; - installPhase = '' - mkdir $out - mv * $out/ - ''; - }; + srcpkg = super.iosevka-tv-1; + binpkg = self.fetchzip { + inherit (srcpkg) pname version; + stripRoot = false; + hash = "sha256-QIuTS70vUQSvDDXjY4uI6SCcu1XT4HjvzpthvrNX4h0="; + urls = [ + "https://c.krebsco.de/${srcpkg.name}.tar.gz" + "https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz" + ]; + }; in -if super.iosevka.version == prebuilt.version then - prebuilt +if srcpkg.version == binpkg.version then + binpkg else - super.iosevka-tv-1 + srcpkg diff --git a/tv/5pkgs/override/iosevka-tv-2.nix b/tv/5pkgs/override/iosevka-tv-2.nix index e4702f06c..2eecf3cff 100644 --- a/tv/5pkgs/override/iosevka-tv-2.nix +++ b/tv/5pkgs/override/iosevka-tv-2.nix @@ -1,26 +1,20 @@ self: super: let - prebuilt = - self.stdenv.mkDerivation rec { - pname = "iosevka-tv-2"; - version = "15.6.3"; - src = self.fetchurl { - urls = [ - "https://c.krebsco.de/iosevka-tv-2-${version}.tar.gz" - "https://ni.krebsco.de/~tv/mirrors/iosevka/iosevka-tv-2-${version}.tar.gz" - ]; - hash = "sha256-W2bOlM0dYKAt+k2OpNJsNx6/hWEItJ2Tob8thtJJ1BA="; - }; - installPhase = '' - mkdir $out - mv * $out/ - ''; - }; + srcpkg = super.iosevka-tv-2; + binpkg = self.fetchzip { + inherit (srcpkg) pname version; + stripRoot = false; + hash = "sha256-PuIrW1ftYD5PW4du6gq1XpUM3v0potwmj+vAxJImF/A="; + urls = [ + "https://c.krebsco.de/${srcpkg.name}.tar.gz" + "https://ni.krebsco.de/~tv/mirrors/iosevka/${srcpkg.name}.tar.gz" + ]; + }; in -if super.iosevka.version == prebuilt.version then - prebuilt +if srcpkg.version == binpkg.version then + binpkg else - super.iosevka-tv-2 + srcpkg -- cgit v1.2.3 From f58675052f46c1b2bbc4f0efb3db07b2d18849be Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 27 Jan 2023 18:54:27 +0100 Subject: tv xmonad: paste primary with Shift+F12 --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index eb61bd5cf..931f62902 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -196,6 +196,8 @@ myKeys font conf = Map.fromList $ , ((0, xF86XK_AudioMicMute), audioMicMute) , ((_4, xF86XK_AudioMute), pavucontrol []) + , ((_S, xK_F12), forkFile {-pkg-}"xdotool" ["click", "2"] Nothing) + , ((_4, xK_Prior), forkFile {-pkg-}"xcalib" ["-invert", "-alter"] Nothing) , ((0, xK_Print), forkFile {-pkg-}"flameshot" [] Nothing) -- cgit v1.2.3 From 726ba0de3422e8137c3b51bfbbff88fafaef2a8b Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Fri, 27 Jan 2023 13:23:53 +0100 Subject: update palos retiolum entries --- kartei/palo/default.nix | 56 +++++-------------------------------------------- 1 file changed, 5 insertions(+), 51 deletions(-) diff --git a/kartei/palo/default.nix b/kartei/palo/default.nix index 4caf41f87..9d35c3808 100644 --- a/kartei/palo/default.nix +++ b/kartei/palo/default.nix @@ -1,5 +1,6 @@ with import ../../lib; -{ config, ... }: let +{ config, ... }: +let hostDefaults = hostName: host: flip recursiveUpdate host ({ ci = false; @@ -13,62 +14,15 @@ with import ../../lib; (krebs.genipv6 "wiregrill" "external" { inherit hostName; }).address; }); -in { +in +{ hosts = mapAttrs hostDefaults { - pepe = { - owner = config.krebs.users.palo; - nets = { - retiolum = { - ip4.addr = "10.243.23.1"; - tinc.port = 720; - aliases = [ "pepe.r" ]; - tinc.pubkey = builtins.readFile ./retiolum.pub; - }; - }; - }; - schasch = { - owner = config.krebs.users.palo; - nets = { - retiolum = { - ip4.addr = "10.243.23.2"; - tinc.port = 720; - aliases = [ "schasch.r" ]; - tinc.pubkey = builtins.readFile ./retiolum.pub; - }; - }; - syncthing.id = "FLY7DHI-TJLEQBJ-JZNC4YV-NBX53Z2-ZBRWADL-BKSFXYZ-L4FMDVH-MOSEVAQ"; - }; sterni = { owner = config.krebs.users.palo; nets = { retiolum = { - ip4.addr = "10.243.23.3"; - tinc.port = 720; - aliases = [ - "sterni.r" - ]; - tinc.pubkey = builtins.readFile ./retiolum.pub; - }; - }; - }; - workhorse = { - owner = config.krebs.users.palo; - nets = { - retiolum = { - ip4.addr = "10.243.23.5"; - tinc.port = 720; - aliases = [ "workhorse.r" ]; - tinc.pubkey = builtins.readFile ./retiolum.pub; - }; - }; - }; - workout = { - owner = config.krebs.users.palo; - nets = { - retiolum = { - ip4.addr = "10.243.23.4"; tinc.port = 720; - aliases = [ "workout.r" ]; + aliases = [ "sterni.r" ]; tinc.pubkey = builtins.readFile ./retiolum.pub; }; }; -- cgit v1.2.3 From b9cdcc75a4f54356b35c7d7b3e25e8ec28de633c Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 12:05:10 +0100 Subject: tv wwan: flush addrs on stop --- tv/3modules/wwan.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/tv/3modules/wwan.nix b/tv/3modules/wwan.nix index 03cd512e4..382f5a535 100644 --- a/tv/3modules/wwan.nix +++ b/tv/3modules/wwan.nix @@ -166,6 +166,7 @@ with import ./lib; interface=$(get-interface) + ip addr flush "$interface" ip link set dev "$interface" down uqmi --stop-network 0xFFFFFFFF --autoconnect uqmi --sync -- cgit v1.2.3 From 1766ee46bbf72b228894ce42c30e3bc655b7c449 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 12:10:13 +0100 Subject: q-power_supply: printBar using RGB --- krebs/5pkgs/simple/q-power_supply.nix | 43 ++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/krebs/5pkgs/simple/q-power_supply.nix b/krebs/5pkgs/simple/q-power_supply.nix index 87f900194..4d6774846 100644 --- a/krebs/5pkgs/simple/q-power_supply.nix +++ b/krebs/5pkgs/simple/q-power_supply.nix @@ -24,24 +24,41 @@ writeDashBin "q-power_supply" '' return sprintf("%dh%dm", h, m) } - function print_bar(n, r, t1, t2, t_col) { - t1 = int(r * n) - t2 = n - t1 - if (r >= .42) t_col = "1;32" - else if (r >= 23) t_col = "1;33" - else if (r >= 11) t_col = "1;31" - else t_col = "5;1;31" - return sgr(t_col) strdup("■", t1) sgr(";30") strdup("■", t2) sgr() + function print_bar(r) { + return \ + (r >= .1 ? bar_gradient[0] : bar_background) "■" \ + (r >= .2 ? bar_gradient[1] : bar_background) "■" \ + (r >= .3 ? bar_gradient[2] : bar_background) "■" \ + (r >= .4 ? bar_gradient[3] : bar_background) "■" \ + (r >= .5 ? bar_gradient[4] : bar_background) "■" \ + (r >= .6 ? bar_gradient[5] : bar_background) "■" \ + (r >= .7 ? bar_gradient[6] : bar_background) "■" \ + (r >= .8 ? bar_gradient[7] : bar_background) "■" \ + (r >= .9 ? bar_gradient[8] : bar_background) "■" \ + (r >= 1 ? bar_gradient[9] : bar_background) "■" \ + sgr() + } + + function rgb(r, g, b) { + return sgr("38;2;" r ";" g ";" b) } function sgr(p) { return "\x1b[" p "m" } - function strdup(s,n,t) { - t = sprintf("%"n"s","") - gsub(/ /,s,t) - return t + BEGIN { + bar_gradient[0] = rgb(216, 100, 83) + bar_gradient[1] = rgb(210, 113, 72) + bar_gradient[2] = rgb(201, 125, 65) + bar_gradient[3] = rgb(190, 137, 63) + bar_gradient[4] = rgb(178, 148, 67) + bar_gradient[5] = rgb(166, 158, 75) + bar_gradient[6] = rgb(153, 167, 88) + bar_gradient[7] = rgb(140, 174, 104) + bar_gradient[8] = rgb(127, 181, 122) + bar_gradient[9] = rgb(116, 187, 141) + bar_background = rgb( 64, 64, 64) } END { @@ -101,7 +118,7 @@ writeDashBin "q-power_supply" '' charge_ratio = charge_now / charge_full out = out name - out = out sprintf(" %s", print_bar(10, charge_ratio)) + out = out sprintf(" %s", print_bar(charge_ratio)) out = out sprintf(" %d%", charge_ratio * 100) out = out sprintf(" %.2f%s", charge_now, charge_unit) if (current_now != 0) { -- cgit v1.2.3 From 895206d5c319418120f924db2fdaaaf188a66223 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:11:55 +0100 Subject: tv q: simplify calendar --- tv/5pkgs/simple/q/default.nix | 65 +++++++++++++------------------------------ 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index 2ae71db52..eb8462d57 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -10,53 +10,28 @@ let hspace = 2; # Return number of columns required to print n calenders side by side. - need_width = n: - assert n >= 1; - n * calwidth + (n - 1) * hspace; - - pad = /* sh */ ''{ - ${pkgs.gnused}/bin/sed ' - # rtrim - s/ *$// - - # delete last empty line - ''${/^$/d} - ' \ - | ${pkgs.gawk}/bin/awk '{printf "%-${toString calwidth}s\n", $0}' \ - | ${pkgs.gnused}/bin/sed ' - # colorize header - 1,2s/.*/&/ - - # colorize week number - s/^[ 1-9][0-9]/&/ - ' - }''; + need_width = n: assert n >= 1; n * calwidth + (n - 1) * hspace; + in /* sh */ '' cols=$(${pkgs.ncurses}/bin/tput cols) - ${pkgs.coreutils}/bin/paste \ - <(if test $cols -ge ${toString (need_width 3)}; then - ${pkgs.utillinux}/bin/cal -mw \ - $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'last month') \ - | ${pad} - fi) \ - <(if test $cols -ge ${toString (need_width 1)}; then - ${pkgs.utillinux}/bin/cal -mw \ - | ${pkgs.gnused}/bin/sed ' - # colorize day of month - s/\(^\| \)'"$(${pkgs.coreutils}/bin/date +%e)"'\>/&/ - ' \ - | ${pad} - fi) \ - <(if test $cols -ge ${toString (need_width 2)}; then - ${pkgs.utillinux}/bin/cal -mw \ - $(${pkgs.coreutils}/bin/date +'%m %Y' -d 'next month') \ - | ${pad} - fi) \ - | ${pkgs.gnused}/bin/sed ' - s/^\t// - s/\t$// - s/\t/${lpad hspace " " ""}/g - ' + if test $cols -ge ${toString (need_width 3)}; then + ${pkgs.utillinux}/bin/cal --color=always -mw3 + elif test $cols -ge ${toString (need_width 2)}; then + ${pkgs.utillinux}/bin/cal --color=always -mw -n 2 + elif test $cols -ge ${toString (need_width 1)}; then + ${pkgs.utillinux}/bin/cal --color=always -mw1 + else + : + fi | + ${pkgs.gnused}/bin/sed -r ' + # dim week numbers + s/((^ *| )[ 1-5][0-9]( *)?)(([ 1-3][0-9])*)/\1\4/g + # dim month and day names + s/^ *[A-Z].*/&/ + # highlight current date + s/\[7m// + s/\[27m// + ' ''; q-isodate = /* sh */ '' -- cgit v1.2.3 From bfa64c08ae82c609cde9791491bc0cc4d3dec929 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:13:19 +0100 Subject: tv q: streamline dates and use RGB --- tv/5pkgs/simple/q/default.nix | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index eb8462d57..a7a149ddc 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -34,22 +34,20 @@ let ' ''; - q-isodate = /* sh */ '' + q-isodate = TZ: color: /* sh */ '' + TZ=${shell.escape TZ} \ ${pkgs.coreutils}/bin/date \ - '+%Y-%m-%dT%H:%M:%S%:z' + '+%Y-%m-%dT[;'${shell.escape color}'m%H:%M:%S%:z' ''; + q-deudate = q-isodate "Europe/Berlin" "38;5;085"; + # Singapore's red is #ED2E38 - q-sgtdate = /* sh */ '' - TZ=Asia/Singapore \ - ${pkgs.coreutils}/bin/date \ - '+%Y-%m-%dT%H:%M:%S%:z' - ''; + q-sgtdate = q-isodate "Asia/Singapore" "38;2;237;46;56"; - q-utcdate = /* sh */ '' - ${pkgs.coreutils}/bin/date -u \ - '+%Y-%m-%dT%H:%M:%S%:z' - ''; + q-thadate = q-isodate "Asia/Bangkok" "38;5;226"; + + q-utcdate = q-isodate "UTC" "38;5;065"; q-gitdir = /* sh */ '' if test -d .git; then @@ -148,7 +146,7 @@ pkgs.writeBashBin "q" '' export PATH=/var/empty ${q-cal} ${q-utcdate} - ${q-isodate} + ${q-deudate} ${q-sgtdate} (${q-gitdir}) & (${q-intel_backlight}) & -- cgit v1.2.3 From f5acf82913c470a73f0dd37fa826289d58663c37 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:14:04 +0100 Subject: tv q: replace wireless/online by net --- tv/5pkgs/simple/q/default.nix | 50 ++++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/tv/5pkgs/simple/q/default.nix b/tv/5pkgs/simple/q/default.nix index a7a149ddc..809e37e59 100644 --- a/tv/5pkgs/simple/q/default.nix +++ b/tv/5pkgs/simple/q/default.nix @@ -79,31 +79,34 @@ let echo "VT: $(${pkgs.systemd}/bin/systemd-detect-virt)" ''; - q-wireless = /* sh */ '' + q-net = /* sh */ '' for dev in $( - ${pkgs.iw}/bin/iw dev \ - | ${pkgs.gnused}/bin/sed -n 's/^\s*Interface\s\+\([0-9a-z]\+\)$/\1/p' + ${pkgs.iproute}/bin/ip a | + ${pkgs.gnused}/bin/sed -rn 's/^[0-9]+: ([^:]+):.*/\1/p' | + ${pkgs.gnugrep}/bin/grep -Ev '^(lo|retiolum|wiregrill)$' + # TODO wiregrill ping ni.w, retiolum ping ni.r ); do - inet=$(${pkgs.iproute}/bin/ip addr show $dev \ - | ${pkgs.gnused}/bin/sed -n ' - s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p - ') \ - || unset inet - ssid=$(${pkgs.iw}/bin/iw dev $dev link \ - | ${pkgs.gnused}/bin/sed -n ' - s/.*\tSSID: \(.*\)/\1/p - ') \ - || unset ssid - echo "$dev''${inet+ $inet}''${ssid+ $ssid}" + { + inet=$(${pkgs.iproute}/bin/ip addr show $dev \ + | ${pkgs.gnused}/bin/sed -n ' + s/.*inet \([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p + ') + ssid=$(${pkgs.iw}/bin/iw dev $dev link \ + | ${pkgs.gnused}/bin/sed -n ' + s/.*\tSSID: \(.*\)/\1/p + ') + latency=$( + /run/wrappers/bin/ping -W .25 -c 1 -I "$dev" ni.i 2>&1 | + ${pkgs.gnused}/bin/sed -rn ' + s/.*time=([0-9.]+).*/online ni=\1/p + s/.*Network is unreachable.*/offline/p + s/.*100% packet loss.*/offline/p + ' + ) + echo "$dev''${inet:+ $inet}''${ssid:+ $ssid} $latency" + } & done - ''; - - q-online = /* sh */ '' - if ${pkgs.curl}/bin/curl -s google.com >/dev/null; then - echo 'online' - else - echo offline - fi + wait ''; q-thermal_zone = /* sh */ '' @@ -152,8 +155,7 @@ pkgs.writeBashBin "q" '' (${q-intel_backlight}) & ${pkgs.q-power_supply}/bin/q-power_supply & (${q-virtualization}) & - (${q-wireless}) & - (${q-online}) & + (${q-net}) & (${q-thermal_zone}) & wait if test "$PWD" != "$HOME" && test -e "$HOME/TODO"; then -- cgit v1.2.3 From fe34f42c999eb1192b8161e9e6a9f637eaf30361 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:30:40 +0100 Subject: tv alacritty: use iosevka tv 2 --- tv/5pkgs/simple/alacritty-tv.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index 6c2f49db0..d9bfb8b02 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -53,10 +53,10 @@ let window.dimensions.lines = 9; }; variants.hidpi = { - font.normal.family = "iosevka tv 1"; - font.bold.family = "iosevka tv 1"; - font.italic.family = "iosevka tv 1"; - font.bold_italic.family = "iosevka tv 1"; + font.normal.family = "iosevka tv 2 Light"; + font.italic.family = "iosevka tv 2 Light"; + font.bold.family = "iosevka tv 2 Medium"; + font.bold_italic.family = "iosevka tv 2 Medium"; font.size = 5; key_bindings = [ { key = "Up"; mods = "Control"; action = "IncreaseFontSize"; } -- cgit v1.2.3 From c0ec617d22a2f03a110ecb5a4ab4d736c582b89e Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:31:04 +0100 Subject: tv alacritty: install config read-writable --- tv/5pkgs/simple/alacritty-tv.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/5pkgs/simple/alacritty-tv.nix b/tv/5pkgs/simple/alacritty-tv.nix index d9bfb8b02..ddf2ca8df 100644 --- a/tv/5pkgs/simple/alacritty-tv.nix +++ b/tv/5pkgs/simple/alacritty-tv.nix @@ -104,7 +104,7 @@ let ref=$(! test -e "$HOME"/ref || ${pkgs.coreutils}/bin/cat "$HOME"/ref) if test "$ref" != ${config-file}; then echo ${config-file} > "$HOME"/ref - ${pkgs.coreutils}/bin/cp ${config-file} "$HOME"/.alacritty.yml + ${pkgs.coreutils}/bin/install -m 644 ${config-file} "$HOME"/.alacritty.yml fi ''; in -- cgit v1.2.3 From 30c7470664da9dc15bdc280487c9e03105708164 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:36:10 +0100 Subject: tv: alacritty-font-size -> font-size-alacritty --- tv/5pkgs/simple/alacritty-font-size.nix | 67 --------------------------------- tv/5pkgs/simple/font-size-alacritty.nix | 67 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 tv/5pkgs/simple/alacritty-font-size.nix create mode 100644 tv/5pkgs/simple/font-size-alacritty.nix diff --git a/tv/5pkgs/simple/alacritty-font-size.nix b/tv/5pkgs/simple/alacritty-font-size.nix deleted file mode 100644 index 84bc3f616..000000000 --- a/tv/5pkgs/simple/alacritty-font-size.nix +++ /dev/null @@ -1,67 +0,0 @@ -{ pkgs }: - -pkgs.writeDashBin "font-size-alacritty" '' - # usage: font-size-alacritty (+N|-N|=N) - # Increase by, decrease by, or set font size to the value N. - - set -efu - - min_size=8 - - op=''${1%%[0-9]*} - op=''${op:-=} - - value=''${1#[=+-]} - - window_id=$(${pkgs.xdotool}/bin/xdotool getactivewindow) - - current_size=$( - ${pkgs.xorg.xprop}/bin/xprop -notype -id $window_id FONT_SIZE | - ${pkgs.gnused}/bin/sed -rn 's/.* = ([0-9]+)$/\1/p' - ) - - # usage: set_font_size WINDOW_ID FONT_SIZE - set_font_size() { - ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$2 - ${pkgs.xorg.xprop}/bin/xprop -id $1 -f FONT_SIZE 32c -set FONT_SIZE $2 - } - - # usage: reset_font_size WINDOW_ID - reset_font_size() { - ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$min_size - ${pkgs.xorg.xprop}/bin/xprop -id $1 -remove FONT_SIZE - } - - # usage: make_next_size - make_next_size() { - case $op in - -) next_size=$(expr $current_size - $value) ;; - =) next_size=$value ;; - +) - next_size=$(expr $current_size + $value) - test $next_size -ge $min_size || next_size=$min_size - ;; - esac - } - - if test -z "$current_size"; then - current_size=0 - make_next_size - if test $next_size -ge $min_size; then - ${pkgs.alacritty}/bin/alacritty msg config -w $window_id \ - font.normal.family='Input Mono' \ - font.normal.style=Condensed \ - font.bold.family='Input Mono' \ - font.bold.style=Bold - set_font_size $window_id $next_size - fi - else - make_next_size - if test $next_size -ge $min_size; then - set_font_size $window_id $next_size - else - ${pkgs.alacritty}/bin/alacritty msg config -w $window_id -r - reset_font_size $window_id - fi - fi -'' diff --git a/tv/5pkgs/simple/font-size-alacritty.nix b/tv/5pkgs/simple/font-size-alacritty.nix new file mode 100644 index 000000000..84bc3f616 --- /dev/null +++ b/tv/5pkgs/simple/font-size-alacritty.nix @@ -0,0 +1,67 @@ +{ pkgs }: + +pkgs.writeDashBin "font-size-alacritty" '' + # usage: font-size-alacritty (+N|-N|=N) + # Increase by, decrease by, or set font size to the value N. + + set -efu + + min_size=8 + + op=''${1%%[0-9]*} + op=''${op:-=} + + value=''${1#[=+-]} + + window_id=$(${pkgs.xdotool}/bin/xdotool getactivewindow) + + current_size=$( + ${pkgs.xorg.xprop}/bin/xprop -notype -id $window_id FONT_SIZE | + ${pkgs.gnused}/bin/sed -rn 's/.* = ([0-9]+)$/\1/p' + ) + + # usage: set_font_size WINDOW_ID FONT_SIZE + set_font_size() { + ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$2 + ${pkgs.xorg.xprop}/bin/xprop -id $1 -f FONT_SIZE 32c -set FONT_SIZE $2 + } + + # usage: reset_font_size WINDOW_ID + reset_font_size() { + ${pkgs.alacritty}/bin/alacritty msg config -w $1 font.size=$min_size + ${pkgs.xorg.xprop}/bin/xprop -id $1 -remove FONT_SIZE + } + + # usage: make_next_size + make_next_size() { + case $op in + -) next_size=$(expr $current_size - $value) ;; + =) next_size=$value ;; + +) + next_size=$(expr $current_size + $value) + test $next_size -ge $min_size || next_size=$min_size + ;; + esac + } + + if test -z "$current_size"; then + current_size=0 + make_next_size + if test $next_size -ge $min_size; then + ${pkgs.alacritty}/bin/alacritty msg config -w $window_id \ + font.normal.family='Input Mono' \ + font.normal.style=Condensed \ + font.bold.family='Input Mono' \ + font.bold.style=Bold + set_font_size $window_id $next_size + fi + else + make_next_size + if test $next_size -ge $min_size; then + set_font_size $window_id $next_size + else + ${pkgs.alacritty}/bin/alacritty msg config -w $window_id -r + reset_font_size $window_id + fi + fi +'' -- cgit v1.2.3 From 8e019e0111ed73c4f49007fa00c5ecc8c5c46f28 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:36:27 +0100 Subject: tv font-size-alacritty: min_size=5 --- tv/5pkgs/simple/font-size-alacritty.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tv/5pkgs/simple/font-size-alacritty.nix b/tv/5pkgs/simple/font-size-alacritty.nix index 84bc3f616..d37f0f055 100644 --- a/tv/5pkgs/simple/font-size-alacritty.nix +++ b/tv/5pkgs/simple/font-size-alacritty.nix @@ -6,7 +6,7 @@ pkgs.writeDashBin "font-size-alacritty" '' set -efu - min_size=8 + min_size=5 op=''${1%%[0-9]*} op=''${op:-=} -- cgit v1.2.3 From e726cb1f59ed675d8efee3d30cca3922c91f1e8a Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 13:48:00 +0100 Subject: tv libinput-tv: init with winmax2 patch --- tv/5pkgs/simple/libinput-tv.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tv/5pkgs/simple/libinput-tv.nix diff --git a/tv/5pkgs/simple/libinput-tv.nix b/tv/5pkgs/simple/libinput-tv.nix new file mode 100644 index 000000000..6f08689bb --- /dev/null +++ b/tv/5pkgs/simple/libinput-tv.nix @@ -0,0 +1,11 @@ +{ pkgs }: + +pkgs.libinput.overrideAttrs (old: { + patches = old.patches or [] ++ [ + (pkgs.fetchurl { + name = "libinput-winmax2.patch"; + url = "https://github.com/4z3/libinput/commit/2d0ff41.patch"; + sha256 = "0ipsxzjf98g9w2m163gp49zl14wbxs84s0psdnvk7wfiivgcnm1f"; + }) + ]; +}) -- cgit v1.2.3 From 4cfc02239b667fd7af6bc0d0a2cb1ae09a3c95f3 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 29 Jan 2023 17:56:33 +0100 Subject: Revert "tv xmonad: paste primary with Shift+F12" This reverts commit f58675052f46c1b2bbc4f0efb3db07b2d18849be. --- tv/5pkgs/haskell/xmonad-tv/src/main.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/tv/5pkgs/haskell/xmonad-tv/src/main.hs b/tv/5pkgs/haskell/xmonad-tv/src/main.hs index 931f62902..eb61bd5cf 100644 --- a/tv/5pkgs/haskell/xmonad-tv/src/main.hs +++ b/tv/5pkgs/haskell/xmonad-tv/src/main.hs @@ -196,8 +196,6 @@ myKeys font conf = Map.fromList $ , ((0, xF86XK_AudioMicMute), audioMicMute) , ((_4, xF86XK_AudioMute), pavucontrol []) - , ((_S, xK_F12), forkFile {-pkg-}"xdotool" ["click", "2"] Nothing) - , ((_4, xK_Prior), forkFile {-pkg-}"xcalib" ["-invert", "-alter"] Nothing) , ((0, xK_Print), forkFile {-pkg-}"flameshot" [] Nothing) -- cgit v1.2.3 From 006dd80a7603e3db3cc21d1df49eeca35da6d83b Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Jan 2023 16:29:50 +0100 Subject: q-power_supply: ignore Mains type --- krebs/5pkgs/simple/q-power_supply.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krebs/5pkgs/simple/q-power_supply.nix b/krebs/5pkgs/simple/q-power_supply.nix index 4d6774846..627e3f905 100644 --- a/krebs/5pkgs/simple/q-power_supply.nix +++ b/krebs/5pkgs/simple/q-power_supply.nix @@ -8,7 +8,7 @@ writeDashBin "q-power_supply" '' s/^\([A-Z_]\+=[0-9A-Za-z_-]*\)$/export \1/p ' $uevent)" case $POWER_SUPPLY_NAME in - AC) + AC|Mains) exit # not battery ;; esac -- cgit v1.2.3 From a85de9a0deb81f8b8759bfc6a54db0d823ab7a19 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Jan 2023 16:59:45 +0100 Subject: tv winmax2: use amd-pstate --- tv/2configs/hw/winmax2.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tv/2configs/hw/winmax2.nix b/tv/2configs/hw/winmax2.nix index b52ab0fa5..49af7611c 100644 --- a/tv/2configs/hw/winmax2.nix +++ b/tv/2configs/hw/winmax2.nix @@ -6,7 +6,14 @@ boot.initrd.availableKernelModules = [ "nvme" "xhci_pci" "thunderbolt" "usbhid" ]; boot.initrd.kernelModules = [ "amdgpu" ]; - boot.kernelModules = [ "kvm-amd" ]; + boot.kernelModules = [ + "amd-pstate" + "kvm-amd" + ]; + boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelParams = [ + "amd_pstate=passive" + ]; hardware.bluetooth.enable = true; -- cgit v1.2.3