2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, openssl
|
|
|
|
, pkg-config
|
|
|
|
, Security
|
2024-06-05 15:53:02 +00:00
|
|
|
, nix-update-script
|
|
|
|
, installShellFiles
|
2023-04-29 16:46:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "twm";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "0.10.2";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "vinnymeller";
|
2024-06-05 15:53:02 +00:00
|
|
|
repo = "twm";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-qOOEeaxae7nYbvNzl3BEZkdjO69lgtGrrLS5Q7akN9U=";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
cargoHash = "sha256-gJ5go9V8c97pQZICUD1ksLJhOyJXyVXAWssH3fhrRVQ=";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ pkg-config installShellFiles ];
|
2023-04-29 16:46:19 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd twm \
|
|
|
|
--bash <($out/bin/twm --print-bash-completion) \
|
|
|
|
--zsh <($out/bin/twm --print-zsh-completion) \
|
|
|
|
--fish <($out/bin/twm --print-fish-completion)
|
|
|
|
|
|
|
|
$out/bin/twm --print-man > twm.1
|
|
|
|
installManPage twm.1
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Customizable workspace manager for tmux";
|
2023-04-29 16:46:19 +00:00
|
|
|
homepage = "https://github.com/vinnymeller/twm";
|
2024-06-05 15:53:02 +00:00
|
|
|
changelog = "https://github.com/vinnymeller/twm/releases/tag/${src.rev}";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = [ lib.maintainers.vinnymeller ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "twm";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
}
|