diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-03-29 12:19:17 +0100 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2025-03-29 12:20:52 +0100 |
commit | 663ada07b652d8be40f4f0496640adb796d8930f (patch) | |
tree | c926f1b769a64d5ecb9dd675cd196d4ebbfda262 /modules/by-name/xd/xdg/module.nix | |
parent | refactor(pkgs/update-vim-plugins): Remove (diff) | |
download | nixos-config-663ada07b652d8be40f4f0496640adb796d8930f.zip |
fix(modules/xdg): Migrate to the merged xdg-desktop-terminal-filechooser
Diffstat (limited to '')
-rw-r--r-- | modules/by-name/xd/xdg/module.nix | 52 |
1 files changed, 27 insertions, 25 deletions
diff --git a/modules/by-name/xd/xdg/module.nix b/modules/by-name/xd/xdg/module.nix index 5140a832..1202cd96 100644 --- a/modules/by-name/xd/xdg/module.nix +++ b/modules/by-name/xd/xdg/module.nix @@ -1,36 +1,28 @@ { pkgs, - nixpkgs_open_prs, - sysLib, - system, + lib, ... }: let - pkgs_tfc = nixpkgs_open_prs.nixpkgs-tfc.legacyPackages."${system}"; + cmd = pkgs.writeShellApplication { + name = "lf_wrapper"; + + runtimeInputs = [pkgs.lf pkgs.alacritty]; + inheritPath = true; + + text = builtins.readFile ./lf-wrapper.sh; + }; + + tfcConfigFile = (pkgs.formats.ini {}).generate "xdg-desktop-portal-termfilechooser.ini" { + filechooser = { + default_dir = "/tmp"; + cmd = "${lib.getExe cmd}"; + }; + }; in { services.dbus.enable = true; xdg = { portal = { enable = true; - termfilechooser = { - enable = true; - logLevel = "TRACE"; - package = pkgs_tfc.xdg-desktop-portal-termfilechooser; - settings = { - filechooser = { - default_dir = "/tmp"; - cmd = "${sysLib.writeShellScript { - src = ./scripts/lf_wrapper.sh; - name = "lf_wrapper"; - keepPath = true; - dependencies = with pkgs; [ - lf - alacritty - bash - ]; - }}/bin/lf_wrapper"; - }; - }; - }; wlr = { enable = true; }; @@ -47,12 +39,22 @@ in { "org.freedesktop.impl.portal.FileChooser" = ["termfilechooser"]; }; }; + extraPortals = [ pkgs.xdg-desktop-portal-gtk pkgs.xdg-desktop-portal-wlr - pkgs_tfc.xdg-desktop-portal-termfilechooser + pkgs.xdg-desktop-portal-termfilechooser ]; }; }; + + environment.etc."xdg/xdg-desktop-portal-termfilechooser/config".source = tfcConfigFile; + + systemd.user.services.xdg-desktop-portal-termfilechooser = { + serviceConfig.ExecStart = [ + "" + "${pkgs.xdg-desktop-portal-termfilechooser}/libexec/xdg-desktop-portal-termfilechooser --loglevel=TRACE" + ]; + }; # TODO: mime = {}; } |