Add openconnect-epfl script

This commit is contained in:
Natsu Kagami 2022-09-11 15:34:20 +02:00
parent 049942e916
commit c96b561ea9
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
2 changed files with 21 additions and 0 deletions

View file

@ -7,6 +7,7 @@
./modules/programs/my-broot.nix ./modules/programs/my-broot.nix
./modules/programs/my-sway ./modules/programs/my-sway
./modules/programs/my-kitty ./modules/programs/my-kitty
./modules/programs/openconnect-epfl.nix
./common-linux.nix ./common-linux.nix
]; ];

View file

@ -0,0 +1,20 @@
{ pkgs, lib, config, ... }:
let
openconnect-epfl = pkgs.writeShellApplication {
name = "openconnect-epfl";
runtimeInputs = with pkgs; [ openconnect rbw ];
text = ''
GASPAR_PASSWORD=$(rbw get gaspar)
GASPAR_TOKEN=$(rbw code gaspar)
printf "%s\n%s" "$GASPAR_PASSWORD" "$GASPAR_TOKEN" | /usr/bin/sudo openconnect \
--passwd-on-stdin \
-u pham \
"https://vpn.epfl.ch"
'';
};
in
{
home.packages = [ openconnect-epfl ];
}