-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Nikolay Korotkiy <sikmir@disroot.org> Co-authored-by: éclairevoyant <848000+eclairevoyant@users.noreply.github.com>
- Loading branch information
1 parent
e678a65
commit 864bf23
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{ | ||
lib, | ||
stdenv, | ||
buildGoModule, | ||
fetchFromGitHub, | ||
installShellFiles, | ||
}: | ||
|
||
buildGoModule rec { | ||
pname = "aliae"; | ||
version = "0.22.1"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "jandedobbeleer"; | ||
repo = "aliae"; | ||
rev = "refs/tags/v${version}"; | ||
hash = "sha256-slixB7mzEdX3ecgbM6tO9IzVH+1w6DwssD1X3MrwAHw="; | ||
}; | ||
|
||
vendorHash = "sha256-U0Mt2U8WxDFDadIxASz609tUtiF4tETobAmYrk29Lh0="; | ||
|
||
sourceRoot = "${src.name}/src"; | ||
|
||
nativeBuildInputs = [ installShellFiles ]; | ||
|
||
ldflags = [ | ||
"-s" | ||
"-w" | ||
"-X main.Version=${version}" | ||
]; | ||
|
||
tags = [ | ||
"netgo" | ||
"osusergo" | ||
"static_build" | ||
]; | ||
|
||
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 ]; | ||
}; | ||
} |