From 3c25fc5d41ab1e995ca0a710a96d6cce088161ef Mon Sep 17 00:00:00 2001 From: m3ta-chiron Date: Mon, 31 Aug 2026 16:54:15 +0200 Subject: [PATCH] fix(overlay): patch font-manager 0.9.4 for gtk4 4.22 Vala errors font-manager 0.9.4 fails to compile against gtk4 4.22: the Gtk.DragIcon.get_for_drag binding changed in the gtk4 vapi, producing 'use new operator' errors in Collections.vala and FontList.vala that broke home-manager-path for AZ-LT-NIX. Fix is upstream PR FontManager/font-manager#468, already carried by nixpkgs master but predating our locked nixpkgs-unstable. Vendor the patch as an overlay mod (from m3tam3re/nixos-config overlays/mods) and enable outputs.overlays.modifications in hosts/common. Thin clients are unaffected - they do not import hosts/common. Drop once the nixpkgs lock carries fix-compilation-error-with-newer-vala-versions.patch. Also resolve the evaluation warning on AZ-LT-NIX where programs.nh.clean.enable and nix.gc.automatic were both enabled: keep the nh clean timer (--keep 3 --keep-since 4d) and disable the plain nix-gc timer via mkForce on this host only. --- hosts/AZ-LT-NIX/programs.nix | 10 ++++- hosts/common/default.nix | 2 +- overlays/default.nix | 1 + overlays/mods/font-manager.nix | 20 ++++++++++ ...ation-error-with-newer-vala-versions.patch | 37 +++++++++++++++++++ 5 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 overlays/mods/font-manager.nix create mode 100644 overlays/mods/patches/font-manager-fix-compilation-error-with-newer-vala-versions.patch diff --git a/hosts/AZ-LT-NIX/programs.nix b/hosts/AZ-LT-NIX/programs.nix index 57bb17c..a7d6a29 100644 --- a/hosts/AZ-LT-NIX/programs.nix +++ b/hosts/AZ-LT-NIX/programs.nix @@ -1,4 +1,8 @@ -{pkgs, ...}: { +{ + lib, + pkgs, + ... +}: { programs.nix-ld.enable = true; programs.nix-ld.libraries = with pkgs; [ # Add any missing dynamic libraries for unpackaged programs @@ -38,6 +42,10 @@ clean.extraArgs = "--keep-since 4d --keep 3"; flake = "/home/m3tam3re/p/nixos/nixos-config"; }; + # nh.clean and nix.gc.automatic conflict (NixOS assertion) — this host + # uses the nh clean timer above for generation/GC retention, so disable + # the plain nix-gc timer inherited from hosts/common. + nix.gc.automatic = lib.mkForce false; services.netbird.enable = true; environment.systemPackages = [pkgs.netbird-ui]; } diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 345a9bf..bdf13f5 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -31,7 +31,7 @@ overlays = [ # Add overlays your own flake exports (from overlays and pkgs dir): #outputs.overlays.additions - #outputs.overlays.modifications + outputs.overlays.modifications outputs.overlays.stable-packages # outputs.overlays.pinned-packages diff --git a/overlays/default.nix b/overlays/default.nix index 7324081..0b14e02 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -11,6 +11,7 @@ # https://nixos.wiki/wiki/Overlays modifications = final: prev: { # n8n = import ./mods/n8n.nix {inherit prev;}; + font-manager = import ./mods/font-manager.nix {inherit prev;}; vivaldi = prev.vivaldi.override { commandLineArgs = "--enable-features=UseOzonePlatform --ozone-platform=wayland"; }; diff --git a/overlays/mods/font-manager.nix b/overlays/mods/font-manager.nix new file mode 100644 index 0000000..f512d25 --- /dev/null +++ b/overlays/mods/font-manager.nix @@ -0,0 +1,20 @@ +# font-manager 0.9.4: fix compilation against gtk4 >= 4.22 / newer Vala. +# +# In GTK 4.22 the Gtk.DragIcon.get_for_drag binding changed in the gtk4 +# vapi, turning `Gtk.DragIcon.get_for_drag(drag)` into a hard Vala error +# ("use `new' operator to create new objects") in Collections.vala and +# FontList.vala. 0.9.4 is the latest upstream release and even upstream +# master is unfixed; the fix lives in FontManager/font-manager#468 and is +# already carried as a patch by current nixpkgs master — but our locked +# nixpkgs-unstable predates it. +# +# Vendored from m3tam3re/nixos-config overlays/mods (2026-08-31). +# Drop this overlay (and the patch file) once our nixpkgs lock advances +# past nixpkgs@e2ad529-vendoring (pkgs/by-name/fo/font-manager carries +# fix-compilation-error-with-newer-vala-versions.patch). +{prev}: +prev.font-manager.overrideAttrs (old: { + patches = + (old.patches or []) + ++ [./patches/font-manager-fix-compilation-error-with-newer-vala-versions.patch]; +}) diff --git a/overlays/mods/patches/font-manager-fix-compilation-error-with-newer-vala-versions.patch b/overlays/mods/patches/font-manager-fix-compilation-error-with-newer-vala-versions.patch new file mode 100644 index 0000000..4b1ab5f --- /dev/null +++ b/overlays/mods/patches/font-manager-fix-compilation-error-with-newer-vala-versions.patch @@ -0,0 +1,37 @@ +From e2ad529a88929bbc76906ac78260dacf4d8c8c6b Mon Sep 17 00:00:00 2001 +From: Jan Baier +Date: Fri, 1 May 2026 17:25:25 +0200 +Subject: [PATCH] Fix compilation error with newer Vala versions + +Fixes #467 +--- + src/font-manager/Collections.vala | 2 +- + src/font-manager/FontList.vala | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/font-manager/Collections.vala b/src/font-manager/Collections.vala +index 5e7f5cdb..43531e54 100644 +--- a/src/font-manager/Collections.vala ++++ b/src/font-manager/Collections.vala +@@ -523,7 +523,7 @@ namespace FontManager { + var row = ((CollectionListRow) source.widget); + var drag_icon = new Gtk.Label(row.item_label.label); + drag_icon.add_css_class("FontManagerListRowDrag"); +- var gtk_drag_icon = (Gtk.DragIcon) Gtk.DragIcon.get_for_drag(drag); ++ var gtk_drag_icon = new Gtk.DragIcon.get_for_drag(drag); + gtk_drag_icon.set_child(drag_icon); + return; + } +diff --git a/src/font-manager/FontList.vala b/src/font-manager/FontList.vala +index c8b170cb..9720dc2b 100644 +--- a/src/font-manager/FontList.vala ++++ b/src/font-manager/FontList.vala +@@ -669,7 +669,7 @@ namespace FontManager { + widget_set_name(drag_count, "FontManagerListDragCount"); + drag_icon.add_overlay(drag_count); + drag_count.set_label(selected_items.length.to_string()); +- var gtk_drag_icon = (Gtk.DragIcon) Gtk.DragIcon.get_for_drag(drag); ++ var gtk_drag_icon = new Gtk.DragIcon.get_for_drag(drag); + gtk_drag_icon.set_child(drag_icon); + return; + }