-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathflake.nix
58 lines (52 loc) · 2.13 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
description = "A fuzzy Tmux session manager with preview capabilities, deleting, renaming and more!";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
];
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
perSystem = {
config,
self',
inputs',
pkgs,
system,
lib,
...
}: {
packages.default = pkgs.tmuxPlugins.mkTmuxPlugin {
pluginName = "sessionx";
version = "dev";
src = ./.;
nativeBuildInputs = [pkgs.makeWrapper];
postPatch = ''
substituteInPlace sessionx.tmux \
--replace "\$CURRENT_DIR/scripts/sessionx.sh" "$out/share/tmux-plugins/sessionx/scripts/sessionx.sh"
substituteInPlace scripts/sessionx.sh \
--replace "/tmux-sessionx/scripts/preview.sh" "$out/share/tmux-plugins/sessionx/scripts/preview.sh"
substituteInPlace scripts/sessionx.sh \
--replace "/tmux-sessionx/scripts/reload_sessions.sh" "$out/share/tmux-plugins/sessionx/scripts/reload_sessions.sh"
'';
postInstall = ''
chmod +x $target/scripts/sessionx.sh
wrapProgram $target/scripts/sessionx.sh \
--prefix PATH : ${with pkgs; lib.makeBinPath [zoxide fzf gnugrep gnused coreutils]}
chmod +x $target/scripts/preview.sh
wrapProgram $target/scripts/preview.sh \
--prefix PATH : ${with pkgs; lib.makeBinPath [coreutils gnugrep gnused]}
chmod +x $target/scripts/reload_sessions.sh
wrapProgram $target/scripts/reload_sessions.sh \
--prefix PATH : ${with pkgs; lib.makeBinPath [coreutils gnugrep gnused]}
'';
meta = with lib; {
description = "A fuzzy Tmux session manager with preview capabilities, deleting, renaming and more!";
homepage = "https://github.com./omerxx/tmux-sessionx";
platforms = platforms.all;
};
};
};
};
}