From d75d28cdda7242f5a1bc7f51e4397a2fe3b684ec Mon Sep 17 00:00:00 2001 From: Daniel Langbein Date: Thu, 1 Feb 2024 20:58:53 +0100 Subject: [PATCH] chore: fractional scaling in X11 --- modules/gnome-fractional-scaling.nix | 17 +++++++++++------ nix/sources.json | 12 ++++++------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/gnome-fractional-scaling.nix b/modules/gnome-fractional-scaling.nix index 54768ad..6d2e931 100644 --- a/modules/gnome-fractional-scaling.nix +++ b/modules/gnome-fractional-scaling.nix @@ -1,4 +1,7 @@ { config, pkgs, lib, ... }: +let + version = "45.3"; +in { # https://wiki.archlinux.org/title/HiDPI#Wayland # Results in blurry font in non-Wayland applications :/ @@ -27,25 +30,27 @@ # -> https://salsa.debian.org/gnome-team/mutter/-/tags?sort=updated_desc&search=ubuntu%2F # -> https://salsa.debian.org/gnome-team/mutter/-/tags/ubuntu%2F44.2-3ubuntu1 # -> https://salsa.debian.org/gnome-team/mutter/-/raw/ubuntu/44.2-3ubuntu1/debian/patches/ubuntu/x11-Add-support-for-fractional-scaling-using-Randr.patch - # - #=> building '/nix/store/yh0jnwyq5351l1rjspjlkimas3wvpf6g-mutter-44.2.drv'... + # For release 45.3: + # -> https://salsa.debian.org/gnome-team/mutter/-/tags?sort=updated_desc&search=ubuntu%2F + # -> https://salsa.debian.org/gnome-team/mutter/-/tags/ubuntu%2F45.3-1ubuntu1 + # -> https://salsa.debian.org/gnome-team/mutter/-/raw/ubuntu/45.3-1ubuntu1/debian/patches/ubuntu/x11-Add-support-for-fractional-scaling-using-Randr.patch # Elements of nixpkgs must be taken from final and prev. final: prev: { # Elements of pkgs.gnome must be taken from gfinal and gprev. gnome = prev.gnome.overrideScope' (gfinal: gprev: { mutter = gprev.mutter.overrideAttrs (oldAttrs: - if oldAttrs.version == "44.2" then + if oldAttrs.version == version then { patches = (oldAttrs.patches or []) ++ [ (prev.fetchpatch { - url = "https://salsa.debian.org/gnome-team/mutter/-/raw/ubuntu/44.2-3ubuntu1/debian/patches/ubuntu/x11-Add-support-for-fractional-scaling-using-Randr.patch"; + url = "https://salsa.debian.org/gnome-team/mutter/-/raw/ubuntu/${version}-1ubuntu1/debian/patches/ubuntu/x11-Add-support-for-fractional-scaling-using-Randr.patch"; # Determining the hash: https://github.com/NixOS/nixpkgs/issues/191128#issuecomment-1246030431 - hash = "sha256-GCtz87C1NgxenYE5nbxcIIxqNhutmdngscnlK10fRyQ="; + hash = "sha256-snEgCuTsTEo0wQ5XsjEM53K2j7l4ZQ3t9FT3+Yfoti0="; }) ]; } - else throw "Mutter version mismatch. Please update patch." + else throw "Mutter version mismatch. Please update patch. ${oldAttrs.version}" ); }); } diff --git a/nix/sources.json b/nix/sources.json index 0e098de..d3a696c 100644 --- a/nix/sources.json +++ b/nix/sources.json @@ -5,10 +5,10 @@ "homepage": "https://nur.nix-community.org/", "owner": "nix-community", "repo": "NUR", - "rev": "6bc9f506e6299fc5e02bb7f5f7d7692b82df628d", - "sha256": "1fafgh64fw8rq9pjpwyyzlfwminnd5ifcpm2n3mgafds2nadx225", + "rev": "91d594fbe9e38f7248fcc36f2f102082f1170ef8", + "sha256": "0v4s19fmyzasrwqhfxkdp44rdfp4yii03l4fn41f8irmd5xll4i5", "type": "tarball", - "url": "https://github.com/nix-community/NUR/archive/6bc9f506e6299fc5e02bb7f5f7d7692b82df628d.tar.gz", + "url": "https://github.com/nix-community/NUR/archive/91d594fbe9e38f7248fcc36f2f102082f1170ef8.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "home-manager": { @@ -29,10 +29,10 @@ "homepage": null, "owner": "NixOS", "repo": "nixpkgs", - "rev": "f4a8d6d5324c327dcc2d863eb7f3cc06ad630df4", - "sha256": "0nlm934nnx09lfilz8171rx6x510g9ffdyrzijvqr5gh1vjdhmvq", + "rev": "53fbe41cf76b6a685004194e38e889bc8857e8c2", + "sha256": "1fyc4kbhv7rrfzya74yprvd70prlcsv56b7n0fv47kn7rznvvr2b", "type": "tarball", - "url": "https://github.com/NixOS/nixpkgs/archive/f4a8d6d5324c327dcc2d863eb7f3cc06ad630df4.tar.gz", + "url": "https://github.com/NixOS/nixpkgs/archive/53fbe41cf76b6a685004194e38e889bc8857e8c2.tar.gz", "url_template": "https://github.com///archive/.tar.gz" }, "unstable": {