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

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