System/packages/swayimg/default.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

{ config, lib, pkgs, stdenv, fetchurl, meson, ninja, pkg-config, git, cmake
, makeDesktopItem, wayland, wayland-protocols, json_c, libxkbcommon, fontconfig
, giflib, libjpeg, libjxl, libpng, librsvg, libwebp, libheif, libtiff, libexif
2023-07-21 03:55:23 -04:00
, bash-completion, openexr_3, ... }:
2023-05-14 18:54:38 -04:00
let
vals = builtins.fromJSON (builtins.readFile ../../sources/swayimg.json);
version = vals.version;
url = vals.url;
hash = vals.hash;
in stdenv.mkDerivation rec {
2022-09-18 20:25:20 -04:00
pname = "swayimg";
2023-05-14 18:54:38 -04:00
inherit version;
2022-09-18 20:25:20 -04:00
src = fetchurl {
2023-05-14 18:54:38 -04:00
inherit url;
inherit hash;
2022-09-18 20:25:20 -04:00
name = "${pname}-${version}.tar.gz";
};
nativeBuildInputs = [ meson ninja pkg-config git cmake ];
buildInputs = [
wayland
wayland-protocols
json_c
libxkbcommon
fontconfig
giflib
libjpeg
libjxl
libpng
librsvg
libwebp
libheif
libtiff
libexif
bash-completion
2023-07-21 03:55:23 -04:00
openexr_3
2022-09-18 20:25:20 -04:00
];
desktopItem = makeDesktopItem {
name = "swayimg-open";
desktopName = "swayimg";
exec = "swayimg %u";
terminal = false;
mimeTypes = [
"image/jpeg"
"image/png"
"image/gif"
"image/svg+xml"
"image/webp"
"image/avif"
"image/tiff"
"image/bmp"
];
};
}