Home Manager and Nixpkgs mismatched versions

Hello everyone,

I just set up home-manager as a module via flake and everything seems to work, but I get a warning everytime I run “sudo nixos-rebuild switch”:

evaluation warning: lain profile: You are using

                  Home Manager version 25.11 and
                  Nixpkgs version 25.05.

                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.

I tried following the suggestion and specified the home-manager release in my flake.nix:

{

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05";

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

  outputs = { self, nixpkgs, ... }@inputs: {

    nixosConfigurations.NAVI = inputs.nixpkgs.lib.nixosSystem {
      specialArgs = {inherit inputs;};
      modules = [
        ./configuration.nix
        inputs.home-manager.nixosModules.default
      ];
    };
  };
}

After sudo nix flake update and sudo nixos-rebuild switch I get a new error:

building the system configuration...
error:
   … while calling the 'head' builtin
     at /nix/store/hr5pl7m833kkr0zv98iydy7mxyl10qld-source/lib/attrsets.nix:1571:13:
     1570|           if length values == 1 || pred here (elemAt values 1) (head values) then
     1571|             head values
         |             ^
     1572|           else

   … while evaluating the attribute 'value'
     at /nix/store/hr5pl7m833kkr0zv98iydy7mxyl10qld-source/lib/modules.nix:1083:7:
     1082|     // {
     1083|       value = addErrorContext "while evaluating the option `${showOption loc}':" value;
         |       ^
     1084|       inherit (res.defsFinal') highestPrio;

   … while evaluating the option `system.build.toplevel':

   … while evaluating definitions from `/nix/store/hr5pl7m833kkr0zv98iydy7mxyl10qld-source/nixos/modules/system/activation/top-level.nix':

   … while evaluating the option `assertions':

   … while evaluating definitions from `/nix/store/a4la088hi5id7sw77gy9zdvwn83dgczz-source/nixos/common.nix':

   (stack trace truncated; use '--show-trace' to show the full, detailed trace)

   error: The option `home-manager.users.lain.programs.git.settings' does not exist. Definition values:
   - In `/nix/store/sxkw0l6qlfd043siqwlyljivw94vil6h-source/home.nix':
       {
         credential = {
           helper = "libsecret";
         };
         user = {
       ...

This didn’t happen when in the flake.nix home-manager url was set as url = "github:nix-community/home-manager";

My almost unmodified home.nix:

{ config, pkgs, ... }:

{
  home.username = "lain";
  home.homeDirectory = "/home/lain";

  home.stateVersion = "25.05"; # Please read the comment before changing.

  home.packages = [
  ];

  programs.git = {
    enable = true;
    package = pkgs.git.override { withLibsecret = true; };
    settings.user = {
        name  = "InOnesGraveDed";
        email = "myemail@disroot.org";
    };
    settings = {
      credential.helper = "libsecret";
    };
  };

  home.file = {
  };

  home.sessionVariables = {
  };

  programs.home-manager.enable = true;
}
1 Like

Everything is working as intended.

The error that you get is telling you that the option “programs.git.settings”, that you use, doesn’t exist. I just checked and indeed this option does not exist in release-25.05 of home manager.
It worked before because you used the recent unstable release that includes that option.

I hope this is clear. You have three options, ignore the warning and mix home manager unstable with nixos release 25.05, switch to unstable or remove that option.

1 Like

Oh, I see, thanks for clarification.
I was confused because the wiki specifies the 25.05 release, but then in the Usage section, it shows “programs.git.settings”. That seemed a bit misleading to me…

Clearly an oversight of the writer of that article. Thanks for pointing that out

1 Like

You should probably stick with 25.11 (unstable, for now) since 25.05 is going to be deprecated in a couple of weeks anyway.

2 Likes

I agree on sticking with unstable for now - it looks like release-25.11 will become available on the 25th as per the current schedule: NixOS 25.11 – Release schedule · Issue #443568 · NixOS/nixpkgs · GitHub