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.

56 lines
1.2 KiB
Nix
Raw Normal View History

2022-12-04 12:57:13 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
, installShellFiles
}:
2022-08-01 17:21:38 +02:00
buildGoModule rec {
pname = "oh-my-posh";
version = "12.35.2";
2022-08-01 17:21:38 +02:00
src = fetchFromGitHub {
owner = "jandedobbeleer";
repo = pname;
2022-12-04 12:57:13 +01:00
rev = "refs/tags/v${version}";
hash = "sha256-6w8m7AuSEFhoYhjAJMXmwpsYuIMCvTiFKasUnBgYYCM=";
2022-08-01 17:21:38 +02:00
};
vendorHash = "sha256-WiH4qu8DODEhAkxUm6VDcBwFyQO7kNjaiaWPDHCHj9E=";
2022-08-01 17:21:38 +02:00
sourceRoot = "source/src";
2022-12-04 12:57:13 +01:00
nativeBuildInputs = [
installShellFiles
];
2022-09-24 20:27:00 +02:00
2022-12-04 12:57:13 +01:00
ldflags = [
"-s"
"-w"
"-X main.Version=${version}"
];
2022-08-01 17:21:38 +02:00
2022-12-04 12:57:13 +01:00
tags = [
"netgo"
"osusergo"
"static_build"
];
postInstall = ''
mv $out/bin/{src,oh-my-posh}
mkdir -p $out/share/oh-my-posh
cp -r ${src}/themes $out/share/oh-my-posh/
2022-09-24 20:27:00 +02: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 17:21:38 +02:00
meta = with lib; {
description = "A prompt theme engine for any shell";
homepage = "https://ohmyposh.dev";
2022-12-04 12:57:13 +01:00
changelog = "https://github.com/JanDeDobbeleer/oh-my-posh/releases/tag/v${version}";
2022-08-01 17:21:38 +02:00
license = licenses.mit;
maintainers = with maintainers; [ lucperkins urandom ];
2022-08-01 17:21:38 +02:00
};
}