Error: attribute 'inputs' missing

  error: attribute 'inputs' missing
  at .../lib/modules.nix:621:66:
fulError
error:
       … while evaluating the attribute 'activationPackage'
         at /home/yakatze/.nix-defexpr/channels/home-manager/modules/default.nix:1:1164:
       … while evaluating a branch condition
         at /nix/store/sz6hhgiffszv5v700si1857l4ssd4w5b-source/lib/lists.nix:142:18:
          141|       len = length list;
          142|       fold' = n: if n == len then nul else op (elemAt list n) (fold' (n + 1));
             |                  ^
          143|     in

       … while evaluating the option `assertions':

       … while evaluating definitions from `/home/yakatze/.nix-defexpr/channels/home-manager/modules/programs/yazi.nix':

       … while evaluating the option `programs.yazi.plugins':

       … while evaluating definitions from `/home/yakatze/.config/home-manager/modules/app/yazi.nix':

       … while evaluating the module argument `inputs' in "/home/yakatze/.config/home-manager/modules/app/yazi.nix":

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

       error: attribute 'inputs' missing
       at /nix/store/sz6hhgiffszv5v700si1857l4ssd4w5b-source/lib/modules.nix:621:66:
          620|       extraArgs = mapAttrs (                                                                            621|         name: _: addErrorContext (context name) (args.${name} or config._module.args.${name})
             |                                                                  ^
          622|       ) (functionArgs f);
fleke
{
  description = "tlater's dotfiles";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager/release-24.11";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    yazi-plugins = {
      url = "github:yazi-rs/plugins";
      flake = false;
    };

    ghostty.url = "github:ghostty-org/ghostty";

  };
  

outputs =
    { self, nixpkgs, home-manager, ... }@inputs:
    {
      nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
          system = "x86_64-linux";
          modules = [
            { home-manager.extraSpecialArgs = specialArgs; }
            { nixpkgs.config.allowUnfree = true; }
            ./nix/configuration.nix
          ];
      };

      homeConfigurations.yakatze = home-manager.lib.homeManagerConfiguration {
        pkgs = nixpkgs.legacyPackages."x86_64-linux";
        modules = [ ./home/home.nix ];
        extraSpecialArgs = {inherit inputs;};
      };

    };

}

yazi.nix
{ inputs, ... }:
{
  programs.yazi = {
    enable = true;
    enableZshIntegration = true;

    settings = {
      manager = {
        linemode = "size";
        show_hidden = true;
        show_symlink = true;
        sort_by = "natural";
        sort_dir_first = true;
        sort_reverse = false;
        sort_sensitive = false;
      };
    };

    plugins = {
      full-border = "${inputs.yazi-plugins}/full-border.yazi";
    };
  };

  xdg.configFile."yazi/init.lua".text = ''
    require("full-border"):setup()
  '';
}

Did you pass the --flake <installable> flag to home-manager?

I experienced similar error when configuring NixOS. It took me a day and a half finding out why the whole thing stopped working.

But I don’t understand, can you show how and where this is supposed to look?

Can you please share the full flake, not just some files?

The linked flake is different from the excerpts you posted above.

In the OP the error suggests that you are using HM standalone, though the linked flake seems to not use HM at all.

Can you please clarify what you are using and what the current problem/error is?

Oh, right, sorry — I forgot. The GitHub repository contains the current version of what I’m using at the moment.


I’m currently having trouble deciding which NixOS version to use — 24.11 or unstable.

I’m trying to set up Home Manager using flakes. At first, I tried this method in flake.nix:

# --- home-manager? ---
#homeConfigurations.yakatze = home-manager.lib.homeManagerConfiguration {
#  pkgs = nixpkgs.legacyPackages."x86_64-linux";
#  modules = [ ./home/home.nix ];
#  extraSpecialArgs = { inherit inputs; };
#};

But I didn’t really like this approach because I had to manually copy all the files from home into ~/.config/home-manager every time to make it work. It felt inconvenient and not flexible.

So I decided to try a different approach and created a user.nix module at nix/home/modules/user.nix:

{
  pkgs,
  inputs,
  username,
  ...
}:
{
  imports = [ inputs.home-manager.nixosModules.home-manager ];

  home-manager = {
    useUserPackages = true;
    useGlobalPkgs = true;
    extraSpecialArgs = { inherit inputs username; };
    users.${username} = {
      imports = [ ./../home ];
      home.username = "${username}";
      home.homeDirectory = "/home/${username}";
      home.stateVersion = "24.05";
      programs.home-manager.enable = true;
    };
  };

  users.users.${username} = {
    isNormalUser = true;
    description = "${username}";
    extraGroups = [ "networkmanager" "wheel" ];
    shell = pkgs.zsh;
  };

  nix.settings.allowed-users = [ "${username}" ];
}

I’m not sure if it’s actually working properly.

I also have some aliases defined in home/modules/app/shell.nix:

rb = "sudo nixos-rebuild switch --flake";
upd = "nix flake update";
upg = "sudo nixos-rebuild switch --upgrade --flake";
hms = "home-manager switch --flake";

But the problem is that I can’t run sudo nixos-rebuild switch --flake or home-manager switch --flake normally. Even after removing the aliases, the issue persists, so I guess the problem isn’t with the aliases.

Does anyone know what might be going wrong? Or how I can debug this?


Why?

I am using HM standalone with a flake, and ~/.config/home-manager doesn’t exist for me, it just works…

Looks like a proper approach for HM as a system module.

Why not? What does error?

You are not supposed to use home-manager when using HM as a system module.

But when I run home-manager switch, if the ~/.config/home-manager directory doesn’t exist, it tells me to create it.

How? — how are you making it work without ~/.config/home-manager?

home-manager switch --flake github:nobbz/nixos-config or home-manager switch --flake ., depending on whether I want to apply the canonical config as currently stored on GH or the one I am developing locally.

And again here is no --flake, --flake and the following flake reference are important to tell HM where to find stuff.

~ home-manager switch --flake
/home/yakatze/.nix-profile/bin/home-manager: отсутствует параметр для --flake

You are still missing the flake reference, so HM can’t know where it is expected to look. Your error even tells you so… Missing parameter according to 3 different translator softwares…

If you use russian locale, I assume you know how to read those messages without a translator

~home-manager switch --flake /etc/nixos

error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.homeConfigurations', 'legacyPackages.x86_64-linux.homeConfigurations' or 'homeConfigurations'
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.homeConfigurations', 'legacyPackages.x86_64-linux.homeConfigurations' or 'homeConfigurations'
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.homeConfigurations', 'legacyPackages.x86_64-linux.homeConfigurations' or 'homeConfigurations'
error: flake 'path:/etc/nixos' does not provide attribute 'packages.x86_64-linux.homeConfigurations."yakatze".activationPackage', 'legacyPackages.x86_64-linux.homeConfigurations."yakatze".activationPackage' or 'homeConfigurations."yakatze".activationPackage'

One second, I think I understood


I’ve managed to get NixOS and my flake.nix setup working fine, but now I’m running into an issue with Home Manager.

When I try to run home-manager switch --flake, I get the following error:

error: attribute 'lib' missing
at /nix/store/ygm1sizynn1apqyqv5f8srzwi6s9y4ja-source/modules/services/mako.nix:40:17:
   39|   iniType = iniFormat.type;
   40|   iniAtomType = iniFormat.lib.types.atom;
     |                 ^
   41| in

Here is my flake.nix:

{
  description = "tlater's dotfiles";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.11";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";

    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    yazi-plugins = {
      url = "github:yazi-rs/plugins";
      flake = false;
    };

  };
  

outputs =
      { nixpkgs, home-manager, ... }@inputs :
      {
        nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
            system = "x86_64-linux";
            modules = [
              { nixpkgs.config.allowUnfree = true; }
              ./nix/configuration.nix
            ];
        };

        homeConfigurations.yakatze = home-manager.lib.homeManagerConfiguration {
          pkgs = nixpkgs.legacyPackages."x86_64-linux";
          modules = [ ./home/home.nix ];
          extraSpecialArgs = {inherit inputs;};
        };

      };

}

It seems like iniFormat.lib is missing or not passed properly, but I’m not sure how to fix it.

Any idea what’s causing this or how to resolve it?



again I updated my flake.nix to fix the previous issue with the missing lib

But now I’m running into a new error when running home-manager switch --flake:

error: attribute 'hm' missing
at /nix/store/ygm1sizynn1apqyqv5f8srzwi6s9y4ja-source/modules/services/mako.nix:89:8:
   88|     ]
   89|     ++ lib.hm.deprecations.mkSettingsRenamedOptionModules basePath (basePath ++ [ "settings" ]) {
     |        ^
   90|       transform = lib.hm.strings.toKebabCase;

It seems like this happens because I’m using Home Manager in standalone mode (via homeManagerConfiguration), while lib.hm is only available when using Home Manager as a NixOS system module (nixosModules.home-manager).

Here’s how I currently have it configured:

homeConfigurations.yakatze = home-manager.lib.homeManagerConfiguration {
  pkgs = nixpkgs.legacyPackages."x86_64-linux";
  modules = [ ./home/home.nix ];
  extraSpecialArgs = {
    inherit inputs;
    lib = nixpkgs.lib;
  };
};

I don’t want to switch to using Home Manager as a system module, so I’d really appreciate any advice on how to use mako.nix (or other modules that depend on lib.hm) in standalone mode.

Maybe there’s a way to manually pass or define the needed parts of lib.hm?

Why not? If it’s a matter of reusing modules on non-NixOS systems, you can passthe exact same modules to homeConfigurations and nixosConfigurations.