I was installing home-manager and I received this warning:
trace: **warning: You are using**
**Home Manager version 24.05 and**
**Nixpkgs version 23.11.**
**Using mismatched versions is likely to cause errors and unexpected**
**behavior. It is therefore highly recommended to use a release of Home**
**Manager that corresponds with your chosen release of Nixpkgs.**
**If you insist then you can disable this warning by adding**
**home.enableNixpkgsReleaseCheck = false;**
**to your configuration.**
How can I install the version 24.05 of the nixpkgs? I am using MacOS
Most likely this means nix-channel --update (updates all channels), since not knowing how likely means you’ve also not learned about flakes or niv or anything.
After I updated nix using sudo -i sh -c 'nix-channel --update && nix-env --install --attr nixpkgs.nix && launchctl remove org.nixos.nix-daemon && launchctl load /Library/LaunchDaemons/org.nixos.nix-daemon.plist' I updated my nixpkgs to version 24.05:
joao@Joaos-MacBook-Pro ~ % sudo nix-channel --list
Password:
**warning:** $HOME ('/Users/joao') is not owned by you, falling back to the one defined in the 'passwd' file ('/var/root')
nixpkgs https://nixos.org/channels/nixpkgs-unstable
Make sure you have a working Nix installation. Specifically, make sure that your user is able to build and install Nix packages. For example, you should be able to successfully run a command like nix-instantiate '<nixpkgs>' -A hello without having to switch to the root user. For a multi-user install of Nix this means that your user must be covered by the allowed-users Nix option. On NixOS you can control this option using the nix.settings.allowed-users system option.
and I verified now that I can not successfully run nix-instantiate '<nixpkgs>' -A hello in my normal user:
joao@Joaos-MacBook-Pro ~ % nix-instantiate '<nixpkgs>' -A hello
error:
… while evaluating a branch condition
at /nix/store/81d6lv96pws78iijmmsra5ql8wxgb1cb-nixpkgs/nixpkgs/pkgs/stdenv/booter.nix:99:7:
98| thisStage =
99| if args.__raw or false
| ^
100| then args'
… in the right operand of the update (//) operator
at /nix/store/81d6lv96pws78iijmmsra5ql8wxgb1cb-nixpkgs/nixpkgs/pkgs/stdenv/booter.nix:84:7:
83| { allowCustomOverrides = index == 1; }
84| // (stageFun prevStage))
| ^
85| (lib.lists.reverseList stageFuns);
(stack trace truncated; use '--show-trace' to show the full trace)
error: cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Connection refused
But I don’t think this is the reason for the version problem. Following the manual I should install other version of home-manager, for now I will uninstall the home-manager and later I will install the home-manager following the nixpkgs version.
In this case the correct is to install home-manager following nixpkgs version or can I update nixpkgs to follow the home-manager version?
joao@Joaos-MacBook-Pro ~ % nix-instantiate '<nixpkgs>' -A hello
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/vg2kr2hqr1b95s0wjz6nlaakh6vdsfaz-hello-2.12.1.drv
And installed it again the master version because I am using unstable nixpkgs and it works even though I am not using the exactly same version of home-manager and Nixpkgs I did not received the warning
Thank you @TLATER and @NobbZ