syndicate-flake/packages/syndicated-open/default.nix

45 lines
1.0 KiB
Nix

{ lib, buildNimPackage, fetchFromGitea, makeDesktopItem, pkg-config, pcre, syndicate }:
buildNimPackage rec {
pname = "syndicated-open";
version = "20230630";
nimBinOnly = true;
src = fetchFromGitea {
domain = "git.syndicate-lang.org";
owner = "ehmry";
repo = pname;
rev = version;
hash = "sha256-BRSvsIkaingUhtaBKQYwFzr6uC4WFs2/BmfWWPfI/6s=";
};
nativeBuildInputs = [ pkg-config ];
propagatedBuildInputs = [ pcre syndicate ];
desktopItem = makeDesktopItem rec {
name = "open";
desktopName = "Syndicated URI open";
exec = "${name} %U";
mimeTypes = [
"application/vnd.mozilla.xul+xml"
"application/xhtml+xml"
"text/html"
"text/xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
postInstall = ''
ln -s open $out/bin/xdg-open
cp -a $desktopItem/* $out/
'';
meta = src.meta // {
description = "Syndicated open command";
maintainers = [ lib.maintainers.ehmry ];
license = lib.licenses.unlicense;
};
}