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

[Nix] Plugins unable to be loaded #193

Open
CmrCrabs opened this issue Jun 29, 2024 · 26 comments
Open

[Nix] Plugins unable to be loaded #193

CmrCrabs opened this issue Jun 29, 2024 · 26 comments
Assignees

Comments

@CmrCrabs
Copy link

Using the hyprland flake, everything is up to date. Plugin builds completely fine and adding it as a plugin works, but once you actually try to use it in a way where it would actually be loaded, it breaks. IE if I used borders plus plus with border size set to zero, it runs fine - but If i set any actual border size it errors with

Failed to load the following plugin:
/nix/store/(hash)-borders-plus-plus-0.1/lib/libborders-plus-plus.so

Same exact error (with corresponding plugin.so) occurs for all the plugins in this repo, & other third party ones I have tried. I have tried various hyprland versions with the plugin version following the hyprland version, but will still result in same error.

@fufexan fufexan self-assigned this Jun 29, 2024
@fufexan
Copy link
Member

fufexan commented Jul 27, 2024

Does it still happen?

@CmrCrabs
Copy link
Author

Just updated all my flake inputs, rebuilt, and yes it does still happen. Same error occurs but with a new popup error being:

Failure in initialization: Version Mismatch (headers ver is not equal to running hyprland ver)

confused as to why its saying that though, as per my flake the inputs are all following the hyprland version - checking the flake.lock, both hyprland-plugins & hyprland are on the most recent commit rev.

@CmrCrabs
Copy link
Author

CmrCrabs commented Jul 28, 2024

also, the popup error will infinetly popup until i update my config, is this intended?

error_popup.mp4

(apparently firefox wont let the video play but it works fine on chromium / when downloaded?)

@jcmsj
Copy link

jcmsj commented Jul 29, 2024

I solved this by assigning package:

wayland.windowManager.hyprland = {
    enable = true;
    # here
    package = inputs.hyprland.packages.${pkgs.system}.hyprland; 
   # hyprexpo works
    plugins = [
      inputs.hyprland-plugins.packages.${pkgs.system}.hyprexpo
    ];
};

Almost the same as in the nixos configuration flake guide

example in my config

There's an edge case that happened to me that i think should be documented when moving hyprland from the system configuration to the hm one:
If the user is using the hyprland version from the input, then the user rebuilds, it will be correct since obviously the correct hyprland version is currently running. However, in the next boot, the version specified in the default package would be used which is causing the mismatch.

also, the popup error will infinitely popup until i update my config, is this intended?

This was annoying too

I hope this works for you

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 3, 2024

sorry for late response, I updated my configuration to be in line with yours, and then tested hyprexpo and hyprbars again.

Interestingly, hyprexpo doesnt cause the constant flashing notifications, nor reloads the red banner notification (but the error message itself is the same). Behaviour hasnt changed when trying to use either plugin though, as they still dont seem to work?

Given that its working for you though I'm assuming its an error on my end.

Have just spent a few hours more on this, and if I cant figure out the solution anytime soon ill close this issue (since seemingly its a skill issue on my part).

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

@CmrCrabs can you check your flake using nix-melt?

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

@fufexan not sure what I'm looking for exactly but I dont see anything out of the ordinary?

relevant output:
image

image

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

can you check whether hyprland-plugins actually has hyprland -> hyprland?

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

it does at the top
image

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

Hm, that looks good.

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

Could it be something to do with assigning hyprland in both my configuration.nix and home manager setup?

Currently I have the nixos module:

  programs.hyprland = {
    enable = true;3
    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
  };

