clone yazi

This commit is contained in:
Lennart J. Kurzweg (Nx2)
2026-01-27 16:45:54 +01:00
parent 627604d3f7
commit 66ef93c612
2 changed files with 16 additions and 4 deletions

View File

@@ -96,7 +96,9 @@
interactiveShellInit = /* fish */ ''
set -g fish_greeting
if not set -q IN_NIX_SHELL
if set -q SESSION_FROM_DE
if set -q SESSION_FROM_DE; or set -q SESSION_CLONED_FROM_YAZI
set -e SESSION_FROM_DE
set -e SESSION_CLONED_FROM_YAZI
set tmp (mktemp -t "yazi-cwd.XXXXX")
yazi --cwd-file="$tmp" ~
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
@@ -105,7 +107,6 @@
rm -f -- "$tmp"
end
nxfetch
set -e SESSION_FROM_DE
end
'';
functions = {
@@ -115,10 +116,21 @@
'';
nx_backup = let
destination = if hyper.host == "NxNORTH" then "${hyper.home}/shared/" else "${hyper.home}/backups/";
in pkgs.lib.mkIf (hyper.isPersonal) ''
in pkgs.lib.mkIf (hyper.isPersonal) /* fish */ ''
set RPATH (curl -s https://${hyper.domain}/latest-backup)
rsync -avz --info=progress2 -e "ssh -p ${builtins.toString secrets.ssh.port}" ${hyper.user}@ssh.${hyper.domain}:"$RPATH" ${destination}
'';
nx_yazi_into_fish = /* fish */ ''
set tmp (mktemp -t "yazi-cwd.XXXXX")
echo "$PWD" > "$tmp"
yazi --cwd-file="$tmp"
if set cwd (cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
rm -f "$tmp"
set -g SESSION_CLONED_FROM_YAZI TRUE
'';
# gpg = '';
# set bold \e[1m
# set green \e[32m