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

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

58 lines
1.1 KiB
Nix
Raw Normal View History

2023-11-24 16:48:16 +00:00
{ lib
, buildGoModule
2024-03-29 17:54:53 +00:00
, makeWrapper
2023-11-24 16:48:16 +00:00
, scdoc
, installShellFiles
, snippetexpanderd
2024-03-29 17:54:53 +00:00
, snippetexpanderx
2023-11-24 16:48:16 +00:00
}:
buildGoModule rec {
inherit (snippetexpanderd) src version;
pname = "snippetexpander";
2024-07-16 07:40:08 +00:00
vendorHash = "sha256-2nLO/b6XQC88VXE+SewhgKpkRtIHsva+fDudgKpvZiY=";
2023-11-24 16:48:16 +00:00
proxyVendor = true;
modRoot = "cmd/snippetexpander";
nativeBuildInputs = [
2024-03-29 17:54:53 +00:00
makeWrapper
2023-11-24 16:48:16 +00:00
scdoc
installShellFiles
];
buildInputs = [
snippetexpanderd
2024-03-29 17:54:53 +00:00
snippetexpanderx
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 snippetexpander.1
'';
2024-03-29 17:54:53 +00: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 16:48:16 +00:00
description = "Your little expandable text snippet helper CLI";
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 = "snippetexpander";
};
}