diff --git a/home/target/bagel/default.nix b/home/target/bagel/default.nix index a93d71dd..e4ac1668 100644 --- a/home/target/bagel/default.nix +++ b/home/target/bagel/default.nix @@ -1,4 +1,4 @@ -{ lib, build, ... }: +{ lib, build, pkgs, ... }: let userConfig = build.config.provision.user; @@ -34,7 +34,7 @@ in home.homeDirectory = userConfig."${hostname}".homeDirectory; home.username = userConfig."${hostname}".username; programs.alacritty.settings.font.size = 18.0; - programs.fish = import programs/fish; + programs.fish = import programs/fish pkgs; programs.git = import programs/git lib; programs.kitty.extraConfig = "font_size 18"; } diff --git a/home/target/bagel/programs/fish/default.nix b/home/target/bagel/programs/fish/default.nix index a5bba268..4b19f636 100644 --- a/home/target/bagel/programs/fish/default.nix +++ b/home/target/bagel/programs/fish/default.nix @@ -1,4 +1,19 @@ -{ +pkgs: + +let sft-tmux-script = pkgs.writeText "sft-tmux.scpt" '' + set userName to system attribute "USER" + tell application "iTerm" + activate + set newWindow to (create window with default profile) + delay 0.2 + tell current session of newWindow + write text "sft ssh " & userName & ¬ + " --command \"tmux -CC new -A -s tmssh\"" + end tell + end tell + ''; + +in { functions = { sft-tunnel = { description = "Tunnel using ScaleFT"; @@ -11,5 +26,6 @@ shellAliases = { tunnel-grafana = ''sft-tunnel 4000''; tunnel-nike = ''sft-tunnel 8428''; + tmux-cc = ''osascript ${sft-tmux-script}''; }; }