and then the home manager module

    wayland.windowManager.hyprland = {
    enable = true;
    systemd.enable = true;
    xwayland.enable = true;
    # package = inputs.hyprland.packages.${pkgs.system}.hyprland;

    plugins = [
      # inputs.hyprland-plugins.packages."${pkgs.system}".hyprbars
      # inputs.hyprland-plugins.packages."${pkgs.system}".borders-plus-plus
      # inputs.hyprspace.packages.${pkgs.system}.Hyprspace
    ];

    settings = {
    # ...

Note that setting a package in the wayland.windowManager option seems to break hyprland (I am unable to launch it from tty)

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

After removing the nixos module and then rebuilding, hyprland launches but seemingly is broken? (im assuming there is some various things that are not initialised properly).

Unsure though since @jcmsj 's config has the program.hyprland module commented, and only the wayland.windowManager module?

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

programs.hyprland should only be needed for the Hyprland session to show up in display managers. I can't say for sure why you can't launch Hyprland in tty when setting its package through the HM module. Can you post some logs?

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

When not using the programs.hyprland option I found that dbus isnt starting correctly(?) per an AGS error message:

(com.github.Aylur.ags:25195): Gdk-WARNING **: 13:37:59.606: Failed to read portal settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

unsure which part of the crash report is relevant so I will add all of it.

hyprlandCrashReport34681.txt

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

Oh, it might be that the portals aren't set up properly/at all in the HM module.

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

would explain alot, as I was having quite a few issues with some xdg related things like opening links in application. I had to manually install xdg-utils from nixpkgs since neither the programs.hyprland option nor the HM module gets it as a dependency

for reference, I do have some xdg related configurations, although even considering that, It wasnt working without the programs.hyprland option

  xdg = {
    autostart.enable = true;
    portal = {
      enable = true;
      extraPortals = [
        pkgs.xdg-desktop-portal
        pkgs.xdg-desktop-portal-gtk
      ];
    };
  };

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

Adding

xdg.portal = {
  enable = true;
  extraPortals = [config.wayland.windowManager.hyprland.package];
  configPackages = [config.wayland.windowManager.hyprland.package];
}

to your HM config should make everything work again.
In the meantime I'm going to make this change upstream.

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

removed my old xdg config and added that to my configuration, did not seem to fix it? getting the same error as before

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

Odd, did you reboot?

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

yep, rebuilt both nixos and hm then rebooted for good luck and nothing. Also note that a few other things didnt work like some workspace rules (to open apps) but I think those stem from the same issue with the portals

@fufexan
Copy link
Member

fufexan commented Aug 4, 2024

I've created a PR here.

@CmrCrabs
Copy link
Author

CmrCrabs commented Aug 4, 2024

per this wiki entry there are quite a few other (seemingly important) things the nixos module enables, is the intention to have the hm module usable without enabling the nix module?

@noamsto
Copy link

noamsto commented Aug 15, 2024

@CmrCrabs
I had the exact same issue, and looking at your config seems that like me, you overlooked the following flake instruction (hm installation - choose flake):

      modules = [
        hyprland.homeManagerModules.default    <--- THIS
        {
          wayland.windowManager.hyprland.enable = true;
        }

It solved my issues with plugins :)

@fufexan , BTW I'm spending so much time on your dotfiles, you did a great job, I'm copying way too much.

@CmrCrabs
Copy link
Author

@noamsto I have just added to that to my config and rebuilt - still getting an identical error. Just now went through and checked my config against the wiki once more and I cant find anything else that I missed?

my one guess as to why its still not working is that, per below, I am also including inputs in extraSpecialArgs. This probably re-includes hyprland and may somehow lead to the versioning error?

outputs = { self, nixpkgs, home-manager,nur, hyprland, ... }@inputs:
let 
  lib = nixpkgs.lib;
  system = "x86_64-linux";
  pkgs = nixpkgs.legacyPackages.${system};
  in {

  nixosConfigurations.zyn-nixos = lib.nixosSystem {
    inherit system;
    modules = [ 
      nur.nixosModules.nur
      ./nixos/configuration.nix
    ];
    specialArgs = { inherit inputs; };
  };

  homeConfigurations.zyn = home-manager.lib.homeManagerConfiguration {
    inherit pkgs;
    modules = [
      hyprland.homeManagerModules.default
      {
        wayland.windowManager.hyprland.enable = true;
      }
      ./home/home.nix 
    ]; 
    extraSpecialArgs = { inherit inputs; };
  };
};

maybe @fufexan would be able to better advise?

thanks for the help either way

@fufexan
Copy link
Member

fufexan commented Aug 15, 2024

Let me check if it works for me without including the upstream modules.

@fufexan
Copy link
Member

fufexan commented Aug 15, 2024

Using this patch, everything is still fine

diff --git a/home/programs/wayland/hyprland/default.nix b/home/programs/wayland/hyprland/default.nix
index ed720b7..134ef76 100644
--- a/home/programs/wayland/hyprland/default.nix
+++ b/home/programs/wayland/hyprland/default.nix
@@ -7,7 +7,7 @@
   cursorPackage = inputs.self.packages.${pkgs.system}.bibata-hyprcursor;
 in {
   imports = [
-    inputs.hyprland.homeManagerModules.default
+    # inputs.hyprland.homeManagerModules.default
     ./binds.nix
     ./rules.nix
     ./settings.nix
@@ -23,6 +23,8 @@ in {
   wayland.windowManager.hyprland = {
     enable = true;
 
+    package = inputs.hyprland.packages.${pkgs.system}.default;
+
     plugins = with inputs.hyprland-plugins.packages.${pkgs.system}; [
       hyprbars
       hyprexpo
diff --git a/system/programs/hyprland.nix b/system/programs/hyprland.nix
index eee752d..0a73bb8 100644
--- a/system/programs/hyprland.nix
+++ b/system/programs/hyprland.nix
@@ -1,10 +1,19 @@
-{inputs, ...}: {
-  imports = [
-    inputs.hyprland.nixosModules.default
-  ];
+{
+  inputs,
+  pkgs,
+  ...
+}: {
+  # imports = [
+  #   inputs.hyprland.nixosModules.default
+  # ];
 
   environment.variables.NIXOS_OZONE_WL = "1";
 
   # enable hyprland and required options
-  programs.hyprland.enable = true;
+  programs.hyprland = {
+    enable = true;
+
+    package = inputs.hyprland.packages.${pkgs.system}.default;
+    portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
+  };
 }

I'm almost certain that any issues that occur are either due to improperly set packages, or wrong .follows.

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

No branches or pull requests

4 participants