nixpkgs/pkgs/by-name/sn/snippetexpanderd/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

69 lines
1.3 KiB
Nix
Raw Normal View History

2023-11-24 16:48:16 +00:00
{ lib
, buildGoModule
, fetchFromSourcehut
, makeWrapper
, scdoc
, installShellFiles
2024-03-29 17:54:53 +00:00
, xclip
, wl-clipboard
, xdotool
, wtype
2023-11-24 16:48:16 +00:00
}:
buildGoModule rec {
pname = "snippetexpanderd";
2024-07-16 07:40:08 +00:00
version = "1.0.3";
2023-11-24 16:48:16 +00:00
src = fetchFromSourcehut {
owner = "~ianmjones";
repo = "snippetexpander";
rev = "v${version}";
2024-07-16 07:40:08 +00:00
hash = "sha256-NIMuACrq8RodtjeBbBY42VJ8xqj7fZvdQ2w/5QsjjJI=";
2023-11-24 16:48:16 +00:00
};
2024-07-16 07:40:08 +00:00
vendorHash = "sha256-2nLO/b6XQC88VXE+SewhgKpkRtIHsva+fDudgKpvZiY=";
2024-03-29 17:54:53 +00:00
proxyVendor = true;
2023-11-24 16:48:16 +00:00
modRoot = "cmd/snippetexpanderd";
nativeBuildInputs = [
makeWrapper
scdoc
installShellFiles
];
buildInputs = [
2024-03-29 17:54:53 +00:00
xclip
wl-clipboard
xdotool
wtype
2023-11-24 16:48:16 +00:00
];
ldflags = [
"-s"
"-w"
2024-03-29 17:54:53 +00:00
"-X 'main.version=${src.rev}'"
2023-11-24 16:48:16 +00:00
];
postInstall = ''
make man
installManPage snippetexpanderd.1 snippetexpander-placeholders.5
'';
postFixup = ''
2024-03-29 17:54:53 +00:00
# Ensure xclip/wcopy and xdotool/wtype are available for copy and paste duties.
2023-11-24 16:48:16 +00:00
wrapProgram $out/bin/snippetexpanderd \
2024-03-29 17:54:53 +00:00
--prefix PATH : ${lib.makeBinPath [ xclip wl-clipboard xdotool wtype ]}
2023-11-24 16:48:16 +00:00
'';
2024-03-29 17:54:53 +00:00
meta = {
2023-11-24 16:48:16 +00:00
description = "Your little expandable text snippet helper daemon";
homepage = "https://snippetexpander.org";
2024-03-29 17:54:53 +00:00
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ianmjones ];
platforms = lib.platforms.linux;
2023-11-24 16:48:16 +00:00
mainProgram = "snippetexpanderd";
};
}