summaryrefslogtreecommitdiff
path: root/modules/examples/lnl.nix
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-03-20 20:51:35 +0100
committerDaiderd Jordan <daiderd@gmail.com>2019-03-20 20:51:35 +0100
commit13f2480374343369f7ad8e0147c5d182047e2484 (patch)
treefc9262ef634a79d5ee038be8f775e7dd5779e359 /modules/examples/lnl.nix
parentfeaf3718dbe2ab2558f56b900e0b808e60a60814 (diff)
lnl: update reexec aliases
Diffstat (limited to 'modules/examples/lnl.nix')
-rw-r--r--modules/examples/lnl.nix29
1 files changed, 16 insertions, 13 deletions
diff --git a/modules/examples/lnl.nix b/modules/examples/lnl.nix
index cafb675..57445f5 100644
--- a/modules/examples/lnl.nix
+++ b/modules/examples/lnl.nix
@@ -111,7 +111,7 @@
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 $(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-border-style fg=black
@@ -120,8 +120,8 @@
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}";
- environment.etc."nix/sandbox.sb".text = ''
+ programs.tmux.defaultCommand = "IN_NIX_SANDBOX=1 /usr/bin/sandbox-exec -f /etc/nix/user-sandbox.sb ${config.environment.loginShell}";
+ environment.etc."nix/user-sandbox.sb".text = ''
(version 1)
(allow default)
(deny file-write* (subpath "/nix"))
@@ -319,24 +319,27 @@
reexec() {
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
- unset __ETC_ZPROFILE_SOURCED
- unset __ETC_ZSHENV_SOURCED
- unset __ETC_ZSHRC_SOURCED
+ unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
exec $SHELL -c 'echo >&2 "reexecuting shell: $SHELL" && exec $SHELL -l'
}
reexec-tmux() {
- local host
unset __NIX_DARWIN_SET_ENVIRONMENT_DONE
- unset __ETC_ZPROFILE_SOURCED
- unset __ETC_ZSHENV_SOURCED
- unset __ETC_ZSHRC_SOURCED
- host=$(hostname -s | awk -F'-' '{print tolower($NF)}')
- exec tmux new-session -A -s "$host" "$@"
+ unset __ETC_ZPROFILE_SOURCED __ETC_ZSHENV_SOURCED __ETC_ZSHRC_SOURCED
+ exec tmux new-session -A -s _ "$@"
+ }
+
+ 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() {
- 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
}
'';