{ inputs, config, lib, system, ... }: let inherit (lib) mkIf; cfg = config.desktops.hyprland; in { config = mkIf cfg.enable { desktops.wayland.enable = true; xdg.portal = { extraPortals = [ inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland ]; config.hyprland = { default = lib.mkForce ["gtk"]; "org.freedesktop.impl.portal.Secret" = ["gnome-keyring"]; "org.freedesktop.impl.portal.FileChooser" = ["gtk"]; "org.freedesktop.impl.portal.OpenURI" = ["gtk"]; "org.freedesktop.impl.portal.Screencast" = ["hyprland"]; "org.freedesktop.impl.portal.Screenshot" = ["hyprland"]; }; }; programs.hyprland = { enable = true; withUWSM = true; package = inputs.hyprland.packages.${system}.hyprland; portalPackage = inputs.hyprland.packages.${system}.xdg-desktop-portal-hyprland; }; }; }