default.nix: Match what was merged in Nixpkgs

This commit is contained in:
Zhaofeng Li 2021-12-06 12:26:19 -08:00
parent b88a19b904
commit 4a31a01c4f

View file

@ -7,14 +7,11 @@ let
in { in {
pkgs ? lockedPkgs, pkgs ? lockedPkgs,
}: let }: let
inherit (pkgs) lib stdenv rustPlatform; inherit (pkgs) lib stdenv rustPlatform installShellFiles;
in rustPlatform.buildRustPackage rec { in rustPlatform.buildRustPackage rec {
pname = "colmena"; pname = "colmena";
version = "0.3.0-pre"; version = "0.3.0-pre";
# We guarantee CLI and Nix API stability for the same minor version
apiVersion = builtins.concatStringsSep "." (lib.take 2 (lib.splitString "." version));
src = lib.cleanSourceWith { src = lib.cleanSourceWith {
filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) [ "target" "manual" "integration-tests" ]); filter = name: type: !(type == "directory" && builtins.elem (baseNameOf name) [ "target" "manual" "integration-tests" ]);
src = lib.cleanSource ./.; src = lib.cleanSource ./.;
@ -22,25 +19,28 @@ in rustPlatform.buildRustPackage rec {
cargoSha256 = "sha256-YE+0jsdkzRaiUhPC71WBe/KcYERNy7nME26+ejrPRlc="; cargoSha256 = "sha256-YE+0jsdkzRaiUhPC71WBe/KcYERNy7nME26+ejrPRlc=";
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' nativeBuildInputs = [ installShellFiles ];
mkdir completions
for shell in bash fish zsh; do
$out/bin/colmena gen-completions $shell > completions/$shell
done
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions} postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
cp completions/bash $out/share/bash-completion/completions/colmena installShellCompletion --cmd colmena \
cp completions/fish $out/share/fish/vendor_completions.d/colmena.fish --bash <($out/bin/colmena gen-completions bash) \
cp completions/zsh $out/share/zsh/site-functions/_colmena --zsh <($out/bin/colmena gen-completions zsh) \
--fish <($out/bin/colmena gen-completions fish)
''; '';
# Recursive Nix is not stable yet # Recursive Nix is not stable yet
doCheck = false; doCheck = false;
passthru = {
# We guarantee CLI and Nix API stability for the same minor version
apiVersion = builtins.concatStringsSep "." (lib.take 2 (lib.splitString "." version));
};
meta = with lib; { meta = with lib; {
description = "A simple, stateless NixOS deployment tool"; description = "A simple, stateless NixOS deployment tool";
homepage = "https://zhaofengli.github.io/colmena/${apiVersion}"; homepage = "https://zhaofengli.github.io/colmena/${apiVersion}";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ zhaofengli ]; maintainers = with maintainers; [ zhaofengli ];
platforms = platforms.linux;
}; };
} }