add openconnect vpn

This commit is contained in:
Daniel Langbein 2024-08-23 12:37:30 +02:00
parent 941308e86b
commit 2745d9dc03
Signed by: langfingaz
GPG Key ID: 6C47C753F0823002
3 changed files with 45 additions and 0 deletions

View File

@ -53,6 +53,7 @@
../../modules/ghostwriter.nix ../../modules/ghostwriter.nix
../../modules/print-and-scan.nix ../../modules/print-and-scan.nix
#../../modules/waydroid.nix #../../modules/waydroid.nix
../../modules/uni-vpn.nix
../../modules/games.nix ../../modules/games.nix
../../modules/dosbox-x.nix ../../modules/dosbox-x.nix

27
modules/t-telesec.nix Normal file
View File

@ -0,0 +1,27 @@
{ config, pkgs, ... }:
let
# Define an awk script, that cuts one certificate out of the ca-bundle.crt file.
# https://gist.github.com/erictapen/841190c8b7d63b775df21123d55eddcb
cert = pkgs.stdenv.mkDerivation rec{
name = "telesec-globalroot-class-2.pem";
src = builtins.toFile "${name}-awk-helper" ''
{
if(a > 0) {
print
}
}
/-----END CERTIFICATE-----/ {
a = 0
}
/T-TeleSec GlobalRoot Class 2/ {
a = 1
}
'';
nativeBuildInputs = with pkgs; [ cacert gawk ];
phases = "installPhase";
installPhase = "${pkgs.gawk}/bin/awk -f $src ${pkgs.cacert}/etc/ssl/certs/ca-bundle.crt > $out";
};
in
{
environment.etc."t-telesec.pem".source = cert;
}

17
modules/uni-vpn.nix Normal file
View File

@ -0,0 +1,17 @@
{ config, pkgs, ... }:
{
assertions = [{
assertion = config.services.xserver.desktopManager.gnome.enable;
message = "Only tested with GNOME";
}];
imports = [
./t-telesec.nix
];
users.users.yoda = {
packages = with pkgs; [
gnome.networkmanager-openconnect # Openconnect VPN
];
};
}