From af73b473e8a7977b2d29fcf19480546d9b4d36be Mon Sep 17 00:00:00 2001 From: Rachel Lambda Samuelsson Date: Tue, 25 Jul 2023 13:43:38 +0200 Subject: [PATCH] initial commit --- eduroam.nix | 22 ++++++++++++++++++++++ readme.md | 7 +++++++ 2 files changed, 29 insertions(+) create mode 100644 eduroam.nix create mode 100644 readme.md diff --git a/eduroam.nix b/eduroam.nix new file mode 100644 index 0000000..5ef587b --- /dev/null +++ b/eduroam.nix @@ -0,0 +1,22 @@ +{ pkgs ? import {}, ... }: +let eduroam = pkgs.fetchurl { + name = "eduroam"; + url = "https://cat.eduroam.org/user/API.php?action=downloadInstaller&lang=en&profile=973&device=linux&generatedfor=user&openroaming=0"; + hash = "sha256-/NptbjDU1SZUHQM2TvuOgd62S4tZYsTFHuHc0XxaF4s="; + recursiveHash = true; + downloadToTemp = true; + postFetch = '' + mkdir -p "$out/bin" + install -m 755 "$downloadedFile" "$out/bin/eduroam.py" + ''; + }; +in pkgs.mkShell { + packages = [ + eduroam + (pkgs.python3.withPackages (ps: with ps; [ dbus-python pyopenssl ])) + ]; + + shellHook = '' + exec python3 ${eduroam}/bin/eduroam.py + ''; +} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d19170a --- /dev/null +++ b/readme.md @@ -0,0 +1,7 @@ +# chalmers eduroam nix + +This is a nix-shell which automatically fetches the chalmers eduroam configuration tool, the needed python packages, and runs the scipt. + +You should already have network manager enabled in your global config. + +If you want it to work with another institution then find the correct download link from [cat.eduoroam.org](https://cat.eduroam.org/) and adjust the url and hash in `eduroam.nix` accordingly.