# /etc/nixos/configuration.nix
nixpkgs.overlays = [
# GNOME 47: triple-buffering-v4-47
(final: prev: {
gnome = prev.gnome.overrideScope (gnomeFinal: gnomePrev: {
mutter = gnomePrev.mutter.overrideAttrs (old: {
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "vanvugt";
repo = "mutter";
rev = "triple-buffering-v4-47";
hash = "sha256-145ec3b2c62cba22bc8f5c7a2e8e2fef48f4da8f";
};
});
});
})
];
and then sudo nixos-rebuild switch
. However, there is 0 difference to the rebuild output even though I was using the one mentioned here before. I can also blank out the “hash” attribute – makes no difference.
Any clue?
I could be wrong, but it looks like you might be using the wrong version on that page. Mutter was moved outside of gnome scope. Look at the one above that in your link
{
nixpkgs.overlays = [
# GNOME 46: triple-buffering-v4-46
(final: prev: {
mutter = prev.mutter.overrideAttrs (old: {
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "vanvugt";
repo = "mutter";
rev = "triple-buffering-v4-46";
hash = "sha256-C2VfW3ThPEZ37YkX7ejlyumLnWa9oij333d5c4yfZxc=";
};
});
})
];
}
I hope you get it to work, for me it’s complaining about missing dependencies.
Which deps? Share the error. And you can override the deps as well.
error: builder for '/nix/store/kja337vmy6wnvxn36fw1i52c0hdjjg8g-mutter-47.0.drv' failed with exit code 1;
last 25 log lines:
> Run-time dependency pixman-1 found: YES 0.43.4
> Run-time dependency fribidi found: YES 1.0.16
> Run-time dependency gsettings-desktop-schemas found: YES 47.1
> Run-time dependency glib-2.0 found: YES 2.82.1
> Run-time dependency gio-unix-2.0 found: YES 2.82.1
> Dependency gio-unix-2.0 found: YES 2.82.1 (cached)
> Run-time dependency gobject-2.0 found: YES 2.82.1
> Dependency gobject-2.0 found: YES 2.82.1 (cached)
> Run-time dependency gmodule-no-export-2.0 found: YES 2.82.1
> Run-time dependency gnome-settings-daemon found: YES 47.1
> Run-time dependency xkbcommon found: YES 1.7.0
> Run-time dependency atk found: YES 2.54.0
> Run-time dependency colord found: YES 1.4.6
> Run-time dependency lcms2 found: YES 2.16
> Run-time dependency harfbuzz found: YES 9.0.0
> Run-time dependency libeis-1.0 found: YES 1.3.0
> Run-time dependency libei-1.0 found: YES 1.3.0
> Did not find CMake 'cmake'
> Found CMake: NO
> Run-time dependency gvdb found: NO (tried pkgconfig and cmake)
> Looking for a fallback subproject for the dependency gvdb
>
> meson.build:132:11: ERROR: Automatic wrap-based subproject downloading is disabled
>
> A full log can be found at /build/source/build/meson-logs/meson-log.txt
For full logs, run 'nix log /nix/store/kja337vmy6wnvxn36fw1i52c0hdjjg8g-mutter-47.0.drv'.
Thanks a lot, I had no idea the namespace had changed that much. I wish nix sent warnings when configs are completely ignored…
And yes, unfortunately I got the same compilation errors as you.
When I add cmake as a nativeBuildInput I get the following error
error: builder for '/nix/store/lwsi037sj2vhckhmr2wqlc2vlybriajy-mutter-47.0.drv' failed with exit code 1;
last 17 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/94b85k1mi9871ql70myzb8i6gx7gckkw-source
> source root is source
> Running phase: patchPhase
> patching script interpreter paths in src/backends/native/gen-default-modes.py
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> fixing cmake files...
> cmake flags: -DCMAKE_FIND_USE_SYSTEM_PACKAGE_REGISTRY=OFF -DCMAKE_FIND_USE_PACKAGE_REGISTRY=OFF -DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DCMAKE_INSTALL_LOCALEDIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/share/locale -DCMAKE_INSTALL_LIBEXECDIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/libexec -DCMAKE_INSTALL_LIBDIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/lib -DCMAKE_INSTALL_DOCDIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/share/doc/mutter -DCMAKE_INSTALL_INFODIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/share/info -DCMAKE_INSTALL_MANDIR=/nix/store/i0lpl344bbavm1kdaa0m2iffxvw15a5a-mutter-47.0-man/share/man -DCMAKE_INSTALL_OLDINCLUDEDIR=/nix/store/16fvbbzgyr69vr88v8ijjmdnl0hlphhd-mutter-47.0-dev/include -DCMAKE_INSTALL_INCLUDEDIR=/nix/store/16fvbbzgyr69vr88v8ijjmdnl0hlphhd-mutter-47.0-dev/include -DCMAKE_INSTALL_SBINDIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/sbin -DCMAKE_INSTALL_BINDIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/bin -DCMAKE_INSTALL_NAME_DIR=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0/lib -DCMAKE_POLICY_DEFAULT_CMP0025=NEW -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_STRIP=/nix/store/hgw57m0jh2w10jsv8x86ng267pm5sla8-gcc-wrapper-13.3.0/bin/strip -DCMAKE_RANLIB=/nix/store/hgw57m0jh2w10jsv8x86ng267pm5sla8-gcc-wrapper-13.3.0/bin/ranlib -DCMAKE_AR=/nix/store/hgw57m0jh2w10jsv8x86ng267pm5sla8-gcc-wrapper-13.3.0/bin/ar -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_INSTALL_PREFIX=/nix/store/8bqdj3cs3b5h74jjsji727lfsdn1s9pf-mutter-47.0
> CMake Warning:
> Ignoring extra path from command line:
>
> ".."
>
>
> CMake Error: The source directory "/build/source" does not appear to contain CMakeLists.txt.
> Specify --help for usage, or press the help button on the CMake GUI.
For full logs, run 'nix log /nix/store/lwsi037sj2vhckhmr2wqlc2vlybriajy-mutter-47.0.drv'.
Ok I’ve overcome some of these errors using the following
mutter = prev.mutter.overrideAttrs (old: {
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "vanvugt";
repo = "mutter";
rev = "triple-buffering-v4-47";
hash = "sha256-JaqJvbuIAFDKJ3y/8j/7hZ+/Eqru+Mm1d3EvjfmCcug=";
};
buildInputs = [prev.mutter prev.gnome-common prev.fribidi prev.gnome.gnome-settings-daemon prev.libxkbcommon prev.atkmm prev.colord prev.lcms prev.geis];
});
however I can’t seem to find this library now
> Run-time dependency libeis-1.0 found: NO (tried pkgconfig)
>
> meson.build:130:13: ERROR: Dependency "libeis-1.0" not found, tried pkgconfig
You’ll likely need to package GNOME / GVDB · GitLab and add it as a dependency, then. Unless there’s a flag to ignore the gvdb dependency.
I’d deduce you did the opposite and removed dependencies, I don’t see how that would help here. libeis
is searched for earlier than gvdb
.
1 Like
Is there an easy way to add it ad a dependency? I’m using flakes, so I added a package for gvdb and I couldn’t get the override working, it kept complaining about missing gvdb. So I pulled the package for mutter and modified that file directly to add the dependency and now it seems to be working.
I looked at several of the gnome dependencies and created the following for gvdb. I’m really new to the nix way of doing things, so if something can be improved please let me know, I’m just learning by example right now.
{ lib, stdenv, fetchFromGitLab, which, gnome, autoconf, automake, pkg-config, ninja, meson, glib}:
stdenv.mkDerivation rec {
name = "gvdb";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "gvdb";
rev = "2b42fc75f09dbe1cd1057580b5782b08f2dcb400";
hash = "sha256-CIdEwRbtxWCwgTb5HYHrixXi+G+qeE1APRaUeka3NWk=";
};
nativeBuildInputs = [
pkg-config
ninja
meson
glib
];
buildInputs = [
];
passthru = {
updateScript = gnome.updateScript { packageName = "gvdb"; };
};
propagatedBuildInputs = [ which autoconf automake ]; # autogen.sh which is using gnome-common tends to require which
meta = with lib; {
};
}
I tried overriding the build dependencies like so
mutter = prev.mutter.overrideAttrs (old: {
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "vanvugt";
repo = "mutter";
rev = "triple-buffering-v4-47";
hash = "sha256-JaqJvbuIAFDKJ3y/8j/7hZ+/Eqru+Mm1d3EvjfmCcug=";
};
nativeBuildInputs = old.nativeBuildInputs ++ [ final.gvdb ];
});
but it still complained about missing gvdb. Am I missing something here? I’d rather not have to mess with maintaining the mutter package if I don’t need to.
miketth
November 18, 2024, 7:04pm
10
I managed to fix it like this:
{
mutter,
mutter-triple-buffering-src,
gvdb-src
}:
mutter.overrideAttrs (old: {
src = mutter-triple-buffering-src;
preConfigure = ''
cp -a "${gvdb-src}" ./subprojects/gvdb
'';
})
Basically, you don’t have to create a package for gvdb
, just copy the source to ./subprojects/gvdb
. I’m using flakes to keep both repos up-to-date, but you can substitute mutter-triple-buffering-src
and gvdb-src
with the relevant fetchFromGitLab
calls like this:
mutter = prev.mutter.overrideAttrs (old: {
src = pkgs.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "vanvugt";
repo = "mutter";
rev = "triple-buffering-v4-47";
hash = "sha256-JaqJvbuIAFDKJ3y/8j/7hZ+/Eqru+Mm1d3EvjfmCcug=";
};
preConfigure = let
gvdb-src = fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "GNOME";
repo = "gvdb";
rev = "2b42fc75f09dbe1cd1057580b5782b08f2dcb400";
hash = "sha256-CIdEwRbtxWCwgTb5HYHrixXi+G+qeE1APRaUeka3NWk=";
};
in "cp -a "${gvdb-src}" ./subprojects/gvdb";
});
(I’m not 100% sure that I typed out everything perfectly in the second one, but you get the idea).
In case you want to try the flake way, here’s how I do it in my configs:
I declared the repos as inputs here and then I created a package which I instantiate in the flake and use in an overlay . This lets me update Mutter by running nix flake update
.
1 Like
I’m having some trouble getting the triple-buffering-v4-47 patch to work on NixOS 24.11. Can someone link a confirmed working configuration.nix snippet?
eljamm
November 23, 2024, 9:55am
12
@miketth ’s overlay should work (aside from the preConfigure
quotes that need escaping), but here is something you can just copy to configuration.nix
:
nixpkgs.overlays = [
(final: prev: {
mutter = prev.mutter.overrideAttrs (oldAttrs: {
# GNOME dynamic triple buffering (huge performance improvement)
# See https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1441
src = final.fetchFromGitLab {
domain = "gitlab.gnome.org";
owner = "vanvugt";
repo = "mutter";
rev = "triple-buffering-v4-47";
hash = "sha256-JaqJvbuIAFDKJ3y/8j/7hZ+/Eqru+Mm1d3EvjfmCcug=";
};
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
'';
});
})
];
2 Likes
That built without issue. Thank you!
1 Like
The way I did this:
Add the sources to inputs like this:
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;
};
Then add the overlay
mutter = super.mutter.overrideAttrs (old: {
src = inputs.mutter-triple-buffering-src;
preConfigure = ''
cp -a "${inputs.gvdb-src}" ./subprojects/gvdb
'';
});
Is there some way to verify that it has taken effect?
nadir
December 4, 2024, 3:12pm
16
Is it just me or is the actual gitlab account of vanvugt gone?
1 Like
truh
December 4, 2024, 3:19pm
17
1 Like
miketth
December 5, 2024, 9:14pm
18
Now that GNOME’s GitLab is back, can someone who has an account check if vanvugt/mutter
is available? The link to the repo redirects me to log in, as if it was set to internal/private, and registration seems broken (Internal Server Error
).
On gitlab, getting redirected to login often means the repo was deleted. Though Daniel van Vugt · GitLab still exists fwiw
1 Like