2023-11-24 17:48:16 +01:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromSourcehut
|
2024-03-29 18:54:53 +01:00
|
|
|
, makeWrapper
|
2023-11-24 17:48:16 +01:00
|
|
|
, scdoc
|
|
|
|
, installShellFiles
|
|
|
|
, snippetexpanderd
|
2024-03-29 18:54:53 +01:00
|
|
|
, snippetexpanderx
|
2023-11-24 17:48:16 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
inherit (snippetexpanderd) src version;
|
|
|
|
|
|
|
|
pname = "snippetexpander";
|
|
|
|
|
2024-03-29 18:54:53 +01:00
|
|
|
vendorHash = "sha256-W9NkENdZRzqSAONI9QS2EI5aERK+AaPqwYwITKLwXQE=";
|
2023-11-24 17:48:16 +01:00
|
|
|
|
|
|
|
proxyVendor = true;
|
|
|
|
|
|
|
|
modRoot = "cmd/snippetexpander";
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-03-29 18:54:53 +01:00
|
|
|
makeWrapper
|
2023-11-24 17:48:16 +01:00
|
|
|
scdoc
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
snippetexpanderd
|
2024-03-29 18:54:53 +01:00
|
|
|
snippetexpanderx
|
2023-11-24 17:48:16 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2024-03-29 18:54:53 +01:00
|
|
|
"-X 'main.version=${src.rev}'"
|
2023-11-24 17:48:16 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
make man
|
|
|
|
installManPage snippetexpander.1
|
|
|
|
'';
|
|
|
|
|
2024-03-29 18:54:53 +01:00
|
|
|
postFixup = ''
|
|
|
|
# Ensure snippetexpanderd and snippetexpanderx are available to start/stop.
|
|
|
|
wrapProgram $out/bin/snippetexpander \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ snippetexpanderd snippetexpanderx ]}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2023-11-24 17:48:16 +01:00
|
|
|
description = "Your little expandable text snippet helper CLI";
|
|
|
|
homepage = "https://snippetexpander.org";
|
2024-03-29 18:54:53 +01:00
|
|
|
license = lib.licenses.gpl2Plus;
|
|
|
|
maintainers = with lib.maintainers; [ ianmjones ];
|
|
|
|
platforms = lib.platforms.linux;
|
2023-11-24 17:48:16 +01:00
|
|
|
mainProgram = "snippetexpander";
|
|
|
|
};
|
|
|
|
}
|