hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.17k stars 891 forks source link

Startup crash when using home-manager #2603

Closed fivegrant closed 1 year ago

fivegrant commented 1 year ago

@fufexan This issue is similar to #2416 except (1) I'm not using NVIDIA and (2) I'm currently using unstable.

Steps to reproduce

Behavior

Relevant home-manager configuration

(i've toggled systemdIntegration and disableAutoreload but it hasn't helped)

...
  wayland.windowManager.hyprland = {
    enable = true;
    disableAutoreload = false;
    systemdIntegration = true;
  };
...

Logs

hyprland.log crash_report.txt

fufexan commented 1 year ago

I don't see why HM would trigger a crash. Could you try disabling the module and launching Hyprland as installed from this flake in home.packages and seeing if it crashes? Also, could you link your configuration, or share it in a pastebin?

freopen commented 1 year ago

I've updated my system yesterday and had similar crash with exactly the same stacktrace and similar log (no ERRORs, cuts off at inputs configuration). My config is here: https://github.com/freopen/nixos/blob/main/laptop/hyprland/default.nix. I rolled back to the version from around 2023-06-25 with the same config and it works fine now.

Edit: oh, and Gamescope over Framebuffer works fine on the new system, so I doubt it's kernel/driver regression

fivegrant commented 1 year ago

@fufexan haven't tried using it from home.packages but following @freopen's advice I was able to figure out that it is this specific commit that is breaking things.

Here's the part of my home manager flake config (which is separate from my NixOS system config) that actually includes the module:

...
    {
        defaultPackage.x86_64-linux = home-manager.defaultPackage.x86_64-linux;
        defaultPackage.x86_64-darwin = home-manager.defaultPackage.x86_64-darwin;

        homeConfigurations = {
            bobcomputer = home-manager.lib.homeManagerConfiguration {
                inherit pkgs;
                extraSpecialArgs = {
                    theme = "gruvbox-dark";
                };
                modules = [
                    hyprland.homeManagerModules.default
                    stylix.homeManagerModules.stylix
                    (import ./machine/bobcomputer.nix {
                        inherit nur pkgs;
                        inherit (pkgs) config lib stdenv;                    
                    })
                ];
            };
...

I'll throw the rest up in pastebin if this isn't enough. (BTW, I've tried removing stylix but there was no effect).

panchoh commented 1 year ago

That commit breaks my system too (my flake, unpin Hyprland url to see the crash).

Wsession.errors@62c75883d1b275d2a6e62bf31d59a43f0a404c14.txt

As seen on the aforementioned commit, the assumption there is that the env var XDG_DESKTOP_PORTAL_DIR is defined; if not, the end result is not going to be pretty, and no fallbacks have been defined.

That var is defined in nixpkgs. I see in my flake.lock that xdg-desktop-portal-hyprland (XDPH) is brougth in by Hyprland flake.

I'm going to try enabling xdg.portal.enable = true to see if that fixes the issue.

panchoh commented 1 year ago

It seems that the setting of xdg.portal.enable = true; was taken care of by Hyprland NixOS module, I was only missing adding programs.hyprland.enable = true; in my configuration.nix. I'm now running the current tip without issues.

But I see that Hyprland's hm-module.nix does not have an equivalent handling of the portal, thus, if you are using only Home Manager (and not the NixOS module), the aforementioned patch won't be satisfied, because XDG_DESKTOP_PORTAL_DIR won't be defined.

fufexan commented 1 year ago

Good point, I'll modify the patch to only check for the code if the variable is defined. Thanks for the feedback and sorry for the breakage.

fufexan commented 1 year ago

Should be fixed by https://github.com/hyprwm/Hyprland/commit/64fc19cc811434b81ab9bc6b8c64edbcbfd0cfd4. Tested with the variable not present and it doesn't crash anymore.

panchoh commented 1 year ago

Good point, I'll modify the patch to only check for the code if the variable is defined. Thanks for the feedback and sorry for the breakage.

Glad to be of service. Thanks to you for giving life to this amazing compositor!

fivegrant commented 1 year ago

Thanks @panchoh and @fufexan. This issue has been resolved on latest!