Add openconnect-epfl script
This commit is contained in:
parent
049942e916
commit
c96b561ea9
|
@ -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
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
20
home/modules/programs/openconnect-epfl.nix
Normal file
20
home/modules/programs/openconnect-epfl.nix
Normal 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 ];
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue