- Add comprehensive documentation for upgrading Home Manager channels. - Cover channel-based, flake-based, and NixOS module methods. - Include troubleshooting section and state version updates. - Update examples for NixOS 25.05 compatibility.
4.4 KiB
Upgrading to a new Home Manager release
Overview
When upgrading NixOS to a new major version (e.g., from 24.11 to 25.05), you also need to upgrade your Home Manager channel to maintain compatibility. This guide covers the proper steps to upgrade Home Manager channels for NixOS 25.05.
Understanding Home Manager Versioning
Home Manager follows NixOS release cycles and provides corresponding branches:
-
release-##.##: Stable branch for NixOS ##.## (current stable)
-
master: Development branch (tracks nixos-unstable)
:::{.note} Always use the Home Manager version that matches your NixOS version to avoid compatibility issues. :::
Channel-Based Installation (Traditional)
-
First, verify your current Home Manager channel:
$ nix-channel --listYou should see something like:
home-manager https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz -
Update the Home Manager channel to a NixOS 25.05 compatible version:
$ nix-channel --add https://github.com/nix-community/home-manager/archive/release-25.05.tar.gz home-manager $ nix-channel --update -
Apply the changes:
$ home-manager switch
Flake-Based Installation (Modern)
If you're using Home Manager with Nix flakes, update your flake.nix:
{
description = "Home Manager configuration";
inputs = {
# Increment release branch for NixOS
nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05";
home-manager = {
# Follow corresponding `release` branch from Home Manager
url = "github:nix-community/home-manager/release-25.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { nixpkgs, home-manager, ... }: {
homeConfigurations."yourusername" = home-manager.lib.homeManagerConfiguration {
pkgs = nixpkgs.legacyPackages.x86_64-linux;
modules = [ ./home.nix ];
};
};
}
Then update and rebuild. If you are using Home Manager standalone:
$ nix flake update
$ home-manager switch --flake .
And if you are using Home Manager as a NixOS module then you will need to update your system configuration instead and run
$ nix flake update
$ sudo nixos-rebuild switch
State Version Management
:::{.warning}
Careful updating your home.stateVersion when upgrading Home Manager.
:::
The stateVersion is best to remain set to the NixOS version you
first installed Home Manager
{
home.stateVersion = "24.11"; # Example: if you first installed on 24.11
}
Why? The stateVersion ensures backward compatibility and
prevents breaking changes from affecting your existing configuration.
Remember: Channel version is not the same as State version. Update
the channel, keep the stateVersion unchanged. Advanced users can
view the changes between releases and see if any of the stateVersion
changes will affect them and increment, if they migrate their
configurations to follow the changed evaluation.
Troubleshooting
Common Issues
Check the Home Manager Release Notes for breaking changes.
-
Version Mismatch Warning: If you see warnings about version mismatches, ensure your Home Manager version matches your NixOS version.
-
Module Changes: Modules are constantly being updated with new features to keep up with changes in upstream packaging or to fix bugs and add features. If you have an unexpected change, check if there was something noted in the release notes or news entries.
-
Channel Not Found: If
nix-channel --listshows no channels, you might be using a different installation method (like flakes or NixOS module).
Verification
After upgrading, verify the installation:
$ home-manager --version
This should show version 25.05 or indicate it's using the release-25.05 branch.