{ pkgs, sysLib, ... }: { services.dbus.enable = true; xdg = { portal = { enable = true; termfilechooser = { enable = true; settings = { filechooser = { cmd = let nativeBuildInputs = with pkgs; [makeWrapper lf gawk coreutils mktemp dash fd gnugrep]; in "${pkgs.runCommandLocal "lf_wrapper" { inherit nativeBuildInputs; } '' install -m755 ${./scripts/lf_wrapper} -D "$out/bin/lf_wrapper" patchShebangs "$out/bin/lf_wrapper" wrapProgram "$out/bin/lf_wrapper" --prefix PATH : ${pkgs.lib.makeBinPath nativeBuildInputs}; chown -R 1000:100 "$out/bin" ''}/bin/lf_wrapper"; }; }; }; wlr = { enable = true; }; config = { common = { # NOTE: The next entry is supposedly needed for gtk based apps <2023-08-31> default = ["wlr" "gtk"]; "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; }; # TODO: Also activate, when on another wlr-based compositor <2023-11-25> river = { default = ["wlr" "gtk"]; "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; }; }; extraPortals = with pkgs; [ xdg-desktop-portal-gtk xdg-desktop-portal-wlr xdg-desktop-portal-termfilechooser ]; }; }; # TODO: mime = {}; }