Problem with `home-manager switch --flake .` – error related to missing `inputs`


Hi! I’m encountering an error when trying to apply my Home Manager configuration using flakes:

home-manager switch --flake .

The output is:

error:
  … while evaluating a branch condition
    at .../lib/lists.nix:142:18:
  … while calling the 'length' builtin
    at .../lib/lists.nix:141:13:
  … while evaluating the option `assertions`:
  … while evaluating definitions from `/modules/programs/yazi.nix`:
  … while evaluating the option `programs.yazi.plugins`:
  … while evaluating definitions from `/home/modules/app/yazi.nix`:
  … while evaluating the module argument `inputs'` in that file:

  error: attribute 'inputs' missing
  at .../lib/modules.nix:621:66:

I’m not sure what’s causing this. It seems like inputs are expected in the yazi.nix module but aren’t passed in correctly.
Here’s the yazi configuration I’m using:

{ inputs, pkgs, ... }:
{
  programs.yazi = {
    enable = true;
    enableZshIntegration = true;
    # package = pkgs.yazi-unwrapped;

    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()
  '';
}

Any ideas on how I should properly pass inputs to this module?
I’d be grateful for any help or suggestions!


Use extraSpecialArgs when calling homeManagerConfigurations to pass inputs.


As I understand it, it should look like this:

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

But what should I import there?

Nothing to import, just pass an appropriate value for inputs. Using extraSpecialArgs = {inherit inputs;} is commonly used to not have to think about it.

If you haven’t already you might also change your argument set used for the outputs funtion to an at-pattern like this: outputs = {self, nixpkgs, home-manager, ...}@inputs:

1 Like