45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ lib, buildNimPackage, fetchFromGitea, makeDesktopItem, pkg-config, pcre, syndicate }:
|
|
|
|
buildNimPackage rec {
|
|
pname = "xdg_open_ng";
|
|
version = "20230518";
|
|
nimBinOnly = true;
|
|
|
|
src = fetchFromGitea {
|
|
domain = "git.syndicate-lang.org";
|
|
owner = "ehmry";
|
|
repo = pname;
|
|
rev = version;
|
|
hash = "sha256-xoUcX3Vwz0Gnishqpe2hWo9x7HiNwagMBLW9nk9ZVWY=";
|
|
};
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
|
|
propagatedBuildInputs = [ pcre syndicate ];
|
|
|
|
desktopItem = makeDesktopItem rec {
|
|
name = "xdg-open";
|
|
desktopName = "Syndicate URI dispatcher (xdg-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 = ''
|
|
mv $out/bin/xdg_open $out/bin/xdg-open
|
|
cp -a $desktopItem/* $out/
|
|
'';
|
|
|
|
meta = src.meta // {
|
|
description = "Replacement for xdg-open that uses Syndicate for messaging.";
|
|
maintainers = [ lib.maintainers.ehmry ];
|
|
license = lib.licenses.unlicense;
|
|
};
|
|
}
|