From 337a71a169560da3fd6d3a243031e3bf2c17116b Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Thu, 5 Sep 2024 17:06:40 +0200 Subject: [PATCH] feat(scripts): add Android profile building via Nix Signed-off-by: Ryan Lahfa --- scripts/android-profile-template.xml | 62 ++++++++++++++++++++++++++++ scripts/build-android-profile.nix | 19 +++++++++ 2 files changed, 81 insertions(+) create mode 100644 scripts/android-profile-template.xml create mode 100644 scripts/build-android-profile.nix diff --git a/scripts/android-profile-template.xml b/scripts/android-profile-template.xml new file mode 100644 index 0000000..38ff863 --- /dev/null +++ b/scripts/android-profile-template.xml @@ -0,0 +1,62 @@ + + + DGNumRadius + + + @SSID@ + + + ESS + auto + + + + WPA2 + AES + true + + + + + + 25 + 0 + + + + 25 + + + false + + + true + 0 + radius.dgnum.eu + + 26 + + false + + + @USERNAME@ + @PASSWORD@ + + + false + false + + + + + + + + + + diff --git a/scripts/build-android-profile.nix b/scripts/build-android-profile.nix new file mode 100644 index 0000000..8fdac9d --- /dev/null +++ b/scripts/build-android-profile.nix @@ -0,0 +1,19 @@ +{ + pkgs ? import { }, + username, + domain ? "sso.dgnum.eu", + ssid ? "DGNum 5G prototype (AX)", + password, +}: +pkgs.runCommand "connection-${username}-android-profile.xml" + { + SSID = ssid; + USERNAME = "${username}@${domain}"; + PASSWORD = password; + } + '' + substitute ${./android-profile-template.xml} $out \ + --subst-var SSID \ + --subst-var USERNAME \ + --subst-var PASSWORD + ''