diff --git a/pkgs/by-name/pa/panache/package.nix b/pkgs/by-name/pa/panache/package.nix new file mode 100644 index 000000000000..ccb6657c9947 --- /dev/null +++ b/pkgs/by-name/pa/panache/package.nix @@ -0,0 +1,47 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + installShellFiles, + versionCheckHook, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "panache"; + version = "2.18.0"; + + src = fetchFromGitHub { + owner = "jolars"; + repo = "panache"; + tag = "v${finalAttrs.version}"; + hash = "sha256-VI4Ma0wSHeQc5Rofz2sIyUkHmZSBm5woMcHTEM/a9wk="; + }; + + cargoHash = "sha256-iliilk0uAOwdiYqJwkbdslwxcU6WLgReN2ZDEVki6js="; + + nativeBuildInputs = [ + installShellFiles + ]; + + nativeInstallCheckInputs = [ + versionCheckHook + ]; + + postInstall = '' + installShellCompletion --cmd panache \ + --bash target/completions/panache.bash \ + --fish target/completions/panache.fish \ + --zsh target/completions/_panache + + installManPage target/man/* + ''; + + meta = { + description = "Language server, formatter, and linter for Pandoc, Quarto, and R Markdown"; + homepage = "https://github.com/jolars/panache"; + changelog = "https://github.com/jolars/panache/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = [ lib.maintainers.jolars ]; + mainProgram = "panache"; + }; +})