I have a local version of nixpkgs and I want to change mesa to have this: [code] instead…
- User
I have a local version of nixpkgs and I want to change mesa to have this:
pname = "mesa"; version = "25.0.0"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; owner = "mesa"; repo = "mesa"; rev = "mesa-${version}"; hash = "sha256-9D4d7EEdZysvXDRcmpbyt85Lo64sldNRomp6/HUVORo="; };instead of 25.0.1
How do I use this in my own configuration?
- Assistant
To override the
mesapackage version in your local Nix setup, you can create an overlay. An overlay allows you to modify packages or add new ones without altering the originalnixpkgs. Here's how you can do it:-
Create an Overlay File: Create a file named
mesa-overlay.nix(or any name you prefer) in your working directory. The contents of the file should look like this:
-
- User
Is it not possible to use the nixpkgs in my local machine already?
- Assistant
Yes, you can absolutely use the local version of
nixpkgsthat you already have on your machine. This is a common practice in Nix for customizing packages or experimenting with different versions. Here's how to do it: - User
But I already made the changes in my local nixpkgs:
$ git diff diff --git a/pkgs/development/libraries/mesa/common.nix b/pkgs/development/libraries/mesa/common.nix index 23e5104ffcf6..28b69a0f134d 100644 --- a/pkgs/development/libraries/mesa/common.nix +++ b/pkgs/development/libraries/mesa/common.nix @@ -5,7 +5,7 @@ # nix build .#legacyPackages.x86_64-darwin.mesa .#legacyPackages.aarch64-darwin.mesa rec { pname = "mesa"; - version = "25.0.1"; + version = "25.0.0"; src = fetchFromGitLab { domain = "gitlab.freedesktop.org"; - Assistant