mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
lnl: update reexec aliases
This commit is contained in:
parent
feaf3718db
commit
13f2480374
1 changed files with 16 additions and 13 deletions
|
@ -111,7 +111,7 @@
|
||||||
bind-key -r ">" swap-window -t +1
|
bind-key -r ">" swap-window -t +1
|
||||||
|
|
||||||
bind-key -n M-r run "tmux send-keys -t .+ C-l Up Enter"
|
bind-key -n M-r run "tmux send-keys -t .+ C-l Up Enter"
|
||||||
bind-key -n M-R run "tmux send-keys -t $(hostname -s | awk -F'-' '{print tolower($NF)}') C-l Up Enter"
|
bind-key -n M-t run "tmux send-keys -t _ C-l Up Enter"
|
||||||
|
|
||||||
set -g pane-active-border-style fg=black
|
set -g pane-active-border-style fg=black
|
||||||
set -g pane-border-style fg=black
|
set -g pane-border-style fg=black
|
||||||
|
@ -120,8 +120,8 @@
|
||||||
set -g status-right '#[fg=white]#(id -un)@#(hostname) #(cat /run/current-system/darwin-version)'
|
set -g status-right '#[fg=white]#(id -un)@#(hostname) #(cat /run/current-system/darwin-version)'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
programs.tmux.defaultCommand = "IN_NIX_SANDBOX=1 /usr/bin/sandbox-exec -f /etc/nix/sandbox.sb ${config.environment.loginShell}";
|
programs.tmux.defaultCommand = "IN_NIX_SANDBOX=1 /usr/bin/sandbox-exec -f /etc/nix/user-sandbox.sb ${config.environment.loginShell}";
|
||||||
environment.etc."nix/sandbox.sb".text = ''
|
environment.etc."nix/user-sandbox.sb".text = ''
|
||||||
(version 1)
|
(version 1)
|
||||||
(allow default)
|
(allow default)
|
||||||
(deny file-write* (subpath "/nix"))
|
(deny file-write* (subpath "/nix"))
|
||||||
|
@ -319,24 +319,27 @@
|
||||||
|
|
||||||
reexec() {
|
reexec() {
|
||||||
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
|
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
|
||||||
unset __ETC_ZPROFILE_SOURCED
|
unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
|
||||||
unset __ETC_ZSHENV_SOURCED
|
|
||||||
unset __ETC_ZSHRC_SOURCED
|
|
||||||
exec $SHELL -c 'echo >&2 "reexecuting shell: $SHELL" && exec $SHELL -l'
|
exec $SHELL -c 'echo >&2 "reexecuting shell: $SHELL" && exec $SHELL -l'
|
||||||
}
|
}
|
||||||
|
|
||||||
reexec-tmux() {
|
reexec-tmux() {
|
||||||
local host
|
|
||||||
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
|
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
|
||||||
unset __ETC_ZPROFILE_SOURCED
|
unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
|
||||||
unset __ETC_ZSHENV_SOURCED
|
exec tmux new-session -A -s _ "$@"
|
||||||
unset __ETC_ZSHRC_SOURCED
|
}
|
||||||
host=$(hostname -s | awk -F'-' '{print tolower($NF)}')
|
|
||||||
exec tmux new-session -A -s "$host" "$@"
|
reexec-sandbox() {
|
||||||
|
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
|
||||||
|
unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
|
||||||
|
exec IN_NIX_SANDBOX=1 /usr/bin/sandbox-exec -f /etc/nix/user-sandbox.sb exec $SHELL -l
|
||||||
}
|
}
|
||||||
|
|
||||||
no-sandbox() {
|
no-sandbox() {
|
||||||
tmux split-window -c '#{pane_current_path}' -p 25 $SHELL -l
|
tmux split-window -c '#{pane_current_path}' -p 25 $SHELL -l
|
||||||
|
if [ $# -gt 0 ]; then
|
||||||
|
tmux send-keys -t . "$*" Enter
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue