Commit 3a65aa249616
Changed files (3)
assets/redhat-vpn.desktop
@@ -0,0 +1,7 @@
+[Desktop Entry]
+Name=Red Hat VPN
+Exec=gnome-terminal -- redhat-vpn
+Type=Application
+Terminal=true
+Categories=System;
+Icon=seahorse;
\ No newline at end of file
machines/naruhodo.nix
@@ -24,6 +24,7 @@
daemonService = true;
capture = true;
};
+ home.file.".local/share/applications/redhat-vpn.desktop".source = ../assets/redhat-vpn.desktop;
# FIXME(vdemeester) move this to the bootstrap shell
# xdg.configFile."user-dirs.dirs".source = ../modules/profiles/assets/xorg/user-dirs.dirs;
}
pkgs/scripts/bin/redhat-vpn
@@ -0,0 +1,17 @@
+#!/usr/bin/env bash
+# Connect to RedHat VPN
+# This will ask for which VPN to connect (using available tools) and
+# do some magic
+set -e
+export BEMENU_BACKEND=curses
+connection=$(nmcli connection show | grep vpn | nix run nixpkgs.bemenu -c bemenu | awk '{print $3}')
+key=$(authkey)
+
+passfile=$(mktemp)
+
+echo -n "vpn.secrets.password:" > $passfile
+gpg --decrypt $HOME/desktop/documents/Red\ Hat/naruhodo.pass.gpg 2>/dev/null >>$passfile
+echo -n "${key}" >> $passfile
+
+nmcli connection up ${connection} passwd-file $passfile
+rm $passfile