Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NixOs: Error: Failed to load plugin #30

Open
GARcraft opened this issue Oct 10, 2023 · 8 comments
Open

NixOs: Error: Failed to load plugin #30

GARcraft opened this issue Oct 10, 2023 · 8 comments
Labels

Comments

@GARcraft
Copy link

GARcraft commented Oct 10, 2023

Hi!

I'm using NixOs and I want to use this plugin in my Hyprland.

After installing my plugin with Home-manager it shows that error:
image

Can you help me please?

Here is my flake.nix (string "username" is changed with my actual user name):

{
  description = "A very basic flake";
  
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";   
    
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  
    hyprland.url = "github:hyprwm/Hyprland";
    split-monitor-workspaces = {
      url = "github:Duckonaut/split-monitor-workspaces";
      inputs.hyprland.follows = "hyprland";
    };
  
  };
  
  outputs = {
    self,
    nixpkgs,
    hyprland,
    home-manager,
    split-monitor-workspaces,
    ...
  }@inputs: 
  
  let
    system = "x86_64-linux";
    pkgs = import nixpkgs {
      inherit system split-monitor-workspaces;
      config = {
        allowUnfree = true;
      };
    };
  
  in
  {
    nixosConfigurations = {
      nixos = nixpkgs.lib.nixosSystem {
        inherit system;
        specialArgs = { inherit inputs system split-monitor-workspaces; };
        
        modules = [
          ./nixos/configuration.nix
          
          home-manager.nixosModules.home-manager
          {
            home-manager = {
              extraSpecialArgs = { inherit system hyprland split-monitor-workspaces; };
              useGlobalPkgs = true;
              useUserPackages = true;
              
              users.username = {
                programs.home-manager.enable = true;
                home.stateVersion = "23.11"; # Please read the comment before changing.
                home.username = "username";
                home.homeDirectory = "/home/username";
                
                wayland.windowManager.hyprland = {
                  enable = true;
                  
                  plugins = [
                    split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
                  ];
                
                  extraConfig = ''
                    plugin {
                      split-monitor-workspaces {
                        count = 5
                      }
                    }
                    # my hyprland config
                  '';
                };
              };
            
            };
          }
        ];
      
      };
    };
  };
}
@zilti
Copy link

zilti commented Oct 18, 2023

I have the exact same issue and would love to know how to solve this. I suspect it is because in your (and my) config, split-monitor-workspaces builds on the Hyprland pointed at by hyprland.url, while the actual Hyprland we use is the one from home-manager.

@OakleyCord
Copy link

add package = inputs.hyprland.packages.${pkgs.system}.hyprland to wayland.windowManager.hyprland like this

wayland.windowManager.hyprland = {
    ...
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    ...
}

that fixes it for me and is listed on the hyprland wiki for using flakes :)

@Golodir
Copy link

Golodir commented Feb 16, 2024

add package = inputs.hyprland.packages.${pkgs.system}.hyprland to wayland.windowManager.hyprland like this

wayland.windowManager.hyprland = {
    ...
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    ...
}

that fixes it for me and is listed on the hyprland wiki for using flakes :)

This did not fix it for me. I tried with or without cachix. The plugin does not crash when I start hyprland in a nested window.

@zjeffer zjeffer added the NixOS label Apr 7, 2024
@Daniel-McLarty
Copy link

This is broken for me too, I tried to use a custom version for a while but it went 404.

@nonetrix
Copy link

This is broken for me too, I tried to use a custom version for a while but it went 404.

For now at least, just use Hyprsplit. They are functionality wise the exact same for me https://github.com/shezdy/hyprsplit

@hans-chrstn
Copy link

hans-chrstn commented Apr 11, 2024

works fine for me. here's what i did (make sure to add your settings option):

{  inputs, pkgs, ... }:
{
  wayland.windowManager.hyprland = {
    enable = true;
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    plugins = [
      inputs.split-monitor-workspaces.packages.${pkgs.system}.split-monitor-workspaces
    ];
  };
}

parts of my flake

{

  inputs = {
    nixpkgs = {
      url = "github:nixos/nixpkgs/nixos-unstable";
    };

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

    hyprland = {
      url = "github:hyprwm/Hyprland";
    };

    split-monitor-workspaces = {
      url = "github:Duckonaut/split-monitor-workspaces";
      inputs.hyprland.follows = "hyprland"; # <- make sure this line is present for the plugin to work as intended
    }; 
  };

  outputs = {
    self,
    nixpkgs,
    home-manager,
    ...
  } @ inputs: let
    inherit (self) outputs;

    nixosConfigurations = {
      default = nixpkgs.lib.nixosSystem {
        specialArgs = {inherit inputs outputs;};
        modules = [
          ./hosts/default/system/configuration.nix
        ];
      };
    };

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

@devraza
Copy link

devraza commented Oct 26, 2024

I think it's worth mentioning here that I had to restart Hyprland for the fix presented by @OakleyCord to work.

@turtton
Copy link

turtton commented Nov 7, 2024

I had same issue, but resolved after executing nix flake update in my configurations.
Current versions

$ hyprctl version
Hyprland 0.44.0 built from branch  at commit 0ec128e5ed5e15aaebff6c4b5983326ab524d690  ().
Date: 2024-11-06
Tag: , commits: 5422
built against aquamarine 0.4.3


flags set:
debug
$ hyprctl plugin list
Plugin split-monitor-workspaces by Duckonaut:
	Handle: 3675c870
	Version: 1.2.0
	Description: Split monitor workspace namespaces

It looks can happen if the version of hyprland is older than plugin expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants