2022-12-04 11:57:13 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
}:
|
2022-08-01 15:21:38 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "oh-my-posh";
|
2023-11-22 16:08:57 +00:00
|
|
|
version = "18.26.1";
|
2022-08-01 15:21:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jandedobbeleer";
|
|
|
|
repo = pname;
|
2022-12-04 11:57:13 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-11-22 16:08:57 +00:00
|
|
|
hash = "sha256-8MK8YzBplbP1de8QKJJBLgbMd1K+H2sVutwKSskU82Q=";
|
2022-08-01 15:21:38 +00:00
|
|
|
};
|
|
|
|
|
2023-11-22 16:08:57 +00:00
|
|
|
vendorHash = "sha256-ivd30IEoF9WuGDzufIOXJ8LUqHp3zPaiPgplj9jqzqw=";
|
2022-08-01 15:21:38 +00:00
|
|
|
|
2023-07-25 13:27:31 +00:00
|
|
|
sourceRoot = "${src.name}/src";
|
2022-08-01 15:21:38 +00:00
|
|
|
|
2022-12-04 11:57:13 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
];
|
2022-09-24 18:27:00 +00:00
|
|
|
|
2022-12-04 11:57:13 +00:00
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
2023-07-08 22:10:00 +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-04 11:57:13 +00:00
|
|
|
];
|
2022-08-01 15:21:38 +00:00
|
|
|
|
2022-12-04 11:57:13 +00:00
|
|
|
tags = [
|
|
|
|
"netgo"
|
|
|
|
"osusergo"
|
|
|
|
"static_build"
|
|
|
|
];
|
2022-09-14 11:58:23 +00:00
|
|
|
|
2023-02-08 13:26:02 +00:00
|
|
|
postPatch = ''
|
2023-05-17 12:46:28 +00:00
|
|
|
# these tests requires internet access
|
|
|
|
rm engine/image_test.go engine/migrate_glyphs_test.go
|
2023-02-08 13:26:02 +00:00
|
|
|
'';
|
|
|
|
|
2022-09-14 11:58:23 +00:00
|
|
|
postInstall = ''
|
2023-01-09 01:45:41 +00:00
|
|
|
mv $out/bin/{src,oh-my-posh}
|
2022-09-14 11:58:23 +00:00
|
|
|
mkdir -p $out/share/oh-my-posh
|
|
|
|
cp -r ${src}/themes $out/share/oh-my-posh/
|
2022-09-24 18:27:00 +00:00
|
|
|
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-14 11:58:23 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-01 15:21:38 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A prompt theme engine for any shell";
|
|
|
|
homepage = "https://ohmyposh.dev";
|
2022-12-04 11:57:13 +00:00
|
|
|
changelog = "https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v${version}";
|
2022-08-01 15:21:38 +00:00
|
|
|
license = licenses.mit;
|
2022-11-27 02:57:42 +00:00
|
|
|
maintainers = with maintainers; [ lucperkins urandom ];
|
2022-08-01 15:21:38 +00:00
|
|
|
};
|
|
|
|
}
|