summaryrefslogtreecommitdiff
path: root/system/desktops/hyprland.nix
blob: eb0778e187c45b3017d021b22ffb7966548cde27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
  inputs,
  config,
  pkgs,
  lib,
  ...
}: let
  inherit (lib) mkIf mkDefault;
  cfg = config.desktops.hyprland;
in {
  config = mkIf cfg.enable {
    desktops.wayland.enable = true;

    xdg.portal = {
      extraPortals = [
        inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland
      ];
      config.hyprland = {
        default = ["hyprland" "gtk"];
        "org.freedesktop.impl.portal.FileChooser" = ["gtk"];
        "org.freedesktop.impl.portal.OpenURI" = ["gtk"];
      };
    };

    programs.hyprland = {
      enable = true;
      package = inputs.hyprland.packages.${pkgs.system}.hyprland;
      portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland;
    };
  };
}