summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-05-15 15:27:19 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2021-05-15 15:27:19 +0200
commit1514c30e46768eb978996660ad46ca8e48cef5b7 (patch)
treec27da4992f00b4c7372020c367e8560d2355cfc7 /accounts/gkleen@sif
parent9dddbe15c421b9f62cddee6f8cc4147f9d40cd86 (diff)
downloadnixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar.gz
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar.bz2
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.tar.xz
nixos-1514c30e46768eb978996660ad46ca8e48cef5b7.zip
...
Diffstat (limited to 'accounts/gkleen@sif')
-rw-r--r--accounts/gkleen@sif/default.nix2
-rw-r--r--accounts/gkleen@sif/emacs.el25
-rw-r--r--accounts/gkleen@sif/ssh-hosts.nix16
-rw-r--r--accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs5
-rw-r--r--accounts/gkleen@sif/xmonad/xmonad.hs14
5 files changed, 53 insertions, 9 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 5ee7845d..676c12a3 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -242,8 +242,6 @@ in {
242 extraProfileCommands = '' 242 extraProfileCommands = ''
243 export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:''${XDG_DATA_DIRS}}" 243 export XDG_DATA_DIRS="${pkgs.gsettings-desktop-schemas}/share/gsettings-schemas/${pkgs.gsettings-desktop-schemas.name}:${pkgs.gtk3}/share/gsettings-schemas/${pkgs.gtk3.name}''${XDG_DATA_DIRS:+:''${XDG_DATA_DIRS}}"
244 ''; 244 '';
245
246 stateVersion = "20.03";
247 }; 245 };
248 246
249 fonts.fontconfig.enable = true; 247 fonts.fontconfig.enable = true;
diff --git a/accounts/gkleen@sif/emacs.el b/accounts/gkleen@sif/emacs.el
index c8356bf2..b22c00f5 100644
--- a/accounts/gkleen@sif/emacs.el
+++ b/accounts/gkleen@sif/emacs.el
@@ -68,7 +68,7 @@
68 68
69(setq undo-tree-auto-save-history t) 69(setq undo-tree-auto-save-history t)
70 70
71(defvar expand-file-name-custom-tilde-alist '()) 71(defvar expand-file-name-custom-tilde-alist '(("u2w-dev1" . "/ssh:uni2work-dev1:/home/gkleen/projects/uni2work")))
72(defun my/add-to-tilde-alist (hash) 72(defun my/add-to-tilde-alist (hash)
73 (let* ((tilde:dir (split-string hash "=")) 73 (let* ((tilde:dir (split-string hash "="))
74 (tilde (car tilde:dir)) 74 (tilde (car tilde:dir))
@@ -128,6 +128,29 @@
128(setq ido-everywhere t) 128(setq ido-everywhere t)
129(ido-mode 1) 129(ido-mode 1)
130 130
131(setq tramp-default-method "ssh")
132(customize-set-variable 'tramp-use-ssh-controlmaster-options nil)
133
134(setq direnv-enabled-hosts '("uni2work-dev1"))
135
136(defun tramp-sh-handle-start-file-process@my-direnv (args)
137 "Enable Direnv for hosts in `direnv-enabled-hosts'."
138 (with-parsed-tramp-file-name (expand-file-name default-directory) nil
139 (if (member host direnv-enabled-hosts)
140 (pcase-let ((`(,name ,buffer ,program . ,args) args))
141 `(,name
142 ,buffer
143 "direnv"
144 "exec"
145 ,localname
146 ,program
147 ,@args))
148 args)))
149
150(with-eval-after-load "tramp-sh"
151 (advice-add 'tramp-sh-handle-start-file-process
152 :filter-args #'tramp-sh-handle-start-file-process@my-direnv))
153
131(setq mail-host-address "sif.midgard.yggdrasil") 154(setq mail-host-address "sif.midgard.yggdrasil")
132(setq user-full-name "Gregor Kleen") 155(setq user-full-name "Gregor Kleen")
133 156
diff --git a/accounts/gkleen@sif/ssh-hosts.nix b/accounts/gkleen@sif/ssh-hosts.nix
index 0db4e342..d47410f4 100644
--- a/accounts/gkleen@sif/ssh-hosts.nix
+++ b/accounts/gkleen@sif/ssh-hosts.nix
@@ -91,6 +91,11 @@
91 user = "root"; 91 user = "root";
92 identityFile = "~/.ssh/uni2work"; 92 identityFile = "~/.ssh/uni2work";
93 }; 93 };
94 "jump.uniworx4" =
95 { hostname = "uniworx4.ifi.lmu.de";
96 user = "sshjump";
97 identityFile = "~/.ssh/sshjump.uni2work";
98 };
94 "uni2workgw" = 99 "uni2workgw" =
95 { hostname = "uni2workgw.ifi.lmu.de"; 100 { hostname = "uni2workgw.ifi.lmu.de";
96 user = "root"; 101 user = "root";
@@ -206,4 +211,15 @@
206 user = "git"; 211 user = "git";
207 identityFile = "~/.ssh/gkleen@gitlab.lrz.de"; 212 identityFile = "~/.ssh/gkleen@gitlab.lrz.de";
208 }; 213 };
214 "uni2work-dev1" =
215 { hostname = "uni2work-dev1.ifi.lmu.de";
216 user = "gkleen";
217 identityFile = "~/.ssh/uni2work";
218 proxyJump = "jump.uniworx4";
219 localForwards = [
220 { bind = { address = "localhost"; port = 3940; };
221 host = { address = "localhost"; port = 3940; };
222 }
223 ];
224 };
209} 225}
diff --git a/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs b/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs
index c85d0f92..729941aa 100644
--- a/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs
+++ b/accounts/gkleen@sif/xmonad/lib/XMonad/Prompt/MySsh.hs
@@ -80,9 +80,12 @@ moshCmd' p c = concat
80 , " -- " 80 , " -- "
81 , cCommand c 81 , cCommand c
82 ] 82 ]
83inTmux c 83inTmux Nothing c
84 | null $ cCommand c = c { cCommand = "tmux new-session" } 84 | null $ cCommand c = c { cCommand = "tmux new-session" }
85 | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" } 85 | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" }
86inTmux (Just h) c
87 | null $ cCommand c = c { cCommand = "tmux new-session -As " <> h }
88 | otherwise = c { cCommand = "tmux new-session \"" ++ (cCommand c) ++ "\"" }
86withEnv :: [(String, String)] -> Conn -> Conn 89withEnv :: [(String, String)] -> Conn -> Conn
87withEnv envs c = c { cCommand = "env" ++ (concat $ map (\(n, v) -> ' ' : (n ++ "=" ++ v)) envs) ++ " " ++ (cCommand c) } 90withEnv envs c = c { cCommand = "env" ++ (concat $ map (\(n, v) -> ' ' : (n ++ "=" ++ v)) envs) ++ " " ++ (cCommand c) }
88 91
diff --git a/accounts/gkleen@sif/xmonad/xmonad.hs b/accounts/gkleen@sif/xmonad/xmonad.hs
index 8282ed3f..3bf930c0 100644
--- a/accounts/gkleen@sif/xmonad/xmonad.hs
+++ b/accounts/gkleen@sif/xmonad/xmonad.hs
@@ -680,7 +680,7 @@ xPConfig = def
680 , position = Top 680 , position = Top
681 } 681 }
682 682
683sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux } ) 683sshOverrides host = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux host} )
684 [ 684 [
685 "odin", "odin.asgard.yggdrasil" 685 "odin", "odin.asgard.yggdrasil"
686 , "ymir", "ymir.yggdrasil.li", "ymir.niflheim.yggdrasil" 686 , "ymir", "ymir.yggdrasil.li", "ymir.niflheim.yggdrasil"
@@ -691,13 +691,17 @@ sshOverrides = map (\h -> mkOverride { oHost = h, oCommand = moshCmd . inTmux }
691 , "testworx" 691 , "testworx"
692 ] 692 ]
693 ++ 693 ++
694 map (\h -> mkOverride { oHost = h, oCommand = moshCmd' "/run/current-system/sw/bin/mosh-server" . withEnv [("TERM", "xterm")] . inTmux} ) 694 map (\h -> mkOverride { oHost = h, oCommand = moshCmd' "/run/current-system/sw/bin/mosh-server" . withEnv [("TERM", "xterm")] . inTmux host} )
695 [ "bragi", "bragi.asgard.yggdrasil" 695 [ "bragi", "bragi.asgard.yggdrasil"
696 ] 696 ]
697 ++ 697 ++
698 map (\h -> mkOverride { oHost = h, oCommand = sshCmd . withEnv [("TERM", "xterm")] . inTmux } ) 698 map (\h -> mkOverride { oHost = h, oCommand = sshCmd . inTmux host } )
699 [ "uni2work-dev1"
700 ]
701 ++
702 map (\h -> mkOverride { oHost = h, oCommand = sshCmd . withEnv [("TERM", "xterm")] . inTmux host } )
699 [ "remote.cip.ifi.lmu.de" 703 [ "remote.cip.ifi.lmu.de"
700 , "uniworx3", "uniworx4", "uniworxdb" 704 , "uniworx3", "uniworx4", "uniworx5", "uniworxdb2"
701 ] 705 ]
702 706
703backlight :: (Rational -> Rational) -> X () 707backlight :: (Rational -> Rational) -> X ()
@@ -769,7 +773,7 @@ myKeys' conf host = Map.fromList $
769 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"") 773 --, ((modm, xK_d ), spawn "exe=`dmenu_path | dmenu` && eval \"exec $exe\"")
770 , ((modm, xK_d ), shellPrompt "Run: " xPConfig) 774 , ((modm, xK_d ), shellPrompt "Run: " xPConfig)
771 , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("urxvtc" ++ " -e") xPConfig) 775 , ((modm .|. shiftMask, xK_d ), prompt "Run in Terminal: " ("urxvtc" ++ " -e") xPConfig)
772 , ((modm, xK_at ), sshPrompt sshOverrides xPConfig) 776 , ((modm, xK_at ), sshPrompt (sshOverrides . Just $ hName host) xPConfig)
773 777
774 -- close focused window 778 -- close focused window
775 , ((modm .|. shiftMask, xK_q ), kill) 779 , ((modm .|. shiftMask, xK_q ), kill)