2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oh-my-posh";
|
2024-10-04 16:56:33 +00:00
|
|
|
version = "23.15.0";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jandedobbeleer";
|
|
|
|
repo = pname;
|
2022-12-17 10:02:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-04 16:56:33 +00:00
|
|
|
hash = "sha256-gZCR7cDSI0gRaTnYADOLpyHe26URo27JXJjnNxr4Jwc=";
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
|
2024-10-04 16:56:33 +00:00
|
|
|
vendorHash = "sha256-EBLfbdTV15wSTOThzBY0d2KrSJzRaB8vNH53Uwc+XfM=";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
sourceRoot = "${src.name}/src";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-07-15 17:15:38 +00:00
|
|
|
"-X github.com/jandedobbeleer/oh-my-posh/src/build.Version=${version}"
|
|
|
|
"-X github.com/jandedobbeleer/oh-my-posh/src/build.Date=1970-01-01T00:00:00Z"
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
tags = [
|
|
|
|
"netgo"
|
|
|
|
"osusergo"
|
|
|
|
"static_build"
|
|
|
|
];
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
postPatch = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
# these tests requires internet access
|
2024-09-19 14:19:46 +00:00
|
|
|
rm image/image_test.go config/migrate_glyphs_test.go upgrade/notice_test.go
|
2023-02-09 11:40:11 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
postInstall = ''
|
2023-01-11 07:51:40 +00:00
|
|
|
mv $out/bin/{src,oh-my-posh}
|
2022-09-30 11:47:45 +00:00
|
|
|
mkdir -p $out/share/oh-my-posh
|
|
|
|
cp -r ${src}/themes $out/share/oh-my-posh/
|
|
|
|
installShellCompletion --cmd oh-my-posh \
|
|
|
|
--bash <($out/bin/oh-my-posh completion bash) \
|
|
|
|
--fish <($out/bin/oh-my-posh completion fish) \
|
|
|
|
--zsh <($out/bin/oh-my-posh completion zsh)
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Prompt theme engine for any shell";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "oh-my-posh";
|
2022-09-09 14:08:57 +00:00
|
|
|
homepage = "https://ohmyposh.dev";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v${version}";
|
2022-09-09 14:08:57 +00:00
|
|
|
license = licenses.mit;
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = with maintainers; [ lucperkins urandom ];
|
2022-09-09 14:08:57 +00:00
|
|
|
};
|
|
|
|
}
|