Incomprehensible error

Hi everyone,

alias rebuild=‘sudo nixos-rebuild switch’

 ▶ rebuild
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:1575:11:

         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'

         at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:821:9:

          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

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

       error: attribute 'inputs' missing

       at /nix/var/nix/profiles/per-user/root/channels/nixos/lib/modules.nix:520:28:

          519|         addErrorContext (context name)
          520|           (args.${name} or config._module.args.${name})
             |                            ^
          521|       ) (functionArgs f);

Can you show us your configuration? Looks like you put inputs in your module args somewhere, probably copied from someone using flakes, but never actually add inputs to the module args. It’s a bit odd that there’s no cleaner reference to the error location, so perhaps an inline module somewhere?

# Edit this configuration file to define what should be installed on
# your system.  Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).

{ config, pkgs, ... }:

{
  imports =
    [ # Include the results of the hardware scan.
      ./hardware-configuration.nix
      #./gnome.nix
      ./user.nix
      ./dbus.nix
      ./fonts.nix
      ./gnome-keyring.nix
      ./hyprland.nix
      ./pipewire.nix
      ./wayland.nix
      ./x11.nix
    ];

  # Bootloader.
  boot.loader.grub.enable = true;
  boot.loader.grub.device = "/dev/sda";

  boot.kernelPackages = pkgs.linuxPackages_latest;

  networking.hostName = "nixos"; # Define your hostname.
  networking.networkmanager.enable = true;

  # Set your time zone.
  time.timeZone = "Europe/Paris";

  # Select internationalisation properties.
  i18n.defaultLocale = "en_US.UTF-8";

  i18n.extraLocaleSettings = {
    LC_ADDRESS = "en_US.UTF-8";
    LC_IDENTIFICATION = "en_US.UTF-8";
    LC_MEASUREMENT = "en_US.UTF-8";
    LC_MONETARY = "en_US.UTF-8";
    LC_NAME = "en_US.UTF-8";
    LC_NUMERIC = "en_US.UTF-8";
    LC_PAPER = "en_US.UTF-8";
    LC_TELEPHONE = "en_US.UTF-8";
    LC_TIME = "en_US.UTF-8";
  };

  # Enable VirtualBox Guest Additions
  virtualisation.virtualbox.guest.enable = true;

  # SYSTEM
  system.autoUpgrade.enable = true;
  system.autoUpgrade.allowReboot = true;
  system.autoUpgrade.channel = "https://https://nixos.org/channels/nixos-unstable"; 
  environment.systemPackages = with pkgs; [
  vim wget curl git fastfetch htop gparted kitty
  ];

  # Some programs need SUID wrappers, can be configured further or are
  # started in user sessions.
  # programs.mtr.enable = true;
  # programs.gnupg.agent = {
  #   enable = true;
  #   enableSSHSupport = true;
  # };

  # List services that you want to enable:

  # Enable the OpenSSH daemon.
  # services.openssh.enable = true;

  # Open ports in the firewall.
  # networking.firewall.allowedTCPPorts = [ ... ];
  # networking.firewall.allowedUDPPorts = [ ... ];
  # Or disable the firewall altogether.
  # networking.firewall.enable = false;

  # This value determines the NixOS release from which the default
  # settings for stateful data, like file locations and database versions
  # on your system were taken. It‘s perfectly fine and recommended to leave
  # this value at the release version of the first install of this system.
  # Before changing this value read the documentation for this option
  # (e.g. man configuration.nix or on https://nixos.org/nixos/options.html).
  system.stateVersion = "24.11"; # Did you read the comment?

  nix.settings.experimental-features = [ "nix-command" "flakes" ];

}


perhaps
hyprland.nix :

{ inputs, pkgs, lib, ... }: let
  pkgs-hyprland = inputs.hyprland.inputs.nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
{
 ▶ ls
Permissions Size User Date Modified Name
drwxr-xr-x     - root 30 Aug 09:32  ./
drwxr-xr-x     - root 30 Aug 09:31  ../
.rw-r--r--  1.8k root 30 Aug 08:27  configuration.nix
.rw-r--r--   141 root 29 Aug 16:37  dbus.nix
.rw-r--r--   567 root 30 Aug 08:24  flake.lock
.rw-r--r--   288 root 30 Aug 08:29  flake.nix
.rw-r--r--    73 root 29 Aug 16:38  gnome-keyring.nix
.rw-r--r--   479 root 29 Aug 17:02  gnome.nix
.rw-r--r--  1.2k root 28 Aug 20:29  hardware-configuration.nix
.rw-r--r--   224 root 29 Aug 21:00  pipewire.nix
.rw-r--r--   661 root 29 Aug 20:58  user.nix
.rw-r--r--   617 root 29 Aug 21:02  wayland.nix
.rw-r--r--   437 root 30 Aug 09:32  x11.nix

abandoned returned to Gnome, trying to install Hyprland.

Yep, for that to work you would need to use flakes, and import the upstream module. Just use the NixOS module instead, there’s no reason to overcomplicate this with an external dependency: NixOS Search

1 Like