diff options
author | Mario Rodas <marsam@users.noreply.github.com> | 2023-09-22 06:40:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-22 06:40:31 -0500 |
commit | 95d0033fa81f96eb48d740b6673310960adc0dc1 (patch) | |
tree | 0bd5427be61709eb55de10df758f7ecdbe5683d4 /pkgs/by-name | |
parent | a65921ce99e59cde6743776b7ea6fb42c297e531 (diff) | |
parent | 31a534effb42607e98802bbec82e91480fea5af4 (diff) |
Merge pull request #255223 from techknowlogick/orchard-init
orchard: init at 0.12.0
Diffstat (limited to 'pkgs/by-name')
-rw-r--r-- | pkgs/by-name/or/orchard/package.nix | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/by-name/or/orchard/package.nix b/pkgs/by-name/or/orchard/package.nix new file mode 100644 index 0000000000000..07e48c5867019 --- /dev/null +++ b/pkgs/by-name/or/orchard/package.nix @@ -0,0 +1,55 @@ +{ lib, fetchFromGitHub, buildGoModule, installShellFiles }: + +buildGoModule rec { + pname = "orchard"; + version = "0.12.0"; + + src = fetchFromGitHub { + owner = "cirruslabs"; + repo = pname; + rev = version; + hash = "sha256-+QNYlZ3/GiDtCySZPOlrDy03lkdGGvbFCWidQhbZJYQ="; + # populate values that require us to use git. By doing this in postFetch we + # can delete .git afterwards and maintain better reproducibility of the src. + leaveDotGit = true; + postFetch = '' + cd "$out" + git rev-parse HEAD > $out/COMMIT + find "$out" -name .git -print0 | xargs -0 rm -rf + ''; + }; + + vendorHash = "sha256-BrzS+QtpGUHcYNNmSI6FlBtcYwNFri7R6nlVvFihdb4="; + + nativeBuildInputs = [ installShellFiles ]; + + ldflags = [ + "-w" + "-s" + "-X github.com/cirruslabs/orchard/internal/version.Version=${version}" + ]; + + # ldflags based on metadata from git and source + preBuild = '' + ldflags+=" -X github.com/cirruslabs/orchard/internal/version.Commit=$(cat COMMIT)" + ''; + + subPackages = [ "cmd/orchard" ]; + + postInstall = '' + export HOME="$(mktemp -d)" + installShellCompletion --cmd orchard \ + --bash <($out/bin/orchard completion bash) \ + --zsh <($out/bin/orchard completion zsh) \ + --fish <($out/bin/orchard completion fish) + ''; + + meta = with lib; { + mainProgram = "orchard"; + description = + "Orchestrator for running Tart Virtual Machines on a cluster of Apple Silicon devices"; + homepage = "https://github.com/cirruslabs/orchard"; + license = licenses.fairsource09; + maintainers = with maintainers; [ techknowlogick ]; + }; +} |