some modularizing and refactoring

This commit is contained in:
cnst
2024-10-24 18:49:49 +02:00
parent 7f9d5c000f
commit ca0dc208e0
25 changed files with 248 additions and 227 deletions

View File

@@ -0,0 +1,37 @@
{
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.";
};
extraPortals = mkOption {
type = types.listOf types.package;
default = [pkgs.xdg-desktop-portal-gtk];
description = "List of extra portals to include.";
};
};
};
config = mkIf cfg.enable {
xdg.portal = {
enable = true;
xdgOpenUsePortal = cfg.xdgOpenUsePortal;
config = {
common.default = ["gtk"];
hyprland.default = ["gtk" "hyprland"];
};
extraPortals = cfg.extraPortals;
};
};
}