From 05e980d72a9fbe57c1aea1f45087c1dff0b2b101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Sun, 23 Nov 2025 19:00:00 +0800 Subject: [PATCH] home/sioyek: improve xdg mimeApps configuration --- nix/homeModules/common/sioyek.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/nix/homeModules/common/sioyek.nix b/nix/homeModules/common/sioyek.nix index 6547d74d..93ee594d 100644 --- a/nix/homeModules/common/sioyek.nix +++ b/nix/homeModules/common/sioyek.nix @@ -3,6 +3,9 @@ lib, ... }: +let + cfg = config.programs.sioyek; +in { programs.sioyek = { bindings = { @@ -28,10 +31,15 @@ config.should_launch_new_window = "1"; }; - xdg.mimeApps = lib.mkIf config.programs.sioyek.enable { - enable = true; - defaultApplications = { - "application/pdf" = [ "sioyek.desktop" ]; + xdg.mimeApps = + let + associations = { + "application/pdf" = [ "sioyek.desktop" ]; + }; + in + lib.mkIf cfg.enable { + enable = true; + associations.added = associations; + defaultApplications = associations; }; - }; }