GNOME: Difference between revisions
m Fix slightly incorrect dconf settings code block |
Added GNOME 47 triple-buffering instructions with gvdb dependency handling. Also added flake instructions. |
||
| Line 275: | Line 275: | ||
} | } | ||
</nowiki>}} | </nowiki>}} | ||
For GNOME 47, use the following configuration instead: | |||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
{ | |||
nixpkgs.overlays = [ | |||
# GNOME 47: triple-buffering-v4-47 | |||
(final: prev: { | |||
mutter = prev.mutter.overrideAttrs (oldAttrs: { | |||
# GNOME dynamic triple buffering (huge performance improvement) | |||
# See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441 | |||
# Also https://gitlab.gnome.org/vanvugt/mutter/-/tree/triple-buffering-v4-47 | |||
src = final.fetchFromGitLab { | |||
domain = "gitlab.gnome.org"; | |||
owner = "vanvugt"; | |||
repo = "mutter"; | |||
rev = "triple-buffering-v4-47"; | |||
hash = "sha256-Jlhzt2Cc44epkBcz3PA6I5aTnVEqMsHBOE8aEmvANWw="; | |||
}; | |||
# GNOME 47 requires the gvdb subproject which is not included in the triple-buffering branch | |||
# This copies the necessary gvdb files from the official GNOME repository | |||
preConfigure = let | |||
gvdb = final.fetchFromGitLab { | |||
domain = "gitlab.gnome.org"; | |||
owner = "GNOME"; | |||
repo = "gvdb"; | |||
rev = "2b42fc75f09dbe1cd1057580b5782b08f2dcb400"; | |||
hash = "sha256-CIdEwRbtxWCwgTb5HYHrixXi+G+qeE1APRaUeka3NWk="; | |||
}; | |||
in '' | |||
cp -a "${gvdb}" ./subprojects/gvdb | |||
''; | |||
}); | |||
}) | |||
]; | |||
} | |||
</nowiki>}} | |||
==== Flakes approach ==== | |||
If you're using flakes, you can add the repositories as inputs for better maintainability: | |||
{{file|flake.nix (inputs section)|nix|<nowiki> | |||
{ | |||
# In inputs: | |||
mutter-triple-buffering-src = { | |||
url = "gitlab:vanvugt/mutter?ref=triple-buffering-v4-47&host=gitlab.gnome.org"; | |||
flake = false; | |||
}; | |||
gvdb-src = { | |||
url = "gitlab:GNOME/gvdb?ref=main&host=gitlab.gnome.org"; | |||
flake = false; | |||
}; | |||
} | |||
</nowiki>}} | |||
Then, in your overlay section: | |||
{{file|flake.nix (overlay section)|nix|<nowiki> | |||
{ | |||
# In your overlay: | |||
mutter = super.mutter.overrideAttrs (old: { | |||
src = inputs.mutter-triple-buffering-src; | |||
preConfigure = '' | |||
cp -a "${inputs.gvdb-src}" ./subprojects/gvdb | |||
''; | |||
}); | |||
} | |||
</nowiki>}} | |||
{{Note|For GNOME 47, the gvdb dependency must be manually added to the subprojects directory during build. The preConfigure hook handles this by fetching the required repository and placing it in the correct location.}} | |||
Prior to [https://github.com/NixOS/nixpkgs/commit/7f387d6bf915b8fd7d7131edd3e5107f4a98cc9d commit 7f387d6b] (~01.09.2024 for master) <code>mutter</code> was located in <code>gnome</code> scope, so <code>overrideScope</code> was required to achieve the same result: | Prior to [https://github.com/NixOS/nixpkgs/commit/7f387d6bf915b8fd7d7131edd3e5107f4a98cc9d commit 7f387d6b] (~01.09.2024 for master) <code>mutter</code> was located in <code>gnome</code> scope, so <code>overrideScope</code> was required to achieve the same result: | ||