hyprwm / hyprland-plugins

Official plugins for Hyprland
BSD 3-Clause "New" or "Revised" License
459 stars 42 forks source link

Home manager cant access inputs.hyprland-plugins #182

Closed UnknownHiker closed 2 weeks ago

UnknownHiker commented 2 weeks ago

Error on build: attribute 'inputs' missing

But i think thats not true.

Heres my flake.nix:

{
  description = "NixOS Config";

  inputs = {
    # Nixpkgs
    nixpkgs.url = "github:nixos/nixpkgs/nixos-24.05";
    unstable.url = "github:nixos/nixpkgs/nixpkgs-unstable";

    # Home manager
    home-manager.url = "github:nix-community/home-manager/release-24.05";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    # Hyprland
    hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
    hyprland-plugins = {
      url = "github:hyprwm/hyprland-plugins";
      inputs.hyprland.follows = "hyprland";
    };
  };

  outputs = {
    self,
    nixpkgs,
    unstable,
    home-manager,
    hyprland,
    hyprland-plugins,
    ...
  } @ inputs: {
    # NixOS configuration entrypoint
    # Available through 'nixos-rebuild --flake .#your-hostname'
    nixosConfigurations = {
      nixos = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        # Make Inputs available to all submodules
        specialArgs = {inherit inputs;};

        # Modules
        modules = [
          # System Configuration
          ./nixos/configuration.nix

          # Home Manager Configuration
          home-manager.nixosModules.home-manager
          {
            home-manager.useGlobalPkgs = true;
            home-manager.useUserPackages = true;
            home-manager.users.user = import ./home-manager/home.nix; #anonymized Username
            home-manager.extraSpecialArgs = inputs;
          }
        ];
      };
    };
  };
}

And inside home.nix first thing i do is import inputs then later followed by the hyperland configuration:

# This is your home-manager configuration file
# Use this to configure your home environment (it replaces ~/.config/nixpkgs/home.nix)
{ inputs
, lib
, config
, pkgs
, ...
}: {

...some other stuff...

# Hyprland configuration
  wayland.windowManager.hyprland = {
    enable = true;

    plugins = [
      inputs.hyprland-plugins.packages.${pkgs.system}.borders-plus-plus
    ];

    settings = {
      "$mod" = "SUPER";
    };
  };

...followed by some other stuff...

What is wrong here?

in configuration.nix i can acess inputs, just not in home.nix

UnknownHiker commented 2 weeks ago

So it seems it works if i pass following to home manager in my flake: home-manager.extraSpecialArgs = {inherit inputs;};

But what i dont understand is, why is the statement specialArgs = {inherit inputs;}; above the modules section not inheriting it to the home manager module.

vaxerski commented 2 weeks ago

@fufexan

fufexan commented 2 weeks ago

@UnknownHiker Home Manager creates its own module args scope, which does not include all other attributes in the NixOS module args scope.

UnknownHiker commented 2 weeks ago

@fufexan Thanks for clarifying :)