add zux: pux for zellij

This commit is contained in:
Sridhar Ratnakumar 2023-04-07 11:43:27 -04:00
parent 5360052a29
commit 7e56577b71

View file

@ -1,4 +1,5 @@
{ pkgs, ... }:
{ pkgs, flake, ... }:
{
# Key packages required on nixos and macos
home.packages = with pkgs; [
@ -8,6 +9,28 @@
htop
nix-output-monitor
# Open zellij for current project.
# TODO: Use https://github.com/DeterminateSystems/nuenv via overlay.
(pkgs.writeShellApplication {
name = "zux";
runtimeInputs = [ pkgs.zellij pkgs.nushell ];
text =
let
script = pkgs.writeTextFile {
name = "zux.nu";
text = ''
let PRJ = (zoxide query -i)
let NAME = ($PRJ | parse $"($env.HOME)/{relPath}" | get relPath | first | str replace -a / )
echo $"Launching zellij for ($PRJ)"
cd $PRJ ; exec zellij attach -c $NAME
'';
};
in
''
exec nu ${script}
'';
})
# Open tmux for current project.
(pkgs.writeShellApplication {
name = "pux";