summary refs log tree commit diff
path: root/pkgs/tools/admin/colmena/default.nix
diff options
context:
space:
mode:
authorZhaofeng Li <hello@zhaofeng.li>2021-11-30 20:49:12 -0800
committerZhaofeng Li <hello@zhaofeng.li>2021-12-05 14:49:06 -0800
commit9c5f93a473ea82b22866dcd22dca46f8d180e556 (patch)
tree75cad571e7fcdd6331bfaebba2ef52687631c18c /pkgs/tools/admin/colmena/default.nix
parentc6fc79a2ac611b58ff93574cf787260ed2101d06 (diff)
downloadnixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.tar
nixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.tar.gz
nixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.tar.bz2
nixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.tar.lz
nixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.tar.xz
nixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.tar.zst
nixpkgs-9c5f93a473ea82b22866dcd22dca46f8d180e556.zip
colmena: init at 0.2.0
Diffstat (limited to 'pkgs/tools/admin/colmena/default.nix')
-rw-r--r--pkgs/tools/admin/colmena/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/tools/admin/colmena/default.nix b/pkgs/tools/admin/colmena/default.nix
new file mode 100644
index 00000000000..e95475be339
--- /dev/null
+++ b/pkgs/tools/admin/colmena/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, rustPlatform, fetchFromGitHub, installShellFiles, colmena, testVersion }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "colmena";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "zhaofengli";
+    repo = "colmena";
+    rev = "v${version}";
+    sha256 = "sha256-WY8SYapnDcfaoLr1iFgwc9/E7xSfOFN2AvMDpk74AI8=";
+  };
+
+  cargoSha256 = "sha256-ZNSg3hXWKHNQ9yHJS1qW3tFYwzU4ZDa1N0yvoGLmWns=";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  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 = testVersion { package = colmena; };
+  };
+
+  meta = with lib; {
+    description = "A simple, stateless NixOS deployment tool";
+    homepage = "https://zhaofengli.github.io/colmena/${passthru.apiVersion}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ zhaofengli ];
+    platforms = platforms.linux;
+  };
+}