Home Manager complaining about nixpkgs version mismatch

I recently discovered I wasn’t updating all of my flakes, which caused some errors as things evolved. But now that I update all flakes, I’m getting a new warning.

Previous command: nix flake lock --update-input nixpkgs .
Current command: nix flake update .

This causes a warning about a version mismatch between Home Manager and nixpkgs:

warning: updating lock file '/home/nairou/.persist/home-manager/flake.lock':
• Updated input 'home-manager':
    'github:nix-community/home-manager/d82c9af8175878a461a0fdf914e67cc446664570' (2023-04-26)
  → 'github:nix-community/home-manager/9f82227b64245c273d98dd02dedd44fc7576041e' (2023-05-30)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/3005f20ce0aaa58169cdee57c8aa12e5f1b6e1b3' (2023-05-20)
  → 'github:nixos/nixpkgs/5e871d8aa6f57cc8e0dc087d1c5013f6e212b4ce' (2023-05-29)
• Updated input 'nixvim':
    'github:pta2002/nixvim/079b0c30cde91a735a7a1707ed6bf2571a1c93cc' (2023-05-07)
  → 'github:pta2002/nixvim/cf6a614e8b89eea8f989ef6103debe65984a1fd5' (2023-05-29)
• Updated input 'nixvim/pre-commit-hooks':
    'github:cachix/pre-commit-hooks.nix/fb58866e20af98779017134319b5663b8215d912' (2023-04-27)
  → 'github:cachix/pre-commit-hooks.nix/61e567d6497bc9556f391faebe5e410e6623217f' (2023-05-23)
• Updated input 'zig':
    'github:mitchellh/zig-overlay/25ea43b1d64b93523f2463738b9308a07af530df' (2023-04-29)
  → 'github:mitchellh/zig-overlay/d5a84c5a51ae76b862492224b12f8abe35efabba' (2023-05-30)
trace: warning: You are using

  Home Manager version 23.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 than corresponds with your chosen release of Nixpkgs.

If you insist then you can disable this warning by adding

  home.enableNixpkgsReleaseCheck = false;

to your configuration.

No errors, but still I’d like to resolve the warning. I’ve still got stateVersion = "22.11" in my NixOS and Home Manager configurations, so I don’t know where the “23.05” and “23.11” versions come from. I do use nixpkgs-unstable for both, but I’d have expected those to stay relatively in sync.

What would cause these versions to update, and why would there now be a mismatch?

Either you are using the 23.05 branch in your flake’s inputs as url for home-manager or home-manager hasn’t yet fully caught up with the recent branch-off of NixOS 23.05.

In any case, this is unrelated to stateVersion, which is used to detect any breaking changes before an update.

1 Like

seems like home-manager just has an outdated release version

1 Like

Yeah, I hope to finish the master and release-23.05 branches during my commute home today.

2 Likes

@nairou Please give it another try. Hopefully I managed to set the branches up correctly.

1 Like

That did the trick! Warning messages are gone. Thank you!

Sorry, to bump an old post.

But, running into the same problem with nixpkgs-23.11 and home-manager 24.05

@KotUW This is the intended behaviour.You shouldn’t mix home-manager 24.05 with nixpkgs 23.11.

Thanks for replying,

My flake looks good to me. https://github.com/KotUW/dotfiles-homeManager/blob/84e53cccba483b2ff0871b7b64b622886043e16c/flake.nix

The flake was generated by following the install instructions in home-manager manual (Home Manager Manual)[here]

That should be:

inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";
    home-manager = {
      url = "github:nix-community/home-manager/release-23.11";  # this selects the release-branch and needs to match Nixpkgs
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
8 Likes

I have NixOS 23.11 and installed home-manager by simply adding it to environment.systemPackages.

How do I get rid of this warning?

Use one of the supported installation methods: Home Manager Manual

I experienced the same warning too.

$ nix-shell --packages nix-info --run "nix-info --host-os --markdown --sandbox"
 - system: `"x86_64-darwin"`
 - host os: `Darwin 24.0.0, macOS 10.16`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.24.9`
 - channels(root): `"home-manager-24.05.tar.gz, nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
trace: warning: You are using

  Home Manager version 24.05 and
  Nixpkgs version 24.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.
$ nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"24.11pre694416.ccc0c2126893"
$
$ home-manager --version
24.05
$
$ nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/release-24.05.tar.gz

Update: The warning message is not appearing after using the following steps. According to the documentation, we use the appropriate Home Manager channel.

$ nix run home-manager/release-24.05 -- uninstall
This will remove Home Manager from your system.
Really uninstall Home Manager? [y/n] y
Switching to empty Home Manager configuration...
Home Manager is uninstalled but your home.nix is left untouched.
$
$ rm --force --recursive --verbose ~/.config/home-manager
$
$ nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
$ nix-channel --update
$ nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/master.tar.gz
$
$ nix-shell '<home-manager>' --attr install
$

If we are following Nixpkgs master or an unstable channel, use the following steps.

nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
nix-channel --update

Hi,

New to NixOS and I’ve hit this problem too.

# nixos-rebuild switch
building the system configuration...
evaluation warning: user profile: You are using

                      Home Manager version 25.05 and
                      Nixpkgs version 24.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.
activating the configuration...
setting up /etc...
reloading user units for user...
restarting sysinit-reactivation.target
the following new units were started: run-credentials-systemd\x2dtmpfiles\x2dresetup.service.mount, sysinit-reactivation.target, systemd-tmpfiles-resetup.service

I installed home-manager with the instructions from the manual for standalone installation and the versions appear to match…

# home-manager --version
24.11-pre

# nix-instantiate --eval -E '(import <nixpkgs> {}).lib.version'
"24.11pre-git"

Configuration

flake.nix

{
  description = "NixOS configuration";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

  outputs = inputs@{ nixpkgs, home-manager, ... }: {
    nixosConfigurations = {
      crow = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ./configuration.nix
          home-manager.nixosModules.home-manager
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.users.neil = import ./home.nix;

            # Optionally, use home-manager.extraSpecialArgs to pass
            # arguments to home.nix
          }
        ];
      };
    };
  };
}

configuration.nix

# grep stateVersion configuration.nix home.nix | grep -v man
configuration.nix:  system.stateVersion = "24.11"; # Did you read the comment?
home.nix:  home.stateVersion = "24.11";

Channels

# nix-channel --list
home-manager https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz
nixos https://nixos.org/channels/nixos-24.11

Attempted solution

I tried the suggestion from @wamserma of explicitly adding the release-24.11.tar.gz to thehome-manager.url variable in flake.nix

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
    home-manager.url = "github:nix-community/home-manager/release-24.11";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";
  };

…but on nixos-rebuild switch this errored with…

# nixos-rebuild switch
error:
       … while updating the lock file of flake 'path:/etc/nixos?lastModified=1734159914&narHash=sha256-S5Om5ONz1CJ41Ju8D4HKxt6ptO%2BwU1vzu9Tf0KirwmE%3D'

       … while updating the flake input 'home-manager'

       … while fetching the input 'github:nix-community/home-manager/release-24.11'

       error: opening Git repository '"/home/user/.cache/nix/tarball-cache"': repository path '/home/user/.cache/nix/tarball-cache' is not owned by current user

If I’ve read and understood the solution @sheeeng has posted at the time they needed to switch from the home-manager 24.05 channel to master to move onto 24.11. I somehow have picked up 25.05 of home-manager though and wish to move back to 24.11 but from my naive understanding my configuration already points to that.

Ooops, I posted the wrong error message (its one I’m now seeing though).

I have encountered the mismatch though and see…

trace:  warning: you are using

  Home Manager version 25.05 and
  Nixpkgs version 24.11.

Using mismatch versions is likely to cause errors and unexpected
behavior. It is therefore highly recommended to use a release of 
Home Manager that corresponds to your chosen release of Nixpkgs.

If you insist then you can disable this warning by adding

  home.enableNixpkgsReleaseCheck = false;

to your configuration.

I don’t see what’s wrong with the code provided.
However two inputs:

  • You don’t need channels if you use flakes. I would remove them so that you have one less variable.
  • Why did you install home-manager standalone and not as a NixOS module?
1 Like

Thanks @Nebucatnetzer I ended up starting afresh as I’d forgotten to LUKS encrypt my drives which I wanted. Still have the same error on version mismatch though

Just starting out so making lots of rudimentary errors so will correct the issues you’ve pointed, thank you.

  • You don’t need channels if you use flakes. I would remove them so that you have one less variable.

I think I added the channel as I hadn’t understood that this is done automatically when implemented in the configuration.

  • Why did you install home-manager standalone and not as a NixOS module?

Again, an elementary error, will re-read the documentation double check I’ve corrected that.

:+1: