2022-04-27 09:35:20 +00:00
|
|
|
{ stdenv, lib, rustPlatform, fetchFromGitHub, installShellFiles, nix-eval-jobs
|
|
|
|
, colmena, testers }:
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "colmena";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "0.4.0";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "zhaofengli";
|
|
|
|
repo = "colmena";
|
|
|
|
rev = "v${version}";
|
2023-05-24 13:37:59 +00:00
|
|
|
sha256 = "sha256-01bfuSY4gnshhtqA1EJCw2CMsKkAx+dHS+sEpQ2+EAQ=";
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
cargoSha256 = "sha256-rk2atWWJIR95duUXxAiARegjeCyfAsqTDwEr5P0eIr8=";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
buildInputs = [ nix-eval-jobs ];
|
|
|
|
|
|
|
|
NIX_EVAL_JOBS = "${nix-eval-jobs}/bin/nix-eval-jobs";
|
|
|
|
|
2021-12-06 16:07:01 +00: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));
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
tests.version = testers.testVersion { package = colmena; };
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A simple, stateless NixOS deployment tool";
|
2023-05-24 13:37:59 +00:00
|
|
|
homepage = "https://colmena.cli.rs/${passthru.apiVersion}";
|
2021-12-06 16:07:01 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zhaofengli ];
|
2022-04-27 09:35:20 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2021-12-06 16:07:01 +00:00
|
|
|
};
|
|
|
|
}
|