nixpkgs/pkgs/tools/admin/colmena/default.nix

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

48 lines
1.4 KiB
Nix
Raw Normal View History

2022-04-28 02:45:06 +02:00
{ stdenv, lib, rustPlatform, fetchFromGitHub, installShellFiles, nix-eval-jobs
, colmena, testers }:
2021-12-01 05:49:12 +01:00
rustPlatform.buildRustPackage rec {
pname = "colmena";
2023-05-15 07:27:01 +02:00
version = "0.4.0";
2021-12-01 05:49:12 +01:00
src = fetchFromGitHub {
owner = "zhaofengli";
repo = "colmena";
rev = "v${version}";
2023-05-15 07:27:01 +02:00
sha256 = "sha256-01bfuSY4gnshhtqA1EJCw2CMsKkAx+dHS+sEpQ2+EAQ=";
2021-12-01 05:49:12 +01:00
};
2023-05-15 07:27:01 +02:00
cargoSha256 = "sha256-rk2atWWJIR95duUXxAiARegjeCyfAsqTDwEr5P0eIr8=";
2021-12-01 05:49:12 +01:00
nativeBuildInputs = [ installShellFiles ];
2022-04-28 02:45:06 +02:00
buildInputs = [ nix-eval-jobs ];
NIX_EVAL_JOBS = "${nix-eval-jobs}/bin/nix-eval-jobs";
2021-12-01 05:49:12 +01:00
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
installShellCompletion --cmd colmena \
--bash <($out/bin/colmena gen-completions bash) \
--zsh <($out/bin/colmena gen-completions zsh) \
--fish <($out/bin/colmena gen-completions fish)
'';
# Recursive Nix is not stable yet
doCheck = false;
passthru = {
# We guarantee CLI and Nix API stability for the same minor version
apiVersion = builtins.concatStringsSep "." (lib.take 2 (lib.splitString "." version));
tests.version = testers.testVersion { package = colmena; };
2021-12-01 05:49:12 +01:00
};
meta = with lib; {
description = "A simple, stateless NixOS deployment tool";
2023-05-15 07:27:01 +02:00
homepage = "https://colmena.cli.rs/${passthru.apiVersion}";
2021-12-01 05:49:12 +01:00
license = licenses.mit;
maintainers = with maintainers; [ zhaofengli ];
2022-04-28 02:45:06 +02:00
platforms = platforms.linux ++ platforms.darwin;
2021-12-01 05:49:12 +01:00
};
}