Can't rebuild nixos error: … while calling the 'head' builtin

Okay so I was configuring my home-manager config and for some reason after I updated, I got the following error:

sudo nixos-rebuild switch --upgrade
unpacking 3 channels... building Nix... building the system configuration...
error: … while calling the 'head' builtin at
/nix/var/nix/profiles/per-user/root/channels/nixos/lib/attrsets.nix:1:35787: …
while evaluating the attribute 'value' at
/nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:1:33591: …
while evaluating the option `system.build.toplevel':

        … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/activation/top-level.nix':

        … while evaluating the option `warnings':

        … while evaluating definitions from `/nix/var/nix/profiles/per-user/root/channels/nixos/nixos/modules/system/boot/systemd.nix':

        … while evaluating the option `systemd.services.home-manager-"${user}".serviceConfig':

        … while evaluating definitions from `/home/"${user}"/Home/repos/home-manager/home.nix':

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

        error: 'utillinux' has been renamed to/replaced by 'util-linux'

Ignore “${user}” it’s just so I can hide my name.

At first I thought it was util-linux so I decided remove remove it from my nix module and from the nix-ld list. Thing is that did nothing upon rebuilding again. I removed every package from the module and it still did nothing, I even removed home-manager. So I decided to reinstall after a couple (and I mean a couple) of tries.

After that I came down to the conclusion that it most definetly wasn’t the OS lmao.

After that I removed all other packages from my config, and I realized that it most definetly was not home-manager and my other packages, but some how nix-ld was was messing up something upon loading “util-linux” here’s my nix-ld:


...

# Enable nix ld
 programs.nix-ld = {
   enable = true;

   # Sets up all the libraries to load
   libraries = with pkgs; [
    stdenv.cc.cc

    gnutls

    <more libs and packages>

    outils
    dnsutils
    #util-linux ← As you can see I commented it out and it still gives me problems :/
    poppler_utils
    xfce.libxfce4ui
    xfce.libxfce4util
    qemu-python-utils
    xfce.xfce4-dev-tools

    lxqt.lxqt-policykit

    ncurses
    nodejs_20
    electron_30
    nodepy-runtime
    python312Packages.nodepy-runtime
   ];
 };
 #END

It’s definetly me doing something wrong I just don’t know exactly what. If you
guys can push me to the right direction I would appreciate it.

1 Like

Ah, well thanks for the response. Now I feel a tad silly :confused: