{ pkgs, config, lib, ... }: let cfg = config.grimmShared; in { config = with cfg; lib.mkIf (enable && portals) { xdg.portal = { enable = true; extraPortals = with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-kde xdg-desktop-portal-gtk ]; wlr.enable = true; wlr.settings = lib.mapAttrs' (name: value: lib.nameValuePair ("screencast_" + name) { output_name = value.id; max_fps = value.fps; chooser_type = "simple"; chooser_cmd = "${lib.getExe pkgs.slurp} -f %o -or"; }) cfg.screens; }; environment.sessionVariables = { XDG_CONFIG_HOME = "$HOME/.config"; FREETYPE_PROPERTIES = "cff:no-stem-darkening=0 autofitter:no-stem-darkening=0"; }; environment.systemPackages = with pkgs; [ xwaylandvideobridge ]; fonts.fontDir.enable = true; }; options.grimmShared.portals = with lib; mkOption { type = types.bool; default = false; description = "Enables portals for wlr, gtk and kde as well as fixes fonts"; }; }