mirror of
https://github.com/srid/nixos-config.git
synced 2026-01-11 02:32:37 +08:00
add zux: pux for zellij
This commit is contained in:
parent
5360052a29
commit
7e56577b71
1 changed files with 24 additions and 1 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue