diff --git a/home/terminal.nix b/home/terminal.nix index 3aa47e3..94bac37 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -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";