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