nix-home/home/modules/programs/openconnect-epfl.nix

22 lines
519 B
Nix
Raw Normal View History

2022-09-11 13:34:20 +00:00
{ 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\n" "$GASPAR_PASSWORD" "$GASPAR_TOKEN" | sudo openconnect \
2022-09-11 13:34:20 +00:00
--passwd-on-stdin \
-u pham \
--useragent='AnyConnect' \
2022-09-11 13:34:20 +00:00
"https://vpn.epfl.ch"
'';
};
in
{
home.packages = [ openconnect-epfl ];
}