Files
cnix/modules/nixos/system/xdg/default.nix
2024-10-26 19:10:54 +02:00

33 lines
669 B
Nix

{
lib,
config,
pkgs,
...
}: let
inherit (lib) mkIf mkOption mkEnableOption types;
cfg = config.nixos.system.xdg;
in {
options = {
nixos.system.xdg = {
enable = mkEnableOption "Enable XDG portal.";
xdgOpenUsePortal = mkOption {
type = types.bool;
default = true;
description = "Use xdg-open via the portal.";
};
};
};
config = mkIf cfg.enable {
xdg.portal = {
enable = true;
xdgOpenUsePortal = cfg.xdgOpenUsePortal;
config = {
common.default = "*";
hyprland.default = ["hyprland" "gtk"];
};
extraPortals = [pkgs.xdg-desktop-portal-gtk];
};
};
}