split-monitor-workspaces icon indicating copy to clipboard operation
split-monitor-workspaces copied to clipboard

NixOs: Error: Failed to load plugin

Open GARcraft opened this issue 2 years ago • 8 comments

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
                  '';
                };
              };
            
            };
          }
        ];
      
      };
    };
  };
}

GARcraft avatar Oct 10 '23 17:10 GARcraft

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.

zilti avatar Oct 18 '23 21:10 zilti

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 :)

OakleyCord avatar Oct 23 '23 15:10 OakleyCord

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.

Golodir avatar Feb 16 '24 14:02 Golodir

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

Daniel-McLarty avatar Apr 10 '24 20:04 Daniel-McLarty

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

nonetrix avatar Apr 10 '24 20:04 nonetrix

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
        ];
      };
    };
  };
}

hans-chrstn avatar Apr 11 '24 20:04 hans-chrstn

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

devraza avatar Oct 26 '24 16:10 devraza

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.

turtton avatar Nov 07 '24 10:11 turtton