nixpkgs/pkgs/tools/misc/zellij/default.nix
2021-11-30 00:28:56 +01:00

58 lines
1.3 KiB
Nix

{ lib
, fetchFromGitHub
, rustPlatform
, stdenv
, installShellFiles
, pkg-config
, libiconv
, openssl
, zellij
, testVersion
}:
rustPlatform.buildRustPackage rec {
pname = "zellij";
version = "0.21.0";
src = fetchFromGitHub {
owner = "zellij-org";
repo = "zellij";
rev = "v${version}";
sha256 = "1n033qvidahpfsp4k3x30sav3asldhjlsbydb23vg0v7bxjl2c2q";
};
cargoSha256 = "1pjmlwx966pgri58xx2zqr84wili0bzpl9gzhjdkvcx0j1f66anb";
nativeBuildInputs = [
installShellFiles
pkg-config
];
buildInputs = [
openssl
] ++ lib.optionals stdenv.isDarwin [
libiconv
];
preCheck = ''
HOME=$TMPDIR
'';
postInstall = ''
installShellCompletion --cmd $pname \
--bash <($out/bin/zellij setup --generate-completion bash) \
--fish <($out/bin/zellij setup --generate-completion fish) \
--zsh <($out/bin/zellij setup --generate-completion zsh)
'';
passthru.tests.version = testVersion { package = zellij; };
meta = with lib; {
description = "A terminal workspace with batteries included";
homepage = "https://zellij.dev/";
changelog = "https://github.com/zellij-org/zellij/blob/v${version}/Changelog.md";
license = with licenses; [ mit ];
maintainers = with maintainers; [ therealansh _0x4A6F ];
};
}