From 7d8feb0876aed26d0d51d3ce941e67b968afd299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Tue, 9 Dec 2025 12:54:35 +0100 Subject: [PATCH] stw-berlin: disable --- configs/default.nix | 1 - configs/stw-berlin.nix | 52 ------------------------------------------ 2 files changed, 53 deletions(-) delete mode 100644 configs/stw-berlin.nix diff --git a/configs/default.nix b/configs/default.nix index e90e255..c3e0366 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -256,7 +256,6 @@ in ''; } ./tor.nix - ./stw-berlin.nix ./mastodon-bot.nix { fileSystems."${remoteDir}/fritz" = { diff --git a/configs/stw-berlin.nix b/configs/stw-berlin.nix deleted file mode 100644 index 7a1d33e..0000000 --- a/configs/stw-berlin.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ - pkgs, - config, - ... -}: { - age.secrets.stw-berlin-card-code.file = ../secrets/stw-berlin-card-code.age; - - systemd.services.stw-berlin = { - enable = true; - wants = ["network-online.target"]; - startAt = "weekly"; - serviceConfig = { - User = config.users.users.me.name; - Group = config.users.users.me.group; - WorkingDirectory = "/home/kfm/cloud/nextcloud/Uni/Meta/Mensa"; - LoadCredential = [ - "password:${config.age.secrets.stw-berlin-card-code.path}" - ]; - }; - script = '' - KARTEN_ID=8071859 - PASSWORT=$(cat "$CREDENTIALS_DIRECTORY"/password) - - endpoint=https://ks.stw.berlin:4433/TL1/TLM/KASVC - authorization_header='Authorization: Basic S0FTVkM6ekt2NXlFMUxaVW12VzI5SQ==' - - get_auth_token() { - ${pkgs.curl}/bin/curl -sSL "$endpoint/LOGIN?karteNr=$KARTEN_ID&format=JSON&datenformat=JSON" \ - -X POST \ - -H "$authorization_header" \ - --data-raw '{"BenutzerID":"'$KARTEN_ID'","Passwort":"'$PASSWORT'"}' \ - | ${pkgs.jq}/bin/jq -r '.[0].authToken|@uri' - } - - - get_transactions() { - ${pkgs.curl}/bin/curl -sSL "$endpoint/TRANS?format=JSON&authToken=$(get_auth_token)&karteNr=$KARTEN_ID&datumVon=12.02.2018&datumBis=$(date -d tomorrow +%d.%m.%Y)" \ - -H "$authorization_header" \ - | ${pkgs.jq}/bin/jq - } - - get_items() { - ${pkgs.curl}/bin/curl -sSL "$endpoint/TRANSPOS?format=JSON&authToken=$(get_auth_token)&karteNr=$KARTEN_ID&datumVon=12.02.2018&datumBis=$(date -d tomorrow +%d.%m.%Y)" \ - -H "$authorization_header" \ - | ${pkgs.jq}/bin/jq - } - - get_transactions > transactions-$(date -I).json - get_items > items-$(date -I).json - ''; - }; -}