Cant update NVIDIA driver on stable branch

Thanks for the input, guys. I am trying @Brisingr05’s workaround (my system is now downloading and building a lot of stuff).

One noob question: How do you know what URL to use in the setting below?

the number is the commit hash of the Pull Request that fixed the nvidia issue, linuxPackages.nvidiaPackages: add common patch for new kernel releases by Kiskae · Pull Request #286058 · NixOS/nixpkgs · GitHub

You could also put a branch or tag name.

Normally you would have a branch name in there, i.e. nixos-unstable

Also glad to see my super hacky fix was useful, considering it was quoted here lol

2 Likes

OK, I understand. However, when I look at the referenced pull request, I only see two related commits.

I see f649a4a4b749bb2b55cc3a7afc815d8df9dd62db and ca149f54a9a89414388dd97c2334ad8b8ad2bc8b. I do not see 468a37e6ba01c45c91460580f345d48ecdb5a4db.

Am I looking at the wrong place?

1 Like

nah I cant find in anymore on there either. Maybe they added another commit or something idk. ima make sure my fix even still works rn XD

1 Like

you have to follow more links to find the specific one I used now…

You could use the most recent one in that pr too though, nothing special about the one I chose other than that it was after the patch

1 Like

Thanks again, @Birdee.

I found the commit you chose. Makes sense, any commit after the patch was implemented will do. So, I guess I could use the latest one from the list of all the commits. Very good to know, if I run into these type of issues again later.

Flakes are amazing for pinning like this.

I use it often for neovim plugins especially.

Btw if you use neovim, I made this :slight_smile:

You can do it with fetch functions as well but its more verbose

https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake.html#examples

This is where I got info of how to format URLs for flake inputs

1 Like

Thanks for the examples link. Neovim looks great. I am currently using VSCodium. If I feel brave enough for more new things, I might consider a switch. As a NixOS noob, still trying to get my system up and running, there is tons of information to figure out. I still have far more questions than answers.

1 Like

I started 3.5 months ago. I JUST figured out disko and installer isos lol

1 Like

Well done! It seems like you have learned a lot in that short period of time. My NixOS birthday was on January 29th, one week ago. Flakes and Overlays feels Greek to me. Have been stuck for a while now due to this NVIDIA issue. Had never heard about Disko before you mentioned it. Sounds smart as well. Ideally, I will manage to use NixOS to easily set up three different computers, so “script installers” (if that is an expression) is something I have to look into as well.

Well, I guess I should not clutter up this thread. I see a Discourse message telling me to consider writing DMs instead.

Anyhow, my system is still building. Hopefully, it will work when it is done. As well, maybe the PR / code change will be deployed soon. Then, I guess another build is needed.

1 Like

Overlays just cause a new pkgs object to be returned and used instead which contains whichever things the overlay adds to it.

(self: super: { jq = super.jq; })

This overlay, for example, would replace jq with itself lol

You would then either put it in a list and pass it to overlays when creating a new pkgs, or when using the nixpkgs.overlays module option used in the nvidia fix posted above (careful with the module option, it can lead to infinite recursion as it needs to be sequenced to happen before anything needs the pkgs, adding it when creating the pkgs option is preferred).

the two arguments for overlays are either called self: super: or final: prev: by convention and are the new and old pkgs sets before and after the overlay is called.

And flakes are just an agreed upon set of outputs (i.e. packages.${system} or nixosConfigurations), and a way to explicitly say where you are importing your nix channel from, as well as defining a way of importing things slightly nicer than fetch functions while still making sure everything is locked appropriately and still updatable either atomically or all at once.

They have inputs and outputs, (outputs is a function that recieves the things in inputs and a self variable and returns outputs of the agreed upon format) and a description.

The format is what allows the nicer command line syntax, because the cli has targets it can now look for.

The inputs are what allows for the lockfile, as now it knows what to put in the lockfile

The fetch functions are already locked because you need to put the hash. So those are locked by default, and not being in inputs is not an issue. anything fetched from the channel is locked to the version of the channel in the lockfile because thats the version of the channel you imported.

This makes importing from multiple channels very easy, and makes synchronizing your channels between machines, as well as between nixos and home manager, much easier, as now they are in the lock file and do not need to be configured via external commands.

As far as script installers go, I havent figured out remote provisioning yet, but my system flake I linked outputs an iso installer that you can generate, burn to usb, and then install via 1 command (or 2 commands if the target disk isnt /dev/sda), with an ease of use alias defined within the iso so that the 1 or 2 commands are shorter and easier to type. So maybe that will be a good example for you.

mine is x86_64-linux only so no vms yet but Im pretty sure you could just change the system variable to “i686-linux” and it would work in a vm? Figuring out that part soon. You would also probably have to regenerate hardware config within the vm first and then delete the nvidia stuff from the system config you chose because you dont have the same computer and stuff so it might be a couple more than 1 command depending on circumstances XD but for the hardware its designed for, its 1 command XD I will be making a separate vm config for it soon that should just work rather than needing to do all that.

Once again, thanks for your reply. To keep things tidy I created a new post:

And, I created this for Flakes:

As far as script installers go …

Thanks! I have saved the link.

By the way, the build process, using your mentioned solution, worked well!

I dont know how to on my end, but this can be closed now as Hydra has built the fix and it works.

https://nixpk.gs/pr-tracker.html?pr=286058

Its only in nixpkgs-unstable its not in nixos-unstable yet