summaryrefslogtreecommitdiff
path: root/accounts/gkleen@sif/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2021-12-08 15:23:37 +0100
committerGregor Kleen <gkleen@yggdrasil.li>2021-12-08 15:23:37 +0100
commita2962229c6a81ac23a685d243fa43d83957b4fc4 (patch)
treeda76b91033b595d202ef76eee81d15adc1a0f1db /accounts/gkleen@sif/default.nix
parentf7bfa8f38cba7da1fb54bcf9e778b4dafeea967e (diff)
downloadnixos-a2962229c6a81ac23a685d243fa43d83957b4fc4.tar
nixos-a2962229c6a81ac23a685d243fa43d83957b4fc4.tar.gz
nixos-a2962229c6a81ac23a685d243fa43d83957b4fc4.tar.bz2
nixos-a2962229c6a81ac23a685d243fa43d83957b4fc4.tar.xz
nixos-a2962229c6a81ac23a685d243fa43d83957b4fc4.zip
gkleen@sif: systemd-based ssh socks proxy
Diffstat (limited to 'accounts/gkleen@sif/default.nix')
-rw-r--r--accounts/gkleen@sif/default.nix26
1 files changed, 1 insertions, 25 deletions
diff --git a/accounts/gkleen@sif/default.nix b/accounts/gkleen@sif/default.nix
index 4f4897f5..70a5c9f2 100644
--- a/accounts/gkleen@sif/default.nix
+++ b/accounts/gkleen@sif/default.nix
@@ -59,30 +59,6 @@ let
59 wrapProgram $out/bin/zulip \ 59 wrapProgram $out/bin/zulip \
60 --add-flags '--force-device-scale-factor=1.6' 60 --add-flags '--force-device-scale-factor=1.6'
61 ''; 61 '';
62 sshpassSecret = pkgs.writeScriptBin "sshpass-secret" ''
63 #!${pkgs.zsh}/bin/zsh -e
64
65 typeset -a cmd
66 cmd=()
67
68 while
69 if [[ "$#" -le 0 ]]; then
70 echo "Insufficient arguments" >&2
71 exit 2
72 fi
73 arg="''${1}"
74 shift
75 do
76 [[ "''${arg}" == '--' ]] && break
77 user=''${arg%@*}
78 host=''${arg#*@}
79 exec {fdnum}< <(${pkgs.gnome.libsecret}/bin/secret-tool lookup service sshpass host "''${host}" user "''${user}")
80 cmd+=(${pkgs.sshpass}/bin/sshpass -d ''${fdnum} -P "''${user}@''${host}'s password:")
81 done
82
83 cmd+=($@)
84 exec -a ''${cmd[1]} -- $cmd
85 '';
86in { 62in {
87 imports = with flake.nixosModules.userProfiles.${userName}; [ 63 imports = with flake.nixosModules.userProfiles.${userName}; [
88 mpv yt-dlp 64 mpv yt-dlp
@@ -329,7 +305,7 @@ in {
329 keyboard = { 305 keyboard = {
330 layout = "us"; 306 layout = "us";
331 variant = "dvp"; 307 variant = "dvp";
332 options = [ "ctl:nocaps" ]; 308 options = [ "ctl:nocaps" "compose:caps" ];
333 }; 309 };
334 }; 310 };
335 311