Nixos fails to build: "optionsDocBook has been removed in 24.05"

When updating nixos it fails to build with the message that optionsDocBook has been removed. The thing is, I can not find optionsDocBook in my nix-config and have no idea, where this package is used.

Any idea what could cause this error?

Here some output of the build:


       … while evaluating derivation 'hm-module-docs-for-nmd'
         whose name attribute is located at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/stdenv/generic/make-derivation.nix:331:7

       … while evaluating attribute 'buildCommand' of derivation 'hm-module-docs-for-nmd'
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/build-support/trivial-builders/default.nix:68:17:
           67|         enableParallelBuilding = true;
           68|         inherit buildCommand name;
             |                 ^
           69|         passAsFile = [ "buildCommand" ]

       … while calling the 'concatStringsSep' builtin
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/build-support/trivial-builders/default.nix:539:9:
          538|       cd $out
          539|       ${lib.concatStrings linkCommands}
             |         ^
          540|     '';

       … while calling anonymous lambda
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/lib/attrsets.nix:1062:10:
         1061|     attrs:
         1062|     map (name: f name attrs.${name}) (attrNames attrs);
             |          ^
         1063|

       … from call site
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/lib/attrsets.nix:1062:16:
         1061|     attrs:
         1062|     map (name: f name attrs.${name}) (attrNames attrs);
             |                ^
         1063|

       … while calling anonymous lambda
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/build-support/trivial-builders/default.nix:525:16:
          524|       linkCommands = lib.mapAttrsToList
          525|         (name: path: ''
             |                ^
          526|           mkdir -p "$(dirname ${lib.escapeShellArg "${name}"})"

       … from call site
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/pkgs/build-support/trivial-builders/default.nix:527:19:
          526|           mkdir -p "$(dirname ${lib.escapeShellArg "${name}"})"
          527|           ln -s ${lib.escapeShellArg "${path}"} ${lib.escapeShellArg "${name}"}
             |                   ^
          528|         '')

       … while calling 'escapeShellArg'
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/lib/strings.nix:442:20:
          441|   */
          442|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                    ^
          443|

       … while calling the 'replaceStrings' builtin
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/lib/strings.nix:442:29:
          441|   */
          442|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                             ^
          443|

       … while evaluating the third argument passed to builtins.replaceStrings

       … while calling the 'toString' builtin
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/lib/strings.nix:442:61:
          441|   */
          442|   escapeShellArg = arg: "'${replaceStrings ["'"] ["'\\''"] (toString arg)}'";
             |                                                             ^
          443|

       … while evaluating the attribute '"nmd-result/home-manager-options.xml"'
         at /nix/store/f8fx3l4lwc03dlfzcgpklrnzjc9fa20g-source/docs/default.nix:100:9:
           99|       docBook = pkgs.linkFarm "hm-module-docs-for-nmd" {
          100|         "nmd-result/home-manager-options.xml" = hmOptionsDocs.optionsDocBook;
             |         ^
          101|         "nmd-result/nix-darwin-options.xml" =

       … while evaluating the attribute 'optionsDocBook'
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/nixos/lib/make-options-doc/default.nix:235:3:
          234|
          235|   optionsDocBook = throw "optionsDocBook has been removed in 24.05";
             |   ^
          236| }

       … while calling the 'throw' builtin
         at /nix/store/cb1gs888vfqxawvc65q1dk6jzbayh3wz-source/nixos/lib/make-options-doc/default.nix:235:20:
          234|
          235|   optionsDocBook = throw "optionsDocBook has been removed in 24.05";
             |                    ^
          236| }

       error: optionsDocBook has been removed in 24.05

That looks like a home-manager thing. So I’m guessing you just need to update home-manager, and make sure you’re using the right home-manager branch. You should use the master branch if you’re using nixos-unstable, or release-23.11 if you’re using nixos 23.11, etc.

2 Likes

Yes that’s it. I am on nixos unstable and the home-manager should be as well…
I guess some home-manager documentation is still written with openDocBooks.

When I force home-manager to build with the 23.11 release, i get a warning but the build is successful.

  Home Manager version 23.11 and
  Nixpkgs version 24.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.

This is to be expected, and is done to ensure compatibility. Otherwise all bets are off.

Home Manager has to keep up with Nixpkgs, where DocBook support was removed only recently: nixos/docs: remove docbook support machinery by pennae · Pull Request #296384 · NixOS/nixpkgs · GitHub
Your options:

  • Disable the warning and risk breakage on the next major release if you forget to enable it gain
  • Wait for Home Manager maintainers to catch up
  • Help the process with PRs
  • Use Home Manager 23.11 with Nixpkgs 23.11
  • Pin Nixpkgs to a revision before the removal of DocBook support
  • Locally patch DocBook support back in
2 Likes

Ok I think I understood… thanks a lot for the detailed explanation!