Is nix-lib-nmd missing from 23.11?

I have been trying to finally start using home-manager. I added it into my flake with:

{
  description = "Family Network";

  inputs = {
    # use master branch of the GitHub repository as input, this is the most common input format
    nixpkgs.url = "github:NixOS/nixpkgs/23.11";
    home-manager = {
      url = "github:nix-community/home-manager/release-23.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = { self, nixpkgs, home-manager }:
  let
    system = "x86_64-linux";
    pkgs = nixpkgs.legacyPackages.${system};
  in {

    nixosConfigurations = {
       ...
    };

    homeConfigurations = {

      defaultPackage.${system} = home-manager.defaultPackage.${system};

      genson = home-manager.lib.homeManagerConfiguration {
        inherit pkgs;

        modules = [
          ./homeConfigurations/genson.nix
        ];
      };
    };
  };
}

home-manager build --flake . produces:

error:
       … while calling the 'derivationStrict' builtin

         at /builtin/derivation.nix:9:12: (source not available)

       … while evaluating derivation 'home-manager-generation'
         whose name attribute is located at /nix/store/j8han9cf3g8vba52yhiklaa6a500pcbv-source/pkgs/stdenv/generic/make-derivation.nix:348:7

       … while evaluating attribute 'buildCommand' of derivation 'home-manager-generation'

         at /nix/store/j8han9cf3g8vba52yhiklaa6a500pcbv-source/pkgs/build-support/trivial-builders/default.nix:87:14:

           86|       enableParallelBuilding = true;
           87|       inherit buildCommand name;
             |              ^
           88|       passAsFile = [ "buildCommand" ]

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

       error: attribute 'nix-lib-nmd' missing

       at /nix/store/k2xlcibf7irlij5ahxl3w1fkfvq8nmc6-source/docs/default.nix:10:12:

            9|
           10|   nmdSrc = pkgs.nix-lib-nmd;
             |            ^
           11|

This doesn’t seem to happen when I use nixos-unstable as pkgs inside the homeManagerConfiguration. Of course, this has the potential to cause other problems since I am using the 23.11 version of home-manager.

You are using a tag pointing to the initial release of NixOS 23.11. Since 23.11 was released in November, the tag cannot contain the introduction of nix-lib-nmd, which has only been backported three days ago. nixos-23.11 is the branch you want to follow, see also Nixpkgs branches FAQ entry.

3 Likes

I was following the nixos-23.11 branch, but still faced the issue. Tried updating the channel also, did not work. Switching to release-23.11 fixed it for me.

As mentioned in the FAQ entry, the nixos-yy.mm lags slightly behind release-yy.mm because it only advances when quality is verified by tests. release-yy.mm is the working branch that people merge stuff into and occasional breakage that would be caught by the tests can manage to sneak into it (although hopefully less often than with master vs nixos-unstable).

If you want faster advances, you can also try the *-small variants of the channels, which perform less tests. Though I would recommend switching back to the more scrutinized nixos-yy.mm/unstable once the fix you want gets to the channel for better peace of mind.