nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 stdenv,
5 rustPlatform,
6 openssl,
7 pkg-config,
8 nix-update-script,
9 installShellFiles,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "twm";
14 version = "0.12.3";
15
16 src = fetchFromGitHub {
17 owner = "vinnymeller";
18 repo = "twm";
19 tag = "v${version}";
20 hash = "sha256-Hta9IvPViZFEiR+RXRmlPRwIu10D9B5dbXzhflxzBhY=";
21 };
22
23 cargoHash = "sha256-buiU+umHqyZ/3YoW2+5QpmF9AGEuNUihro5PFuWFSH4=";
24
25 nativeBuildInputs = [
26 pkg-config
27 installShellFiles
28 ];
29 buildInputs = [
30 openssl
31 ];
32
33 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
34 installShellCompletion --cmd twm \
35 --bash <($out/bin/twm --print-bash-completion) \
36 --zsh <($out/bin/twm --print-zsh-completion) \
37 --fish <($out/bin/twm --print-fish-completion)
38
39 $out/bin/twm --print-man > twm.1
40 installManPage twm.1
41 '';
42
43 passthru.updateScript = nix-update-script { };
44
45 meta = {
46 description = "Customizable workspace manager for tmux";
47 homepage = "https://github.com/vinnymeller/twm";
48 changelog = "https://github.com/vinnymeller/twm/releases/tag/v${version}";
49 license = lib.licenses.mit;
50 maintainers = [ lib.maintainers.vinnymeller ];
51 mainProgram = "twm";
52 };
53}