biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / tools / oh-my-posh / default.nix
blobcd73494140da199e640656e8917143becb9814bf
1 { lib
2 , buildGoModule
3 , fetchFromGitHub
4 , installShellFiles
5 }:
7 buildGoModule rec {
8   pname = "oh-my-posh";
9   version = "19.24.2";
11   src = fetchFromGitHub {
12     owner = "jandedobbeleer";
13     repo = pname;
14     rev = "refs/tags/v${version}";
15     hash = "sha256-xr6ULlOBmRF1s/oge+AnANLGkP30U6T1tgoBvnCLf/4=";
16   };
18   vendorHash = "sha256-iSbQn86b1xZwlyo5nKYI7LEH5AyWCw7MLgD3Q0mtFfk=";
20   sourceRoot = "${src.name}/src";
22   nativeBuildInputs = [
23     installShellFiles
24   ];
26   ldflags = [
27     "-s"
28     "-w"
29     "-X github.com/jandedobbeleer/oh-my-posh/src/build.Version=${version}"
30     "-X github.com/jandedobbeleer/oh-my-posh/src/build.Date=1970-01-01T00:00:00Z"
31   ];
33   tags = [
34     "netgo"
35     "osusergo"
36     "static_build"
37   ];
39   postPatch = ''
40     # these tests requires internet access
41     rm engine/image_test.go engine/migrate_glyphs_test.go
42   '';
44   postInstall = ''
45     mv $out/bin/{src,oh-my-posh}
46     mkdir -p $out/share/oh-my-posh
47     cp -r ${src}/themes $out/share/oh-my-posh/
48     installShellCompletion --cmd oh-my-posh \
49       --bash <($out/bin/oh-my-posh completion bash) \
50       --fish <($out/bin/oh-my-posh completion fish) \
51       --zsh <($out/bin/oh-my-posh completion zsh)
52   '';
54   meta = with lib; {
55     description = "A prompt theme engine for any shell";
56     mainProgram = "oh-my-posh";
57     homepage = "https://ohmyposh.dev";
58     changelog = "https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v${version}";
59     license = licenses.mit;
60     maintainers = with maintainers; [ lucperkins urandom ];
61   };