Trying to downgrade Mesa in NixOS and the opengl nixos wiki says: To avoid a lot of…
- User
Trying to downgrade Mesa in NixOS and the opengl nixos wiki says:
To avoid a lot of rebuilds there's an internal NixOS option to override the Mesa drivers: hardware.opengl.package
It can be used like this:
hardware.opengl.package = (import /srv/nixpkgs-mesa { }).pkgs.mesa.drivers;
However, since Mesa 21.0.2 this doesn't necessarily work anymore and something like the following might be required:
system.replaceRuntimeDependencies = [ ({ original = pkgs.mesa; replacement = (import /srv/nixpkgs-mesa { }).pkgs.mesa; }) ({ original = pkgs.mesa.drivers; replacement = (import /srv/nixpkgs-mesa { }).pkgs.mesa.drivers; }) ];
Note: Both of these approaches are impure and only work to a certain degree (many limitations!). If you want to use a different version of Mesa your best option is to use an overlay or a Git worktree where you use the same Nixpkgs revision and only alter pkgs/development/libraries/mesa/ for one of the two approaches mentioned above.
What does the note mean?
- Assistant
- User
Which way would be recommended for downgrading mesa? I want to run the vintagestory game but it keeps crashing with the newest version, and I've located a mesa version that might work.
- Assistant
- User
The mesa repository is in gitlab, does the fetchFromGitHub work there as well?
- Assistant
No,
fetchFromGitHubis specifically intended for repositories hosted on GitHub. For repositories hosted on GitLab, you should usefetchFromGitLabinstead.Example of Using fetchFromGitLab
If you want to fetch a specific version of Mesa from GitLab, your overlay file would look something like this:
self: super: { mesa = super.mesa.overrideAttrs (old: { version = "19.3.4"; # Replace with your desired version src = super.fetchFromGitLab { owner = "Mesa3D"; # Replace with the correct GitLab owner if different repo = "mesa"; # Replace with the name of the repo rev = "mesa-19.3.4"; # The tag, branch, or commit you want to fetch # Optionally, specify a sha256 for integrity checking: # sha256 = "..."; }; }); } - User
curl: (22) The requested URL returned error: 404 error: cannot download source from any mirror error: builder for '/nix/store/p1xzcn8wabwzkm55zak4d8jv6xj6ma15-source.drv' failed with exit code 1 error: 1 dependencies of derivation '/nix/store/lj14k8xxxqm730m9ci5kfz9y7fz3zxnv-mesa-23.3.6.drv' failed to build error: 1 dependencies of derivation '/nix/store/8majsls4g6kjvy7dy2k2l0dmfk0vzkj9-graphics-drivers.drv' failed to build error: 1 dependencies of derivation '/nix/store/zj8f18qvann4k8amyc48h2vb4qsdhf6r-graphics-driver.conf.drv' failed to build error: 1 dependencies of derivation '/nix/store/niv20ay2sj611rhhyzqzby3bpqlfnqi0-tmpfiles.d.drv' failed to build error: 1 dependencies of derivation '/nix/store/p20yb200i85rvdyqy3pzx4ljv9g4yr3z-etc.drv' failed to build error (ignored): error: cannot unlink '"/tmp/nix-build-xorg-server-21.1.16.drv-0/build/xorg-server-21.1.16"': Directory not empty error: 1 dependencies of derivation '/nix/store/x6cflffhnfxhpr6xw1yhqv4v0m53wnbq-nixos-system-foxtrot-25.05beta770807.a84ebe20c6bc.drv' failed to buildBut the URL should be correct:
self: super: { mesa = super.mesa.overrideAttrs (old: { version = "23.3.6"; # Replace with your desired version src = super.fetchFromGitLab { owner = "mesa"; # Replace with the correct GitLab owner if different repo = "mesa"; # Replace with the name of the repo rev = "mesa-23.3.6"; # The tag, branch, or commit you want to fetch # Optionally, specify a sha256 for integrity checking: # sha256 = "..."; }; }); } - Assistant
- User
The owner has been changed to mesa.
Still getting a 404. It's trying to fetch: https://gitlab.com/api/v4/projects/mesa/mesa/repository/archive.tar.gz?sha=mesa-23.3.6
- Assistant
- User
Ok I got it to work now, wrong domain.
Now I'm getting an error:
error: builder for '/nix/store/5nkbhggcnbgqn4lqc10fbm2y822ral8w-mesa-23.3.6.drv' failed with exit code 1 error: 1 dependencies of derivation '/nix/store/0y1cf008nj381hzi5w3cx90rf4h0y7xi-graphics-drivers.drv' failed to build error: 1 dependencies of derivation '/nix/store/d80prgpffaicsd64pps7drkh3j3zfy1d-graphics-driver.conf.drv' failed to build error: 1 dependencies of derivation '/nix/store/8ij14xff1n22bv93y3zay2px7j3hq6w4-tmpfiles.d.drv' failed to build error: 1 dependencies of derivation '/nix/store/ga77l4iiby86ipw5ifndfdhpp51218ka-etc.drv' failed to build error (ignored): error: cannot unlink '"/tmp/nix-build-xorg-server-21.1.16.drv-5/build/xorg-server-21.1.16"': Directory not empty error: 1 dependencies of derivation '/nix/store/m47lc0spf6pvgnpscq6mpnvvi5v2019p-nixos-system-foxtrot-25.05beta770807.a84ebe20c6bc.drv' failed to build - Assistant
- User
how to check current xorg-server version
- Assistant
To check the current version of the
xorg-serverinstalled on your NixOS system, you have a couple of options. Here are the most common methods:Method 1: Using
nix-envYou can use
nix-envto query the installed version ofxorg-server:nix-env -q --installed xorg-serverThis command will return the version of the
xorg-serverpackage that is currently installed in your user environment.Method 2: Using
nixos-rebuildIf you want to check the version that is defined in your system configuration, you can use the following command to see all installed packages, including :
- User
To me the line error (ignored): error: cannot unlink '"/tmp/nix-build-xorg-server-21.1.16.drv-6/build/xorg-server-21.1.16"': Directory not empty looks like it's drying to unlink the current xorg server version to change to an older one.
- Assistant
- User
I ran garbage collection and deleted everything in /tmp/nix-build* And still it's saying error (ignored): error: cannot unlink '"/tmp/nix-build-xorg-server-21.1.16.drv-0/build"': Directory not empty
- Assistant