This is the only changes I have made prior to successful rebuild.
When I run the rebuild I get:
sudo nixos-rebuild switch
[sudo] password for mike:
building Nix…
building the system configuration…
trace: warning: optionsDocBook is deprecated since 23.11 and will be removed in 24.05
error:
… while calling the ‘head’ builtin
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:820:11:
819| || pred here (elemAt values 1) (head values) then
820| head values
| ^
821| else
… while evaluating the attribute 'value'
at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:768:9:
767| in warnDeprecation opt //
768| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
769| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: The type `types.string` is deprecated. See https://github.com/NixOS/nixpkgs/pull/66346 for better alternative types.
Oh and any ideas about how to solve optionsDocBook warning?
Help needed.
Find where you declare an option that has a type of types.string or a container type that includes types.string and use a more appropriate type instead.
Hi, thanks for the reply. But I have nothing that relates to types.string or container type.
When I simply comment out the home-manager block as shown the problem disappears but no home manager. I have tried commenting out just the home.packages line but still causes an error. I have tried another Nix Starter config but this still throws an error.
Yep, apparently it’s a bug caused by a recent change to nixpkgs (that has already been resolved on the correct branch of home-manager): Nix build errors out Nixos unstable
Considering you’re having issues with home-manager, I would assume you made the exact same mistake as the OP in the other thread. If you use nixpkgs-stable, use home-manager stable, and vice versa.
Not only make sure to use the correct channel, but also to update it.
A lot of HM as a system module users with a channel based setup, have a lingering/stale HM channel as nixos-rebuild --update only updates the nixos channel, not the HM one.
So one should prefer updating through nix-channel --update
I had the same problem, when updating. My problem was that I used the emacs-overlay flake that had a older version of nixpkgs as input. You don’t seem to be using flakes so the issue is likely that you are using an version of nixpkgs incompatible with the current home-manager.
To resolve this you can either pin home-manager to an old version until you update your nixpkgs
or update nixpkgs.
It’s almost certainly an outdated home-manager in this case, since it is using types.string, which was deprecated in recent nixpkgs unstable; Therefore nixpkgs must be ahead of home-manager, either because the channel is following the stable branch or because only nixpkgs has been updated due to use of nixos-rebuild --upgrade as @NobbZ says. The real solution is likely something like this: