Portals don't work on Hyprland after update to 0.55.2 from 0.54.3

What it says on the title, today I updated my setup to Hyprland 0.55.2 and the portals no longer work. When I try to screencast windows in Discord I no longer can. When I try to open a Flatpak I get:

com.dec05eba.gpu_screen_recorder 
bwrap: Unexpected capabilities but not setuid, old file caps config?
error: ldconfig falló, estado de salida 256 

When I try to open a file on Firefox, the gtk3 file manager appears instead of the gtk4 (through shana). Many GTK apps don’t have the proper text scaling (I use the big text accessibility feature) because they can’t access the GTK config portal. Among other issues… keyring seems to work fine though.

To install Hyprland I used.

programs.hyprland.enable = true;

To install the extra portals I used:

environment.systemPackages = with pkgs; [
    xdg-desktop-portal-shana
    xdg-desktop-portal-luminous
];

To configure the portals I used:

xdg.portal.config = {
    hyprland = {
      default = ["gtk"];
      "org.freedesktop.impl.portal.Settings" = [ "gtk" ];
      "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ];
      "org.freedesktop.impl.portal.FileChooser" = [ "shana" ];
      "org.freedesktop.impl.portal.GlobalShortcuts" = ["hyprland"];
      "org.freedesktop.impl.portal.ScreenCast" = ["hyprland"];
      "org.freedesktop.impl.portal.RemoteDesktop" = [ "luminous" ];
    };
  };

(Not sure if this is related but I have the Gnome DE installed alongside, because I use a lot of their apps and services, including GDM):

 # Enable the GNOME Desktop Environment.
  services.displayManager.gdm.enable = true;
  services.desktopManager.gnome.enable = true;

PLEASEEEEE HELPPPP!!!

If you add the extra portals using xdg.portal.extraPortals instead of environment.systemPackages then some more setup will be done to integrate with dbus and systemd:

Tried, it didn’t work.

I also tried setting the following env variables, didn’t work:

(The article cited is from the previous Hyprland version because I haven’t upgraded to lua syntax yet, but the rules should still apply).

Also according to the Hyprland documentation, the xdg portal configuration file should be in ~/.config/xdg-desktop-portal/hyprland-portals.conf and not in /etc/xdg/xdg-desktop-portal/hyprland-portals.conf (where Nix puts it), but creating a file there manually also didn’t work:

I’m kinda starting to run out of ideas.

Also tried installing Hyprland with:

programs.hyprland.withUWSM = true;

And choosing “Hyprland (uwsm)” in GDM and that also didn’t work.

Reverted the update for now. Don’t know what I will do in the future (aside from praying this will get fixed, assuming the issue is not on my side).

Do you have other desktop environments? (like plasma etc.)

Yes, as said in the original message. But I feel like it would be weird if that’s causing issues, considering I have been using this setup for almost a year now.

Also while I rarely use the Gnome DE (last time was months ago), I like to still have it there, in case of an emergency just like this one (I used Gnome before reverting the update).

It might be helpful to post the pre-change git commit hash and the update git commit hash.

I didn’t commit the flake.lock before updating, so when I reverted it, I lost the new hash. Sorry for not being useful :(.

I’m not a flake user, but I thought the intrinsic design of flakes was that they did not apply uncommitted changes to evaluation?

When I run sudo nixos-rebuild switch --flake I also use the --impure flag, this is because some of my nix config files are outside the scope of the flake folder, and nixos-rebuild wouldn’t run without that flag.

(I know this sounds like a bad idea, but the files outside the flake folder, are in the same Git repo, so I don’t think it’s a big issue, as long as I commit the flake after an update, or at least I thought).

Now that I think about, if you didn’t know I used flakes, what did you mean with the “pre-change git commit hash”, were you referring to something else that I misunderstood?

They do, you’re misunderstanding. As long as the files in question are tracked by git the changes will be picked up, though the derivation will be marked as dirty and nix prints a warning.

They will not pick up untracked files, though.

1 Like

No you understood fine, I also pin my nixpkgs inputs (with npins, although there are also other ways like flakes/niv/yea/pinch/nixtamal/builtins/etc).

I’m still on nixpkgs d233902339c02a9c334e7e593de68855ad26c4cb (with hyprland 0.54.3) but I can try to see what happens when I upgrade to nixpkgs 64c08a7ca051951c8eae34e3e3cb1e202fe36786.

@TLATER, thanks for the clarification on how flakes work. :slightly_smiling_face:

Seems to work fine on hyprland 0.55.2, at least when I test with nix-shell -p discord and nix-shell -p obs-studio.

My hyprland.conf, hopefully it helps. I use GDM, which might only matter for whether or not your display-manager is properly launching with UWSM wrapper.

# cat conf/desktop/hyprland.nix 
{
  config,
  lib,
  pkgs,
  ...
}:

{
  # Enable the X11 windowing system.
  # services.xserver.enable = true;
  programs.hyprland = {
    enable = true;
    xwayland.enable = true;
    withUWSM = true;
  };

  services.hypridle.enable = true;
  programs.hyprlock.enable = true;

  environment.etc = {
    "xdg/hypr/hypridle.conf".text = ''
      listener {
        timeout = 330 # seconds
        on-timeout = hyprctl dispatch dpms off
        on-resume = hyprctl dispatch dpms on
      }
    '';
  };

  # Configure keymap in X11
  # services.xserver.xkb.layout = "us";
  # services.xserver.xkb.options = "eurosign:e,caps:escape";

  environment.systemPackages =
    with pkgs;
    [
      hyprcursor # new cursor format
      rose-pine-hyprcursor # more normal cursor
      wofi # runner
      kitty # terminal used in default config
      hyprpaper
      hyprpicker
      hyprsunset # "Sunset" filter/reddish screen tint that will not get captured by screen recorders
      hyprpolkitagent # allows GUI to request elevated privileges
      playerctl # enables multimedia buttons to do things
      # brightnessctl # env-agnostic tool for controlling non-external monitor brightness
    ];

  programs.waybar.enable = true;

}

Your config doesn’t seem to be too different from mine. I guess I will try again in a month or so, just in case. Thanks for trying to help anyways.

Same issue here after the 25.11 → 26.05 upgrade. I tried digging into logs, check for missing portals, etc and everything seems in order? any file picker, screensharing etc will just not work. If anyone has a temp work-around please feel free to share because it’s painful.

I had a similar issue after upgrading NixOS from 25.11 to 26.05. On Hyprland (upgrade from 0.52.1 to 0.55.2), some GTK-based apps would no longer dynamically change font size if I updated the GTK text scaling factor. The text scaling factor is distributed through xdg portals to applications. I’ve had a brittle setup where I am installing and configuring Hyprland partially in NixOS and partially in Home-Manager:

  • NixOS:
    programs.hyperland.enable = true;
    xdg.portal.enable = true;
    xdg.portal.extraPortals = [
      pkgs.xdg-desktop-portal-gtk
    ];
    
  • Home-Manager:
    wayland.windowManager.hyprland = {
      enable = true;
      portalPackage = pkgs.xdg-desktop-portal-hyprland;
    };
    

In this setup, there is a xdg portal installation in NixOS (system-wide) and in Home-Manager (user-scoped). These two types of portal installations don’t talk to each other and that somehow was the issue.

The workaround for me was to install xdg portals only with Home-Manager:

  • NixOS:
    # Remove/comment the `xdg.portal` config:
    # xdg.portal.enable = true;
    # xdg.portal.extraPortals = [
    #   pkgs.xdg-desktop-portal-gtk
    # ];
    
    # Do _NOT_ install any xdp portals in any other ways, such as
    # environment.systemPackages = with pkgs; [
    #  xdg-desktop-portal-shana
    #  xdg-desktop-portal-luminous
    # ];
    
  • Home-Manager:
    wayland.windowManager.hyprland = {
      enable = true;
      portalPackage = pkgs.xdg-desktop-portal-hyprland;
    };
    home.packages =  [ xdg-desktop-portal-hyprland xdg-desktop-portal-gtk ];
    

After this, I’ve rebooted the system and it all works again just like before the upgrade to NixOS 26.05.

The clean solution might be to install & configure Hyprland only in NixOS (according to Hyprland on NixOS – Hyprland Wiki, the NixOS hyprland module is required).

Thanks for the clarification, but the thing is that in my case I didn’t use home manager to configure Hyprland. Also, shouldn’t xdg-desktop-portal configure itself with programs.hyprland.enable according to: xdg-desktop-portal-hyprland – Hyprland Wiki

I doubt that’s the issue considering that other portals like shana and gtk also didn’t work even if installed with xdg.portal.extraPortals. I’m gonna keep waiting a little longer until I update, but thanks for trying to help.

try this.

  nixpkgs.overlays = [
    (self: super: {
      xdg-desktop-portal-gtk = super.xdg-desktop-portal-gtk.overrideAttrs {
        postInstall = ''
          sed -i 's/UseIn=gnome/UseIn=gnome;hyprland/' \
            $out/share/xdg-desktop-portal/portals/gtk.portal
        '';
      };
    })
  ];

Make sure you restart the portal services:

systemctl --user restart xdg-desktop-portal-gtk.service xdg-desktop-portal-hyprland.service xdg-desktop-portal.service

Also make sure you do this in hyprland auto-exec:

exec dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_CURRENT_DESKTOP

and then close and re-open the programs. It worked for me.