Mac improvmenets

This commit is contained in:
2025-11-06 10:57:13 +01:00
parent a389ad81a5
commit b0e4919f1a
3 changed files with 26 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
{pkgs, ...}: {
{pkgs, lib, ...}: {
imports = [
./nix/nix.nix
];
@@ -40,4 +40,22 @@
StandardErrorPath = "/tmp/caffeinate.err";
};
};
launchd.user.agents.ssh-tunnel = let
ssh-tunnel = pkgs.writeShellScriptBin "ssh-tunnel" ''
while true; do
dns-sd -m -Q fuhen.local
ssh -NR "2222:localhost:22" zoriya@fuhen.local
sleep 5
done
'';
in {
command = lib.getExe ssh-tunnel;
serviceConfig = {
KeepAlive = true;
RunAtLoad = true;
StandardOutPath = "/tmp/ssh-tunnel.log";
StandardErrorPath = "/tmp/ssh-tunnel.err";
};
};
}

View File

@@ -56,8 +56,9 @@
# suspend inner tmux (to allow nested sessions)
bind @ { set prefix None; set key-table off }
# NOTE: C-@ doesn't work since v3.5a
bind -T off C-@ { set -u prefix; set -u key-table }
# NOTE: C-@ doesn't work since v3.5a (since tmux doesn't support kitty keyboard protocol)
# Instead, C-@ and C-Space does the same thing.
bind -T off C-Space { set -u prefix; set -u key-table }
'';
};
}

View File

@@ -89,7 +89,10 @@
dr = "direnv reload";
nixos-option = "nixos-option --flake ~/projects/flake";
# i will never remember those flags
ss = "ss -tlpun";
ss =
if pkgs.stdenv.isLinux
then "ss -tlpun"
else "netstat -anvp tcp | awk 'NR<3 || /LISTEN/'";
# habits
copyfile = "clipcopy";