You’re installing NixOS 21.11, which is nearly 2 years out of date: https://github.com/JM445/config/blob/2e6e2666e2c83b7758656e5c7c532802ac9fe5da/nixdots/flake.nix#L5
You’ll have to do a distro upgrade. Fair warning, major releases are allowed to introduce breaking changes, and updating over 3 major releases will probably be a fair bit of work. You should read through the release notes of the last few versions: NixOS 23.05 manual | Nix & NixOS
You may want to do this incrementally, going over nixos-22.05
and nixos-22.11
as well, but you should ultimately change your inputs to:
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05";
home-manager = {
url = "github:nix-community/home-manager/release-23.05";
inputs.nixpkgs.follows = "nixpkgs";
};
};
After that, nix flake update
will in fact update your packages, until the next NixOS stable release, at which point you get to play this game again (just with much fewer breaking changes and fewer release notes to read).
Alternatively, you can install NixOS as a rolling release distro by using the unstable branches. Then you won’t need to do distro upgrades, and everything will always be very up-to-date, but you’ll probably run into breakage that prevents you from updating every once in a while.
FYI, while you can definitely use home-manager standalone, if you’re using NixOS and sync up the stable/unstable releases between the two anyway, you could also use the home-manager NixOS module, which saves you running a second command to update: Home Manager Manual
I say this especially because nix build .#homeManagerConfigurations…
will only create a result
directory with a profile that could hypothetically be installed as a home-manager setup, but not actually install it.
This is because nix-shell
is one of the old nix commands, which still use channels. If you look at nix-channel --list
, it will likely contain a channel pointing to NixOS 23.05.
If you intend to use flakes, I’d recommend removing that and any other channels (as well as the ones from sudo nix-channel --list
), and instead use the nix shell
command, which will use your flake registry, which you can in turn point at your system input. The nix flake registry will by default always use nixpkgs-unstable, hence you likely want to change that.
You can also make your flake set the nix path for backwards compatibility with non-flake commands like this.