From 0dd3e1d830daa95ee45994c49e3818a0491056f9 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sat, 13 Nov 2021 00:36:50 +0100 Subject: pkgs/Profpatsch/xdg-open: add libreoffice mimetype MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also make sure libreoffice is only installed/pulled when clicking on the link (although there could be a popup of sorts if it has to do stuff …). --- pkgs/profpatsch/xdg-open/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/profpatsch/xdg-open/default.nix') diff --git a/pkgs/profpatsch/xdg-open/default.nix b/pkgs/profpatsch/xdg-open/default.nix index 30ff275e..28444a47 100644 --- a/pkgs/profpatsch/xdg-open/default.nix +++ b/pkgs/profpatsch/xdg-open/default.nix @@ -103,6 +103,10 @@ let ] ++ args file; }; + fetch-command-on-demand = cmd: pkgs.vuizvui.lazy-packages.mkWrapper { + package = cmd; + }; + fetch-http-url-mime = { exe = writeExecline "fetch-http-url-mime" { readNArgs = 1; } [ "pipeline" [ read-headers-and-follow-redirect "$1" ] @@ -130,6 +134,7 @@ let → ∀(write-dash : Text → Text → Text) → ∀(shellEscape : Text → Text) → ∀(pkgs : { binary : Text, package : Text } → Text) +→ ∀(pkgsOnDemand : { binary : Text, package : Text } → Text) → ∀ ( special : { compose-mail-to : Command , dmenu-list-binaries-and-exec : Command @@ -160,11 +165,15 @@ let pkgs.writers.writeDash pkgs.lib.escapeShellArg ({binary, package}: "${lib.getBin pkgs.${package}}/bin/${binary}") + ({binary, package}: "${pkgs.vuizvui.lazy-packages.mkWrapper { + package = (lib.getBin pkgs.${package}); + }}/bin/${binary}") { inherit compose-mail-to open-in-browser fetch-http-url-mime + fetch-command-on-demand open-in-editor dmenu-list-binaries-and-exec exec-in-terminal-emulator -- cgit 1.4.1