I’ve been using home-manager and nix-darwin for a while and decided to take the plunge on my desktop and install NixOS. I have the gnome desktop running currently. In gnome, I can run xorg apps via XWayland, and my environmental variables seem to be correct.
and I get the error cannot open display :0 when I try to launch xclock or Steam.
I’ve checked my home-manager config for Hyprland and the config file is basically standard except for setting my monitors, changing some keybinds. I even commented out anything that was setting an env var just in case but I am still at a loss here with XWayland and trying to figure out what is setting wayland-1 in Hyprland but not Gnome.
Has anyone seen anything similar before? I am running nixos-unstable with Hyprland installed just via nixpkgs.
When xdg-desktop-portal fails to load which seems to happen on Hyprland if you kill the session and restart it, xclock runs just fine. (I didn’t bother trying Steam).
I am not adding any more portals via the xdg.portal option in either home-manager or my configuration.nix. I tried both but didn’t seem to have any luck.
Thanks, I’ll just mimic your config when I get home. I see you’re just using the standard hyprland.conf and as far as I can see you’re not using the hone-manager module? Maybe I did something funky with home-manager. I’ve tried a few combos of xwayland.enable = true; in both, just configuration, just hm but had no luck.
I might also try tossing the qtwayland packages you have in there and just in general cleaning up my config to see if I’m double declaring something that’s upsetting the setup.
In general, I try to keep my configs outside of HM. My HM is pretty bare-bones (as you can see). I’d rather use the configuration syntax of the package vs. attempt to use HM modules that may or may not have the program available and/or the setting there. Just personal preference I guess.
Interesting. So I started out thinking, “there’s no way it’s the flake” and copying some of the packages you have, but I still couldn’t launch X11 apps.
I then enabled the flake for Hyprland in first the system package then and home-manager, and still nothing. (actually I was fine on just system package but enabling the home-manager module broke X11)
I even installed greetd in case that was somehow setting things up correctly for you.
Not using home manager works. I have no idea why. The minute I enable the home manager module I can’t launch X11 apps anymore. My config was so simple:
wayland.windowManager.hyprland = {
enable = true;
# systemd.enable = false # I tried this too, idk
xwayland.enable = true; # I even tried false here
# this is from trying the flake but I tried standard pkgs first
package = hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland;
extraConfig = ''
${builtins.readFile ./hypr/hyprland.conf}
'';
};
Again, I think the system package and home-manager package are supposed to work together, but in the end doing this worked for me:
What revision of Nixpkgs were you using with home-manager? If it’s not the same one that was used to deploy your system (specifically: the graphics drivers), you’re likely to run into issues. Always keep the two instances of Nixpkgs the same.
I don’t think the revision was the issue. I was thinking I had something else set up wrong in my home-manager config but just turning off wayland.windowManager.hyprland.enable = true and using home.file to set my config fixed it.