Add start-tmux
This commit is contained in:
parent
bb8b5deb9f
commit
e2e4aab391
1 changed files with 33 additions and 0 deletions
33
modules/scripts/start-tmux.nix
Normal file
33
modules/scripts/start-tmux.nix
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{ withSystem, ... }:
|
||||
|
||||
let
|
||||
name = "start-tmux";
|
||||
in
|
||||
{
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
packages.${name} = pkgs.writeShellApplication {
|
||||
inherit name;
|
||||
|
||||
# TODO: Add `z` once its available as a package.
|
||||
runtimeInputs = with pkgs; [
|
||||
fzf
|
||||
];
|
||||
|
||||
text = ''
|
||||
selected="$(z tmux session list | fzf)"
|
||||
|
||||
[[ -n $selected ]] && z tmux session connect "$selected"
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
flake.modules.homeManager.base =
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
home.packages = [
|
||||
(withSystem pkgs.system (psArgs: psArgs.config.packages.${name}))
|
||||
];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue