{ config, lib, pkgs, ... }:

with lib;
with lib.my;

let cfg = config.modules.services.flatpak;
in {
  options.modules.services.flatpak = { enable = mkBoolOpt false; };

  config = mkIf cfg.enable {
    services.flatpak.enable = true;

    xdg.portal = {
      enable = true;
      extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
      config.common.default = "*";
    };

  };
}
