From f2aa0efe21f86e927b27ae53397e485fd239a8a4 Mon Sep 17 00:00:00 2001 From: Donovan Glover Date: Thu, 24 Aug 2023 17:25:24 -0400 Subject: [PATCH] feat: Add thumbnail support for webp files --- packages/default.nix | 2 ++ packages/webp-thumbnailer.nix | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 packages/webp-thumbnailer.nix diff --git a/packages/default.nix b/packages/default.nix index 7357c475..c563cd11 100644 --- a/packages/default.nix +++ b/packages/default.nix @@ -4,10 +4,12 @@ environment.pathsToLink = [ "/share/backgrounds" "/share/eww" + "/share/thumbnailers" ]; environment.systemPackages = [ (pkgs.callPackage ./osu-backgrounds.nix { }) (pkgs.callPackage ./fluent-icons.nix { }) + (pkgs.callPackage ./webp-thumbnailer.nix { }) ]; } diff --git a/packages/webp-thumbnailer.nix b/packages/webp-thumbnailer.nix new file mode 100644 index 00000000..eca3ba8b --- /dev/null +++ b/packages/webp-thumbnailer.nix @@ -0,0 +1,23 @@ +{ stdenvNoCC +, libwebp +}: + +stdenvNoCC.mkDerivation { + pname = "webp-thumbnailer"; + version = "1.0.0"; + + src = ../assets; + + postInstall = /* bash */ '' + mkdir -p $out/share/thumbnailers + + echo "[Thumbnailer Entry]" >> $out/share/thumbnailers/webp.thumbnailer + echo "Exec=${libwebp}/bin/dwebp %i -scale %s 0 -o %o" >> $out/share/thumbnailers/webp.thumbnailer + echo "MimeType=image/x-webp;image/webp;" >> $out/share/thumbnailers/webp.thumbnailer + ''; + + meta = { + homepage = "https://github.com/liquuid/nautilus-webp-thumbnailer"; + description = "Create thumbnails from webp files"; + }; +}