Unfree stopped working with 25.05

In the process of migrating my config to 25.05, my unfree package config stopped working. On 24.11 I’m able to use unfree packages but the same config fails on 25.05.

Here’s my 24.11 flake.nix and my 25.05 flake.nix.

Do not pass pkgs to nixosSystem nor via specialArgs, instead use the nixpkgs options in your configuration.

That didn’t work unfortunately. I think the issue is with nix-darwin actually.

I do not see any changes in your repo.

Believe me, it works.

It’s definitely not an issue of trust. I’ve pushed the change I tried and it made no difference. I think the issue is with nix-darwin actually.

Are you on a Linux machine or a darwin one? And what is the exact command you ran and the exact error you got?

I’m on a Darwin one now. I don’t have that Linux one anymore.

I ran nix run nix-darwin/nix-darwin-25.05#darwin-rebuild – switch`

I think the nix config change you said would work for Nix OS machines. I just need to figure out how to do the same for nix-darwin. The darwinConfigurations module doesn’t have a nixpkgs attribute, if you catch my drift.

What error are you getting?

https://paste.sr.ht/~ananth/462fc526ec897562945b0f56f67fa34519aba9a7

The same config works with 24.11. It stopped working when I tried upgrading to 25.05.

https://git.sr.ht/~ananth/machines/tree/25.05/item/flake.nix#L45

I said to not instantiate nixpkgs yourself.

If you have to pass a nixpkgs instance to Darwin systems, pass the legacy packages output for your system.

Then use the nixpkgs options to configure nixpkgs as passed via the modules arguments.

Also the way you set up nixvim is borked. It is very likely not receiving the correct instance of nixpkgs.

1 Like

I removed the nixpkgs instantiation.

Then use the nixpkgs options to configure nixpkgs as passed via the modules arguments.

I’m not able to figure this out though.

Also the way you set up nixvim is borked. It is very likely not receiving the correct instance of nixpkgs.

What’s wrong with it?

You are not using the module system properly.

What did you do?

I removed nixpkgs init from flake.nix. I’m importing the hosts/darwin.nix module in my darwinConfigurations for each machine. So I tried setting the nixpkgs option in there. That didn’t work. I also set it in my home/darwin.nix which is imported by the home manager module. That also didn’t work.

All these changes in the 25.05 branch via this commit: https://git.sr.ht/~ananth/machines/commit/2e36fa06f0f338784509c4d73abfc3ebe9525f87.

What exactly do you mean by “doesn’t work”?

I think Home - nixvim docs is related to your problem.

You will very likely have to use the nixpkgs.useGlobalPackages provided by nixvim, alternatively (if they rpovide such an option) nixpkgs.allowUnfree. It is important to do that in nixvim based on the “breaking changes” I linked.

This is just random guessing though, as I refuse to use nixvim, I consider it is the wrong kind of abstraction.

If you want to configure neovim, use vimscript or lua…

Nixvim is working fine. I only brought it up because you told me I had done the initialisation wrong.

My main issue that is unsolved is that after updating to nix 25.05 nix rebuild complains about unfree not being enabled on nix-darwin.

I tried doing what you suggested with my limited Nix knowledge, and it didn’t work.

In the error you pasted somewhere, it complained about unfree being unset for a Copilot thing you have referenced through your nixvim configuration.

So it is very likely related to the fact, that nixvim creates its own insance of nixpgks, which you have to configure yourself again or force to use the global instance.

Older versions of nixvim did not do that, but instead just inherited what you used in the system, including the config. That is why I linked the section about “breaking changes”.

This is a nixvim issue, not a nix-darwin or nixpkgs issue.

Ah okay I get it. So my main config is in fact fine. I’ll take a look at the docs. Thank you!

@NobbZ that worked. Thank you so much!