depot/third_party/nixpkgs/pkgs/by-name/al/aliae/package.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

56 lines
1.2 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
}:
buildGoModule rec {
pname = "aliae";
version = "0.22.2";
src = fetchFromGitHub {
owner = "jandedobbeleer";
repo = "aliae";
rev = "refs/tags/v${version}";
hash = "sha256-IpOfTCMbnNUW8flyb7p98QEwveNb8wClyBuv7fAKm8Y=";
};
vendorHash = "sha256-aUKF/r0OFN0gZXCKHFYKyQa806NFP5lQAONFZlMP4vE=";
sourceRoot = "${src.name}/src";
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
tags = [
"netgo"
"osusergo"
];
postInstall =
''
mv $out/bin/{src,aliae}
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd aliae \
--bash <($out/bin/aliae completion bash) \
--fish <($out/bin/aliae completion fish) \
--zsh <($out/bin/aliae completion zsh)
'';
meta = {
description = "Cross shell and platform alias management";
mainProgram = "aliae";
homepage = "https://aliae.dev";
changelog = "https://github.com/JanDeDobbeleer/aliae/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ vedantmgoyal9 ];
};
}