nixpkgs/pkgs/development/tools/oh-my-posh/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

40 lines
1.0 KiB
Nix
Raw Normal View History

2022-09-24 19:27:00 +01:00
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
2022-08-01 16:21:38 +01:00
buildGoModule rec {
pname = "oh-my-posh";
2022-10-27 17:06:17 +01:00
version = "12.8.0";
2022-08-01 16:21:38 +01:00
src = fetchFromGitHub {
owner = "jandedobbeleer";
repo = pname;
rev = "v${version}";
2022-10-27 17:06:17 +01:00
sha256 = "sha256-TgfKsgRiSlPF3c2tdgr/1RTMZmN+9ME0BBdDrs0mPzo=";
2022-08-01 16:21:38 +01:00
};
2022-10-18 01:33:13 +01:00
vendorSha256 = "sha256-OrtKFkWXqVoXKmN6BT8YbCNjR1gRTT4gPNwmirn7fjU=";
2022-08-01 16:21:38 +01:00
sourceRoot = "source/src";
2022-09-24 19:27:00 +01:00
nativeBuildInputs = [ installShellFiles ];
2022-08-01 16:21:38 +01:00
ldflags = [ "-s" "-w" "-X" "main.Version=${version}" ];
tags = [ "netgo" "osusergo" "static_build" ];
postInstall = ''
mkdir -p $out/share/oh-my-posh
cp -r ${src}/themes $out/share/oh-my-posh/
2022-09-24 19:27:00 +01: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-08-01 16:21:38 +01:00
meta = with lib; {
description = "A prompt theme engine for any shell";
homepage = "https://ohmyposh.dev";
license = licenses.mit;
maintainers = with maintainers; [ lucperkins ];
};
}