mirror of
https://github.com/kmein/niveum
synced 2026-03-27 23:01:08 +01:00
Compare commits
3 Commits
8ea79b574b
...
34687dde21
| Author | SHA1 | Date | |
|---|---|---|---|
| 34687dde21 | |||
| 4ce7c7a91a | |||
|
|
9db408226b |
@@ -292,6 +292,7 @@ in {
|
||||
./watson.nix
|
||||
./zsh.nix
|
||||
./tor.nix
|
||||
./stw-berlin.nix
|
||||
./mastodon-bot.nix
|
||||
];
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
startAt = "weekly";
|
||||
serviceConfig = {
|
||||
user = "kfm";
|
||||
WorkingDirectory = "/home/kfm/cloud/Seafile/Books/Germanistik/LB";
|
||||
WorkingDirectory = "/home/kfm/cloud/nextcloud/Books/Germanistik/LB";
|
||||
};
|
||||
script = ''
|
||||
first_year=2019
|
||||
|
||||
51
configs/stw-berlin.nix
Normal file
51
configs/stw-berlin.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
{
|
||||
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 = "kfm";
|
||||
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
|
||||
'';
|
||||
};
|
||||
}
|
||||
44
flake.lock
generated
44
flake.lock
generated
@@ -173,11 +173,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1687871164,
|
||||
"narHash": "sha256-bBFlPthuYX322xOlpJvkjUBz0C+MOBjZdDOOJJ+G2jU=",
|
||||
"lastModified": 1692099905,
|
||||
"narHash": "sha256-/pSusGhmIdSdAaywQRFA5dVbfdIzlWQTecM+E46+cJ0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "07c347bb50994691d7b0095f45ebd8838cf6bc38",
|
||||
"rev": "2a6679aa9cc3872c29ba2a57fe1b71b3e3c5649f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -327,11 +327,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1691522891,
|
||||
"narHash": "sha256-xqQqVryXKJoFQ/+RL0A7DihkLkev8dk6afM7B04TilU=",
|
||||
"lastModified": 1692414505,
|
||||
"narHash": "sha256-sSTuyR9JYSxmUcYcj0Jvw1hIq1tz/Canw9mK0hEJvnE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "78287547942dd8e8afff0ae47fb8e2553db79d7e",
|
||||
"rev": "4cdad15f34e6321a2f789b99d42815b9142ac2ba",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -375,11 +375,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1691654369,
|
||||
"narHash": "sha256-gSILTEx1jRaJjwZxRlnu3ZwMn1FVNk80qlwiCX8kmpo=",
|
||||
"lastModified": 1692490387,
|
||||
"narHash": "sha256-qU6BlSeuBeO3TsNqrLw6UksNSqyFOJ4pUGiC3WMsct0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e",
|
||||
"rev": "0b6f3e17dda02c9cf1e8edc6e411ba37093f09e2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -468,11 +468,11 @@
|
||||
},
|
||||
"nur": {
|
||||
"locked": {
|
||||
"lastModified": 1691653357,
|
||||
"narHash": "sha256-WXbL4QyOrtxkRmQLD4rmk4o1VzSPT5RoTedq/OM95JY=",
|
||||
"lastModified": 1692488764,
|
||||
"narHash": "sha256-SCtwgqxLUCHf4gT83ab/46eqcw2ocm5FZanysSF9Bg4=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NUR",
|
||||
"rev": "bbb14c7521967ffbeb0a492a1bd209e0369be648",
|
||||
"rev": "18436a20915d6cc569d7fb13807a07ae5de10661",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -507,11 +507,11 @@
|
||||
},
|
||||
"retiolum": {
|
||||
"locked": {
|
||||
"lastModified": 1690732808,
|
||||
"narHash": "sha256-+1Y4wD7+fyFEWjWck6rxKYlDf6OB2zzFaPP71/zjdEU=",
|
||||
"lastModified": 1691992809,
|
||||
"narHash": "sha256-qUTsMDSV2L5t6Oj+L60n0KQKbvOhak3+d6++h9AZJPg=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "e29c0b48310d4520a4beb9782e94949ae43ab1ae",
|
||||
"revCount": 314,
|
||||
"rev": "6216c30551876303dac5373e92690a7f05fd0f6f",
|
||||
"revCount": 315,
|
||||
"type": "git",
|
||||
"url": "https://git.thalheim.io/Mic92/retiolum"
|
||||
},
|
||||
@@ -557,11 +557,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1691634013,
|
||||
"narHash": "sha256-EYrZnyYO84mewPetfjxloLKq4WIwmsXUNWnaHhdeO/Y=",
|
||||
"lastModified": 1692410823,
|
||||
"narHash": "sha256-YM1QCenpghNqgleUmoCJUArTuMEBqScyQuhepA6JZaI=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "48f3d76f512c7267d82d84c5d3d156ad2b9a8d12",
|
||||
"rev": "598b2f04ed252eb5808b108d7a10084c0c548753",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -708,11 +708,11 @@
|
||||
"voidrice": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1690153564,
|
||||
"narHash": "sha256-WezWBUnEesneqeX7Z9zkbnVHhIIbt25mpSutezLDpVU=",
|
||||
"lastModified": 1692361205,
|
||||
"narHash": "sha256-xO5wT8Agu2PMGilpXobUwRliqNXYKl/x7OAaGRW83BI=",
|
||||
"owner": "Lukesmithxyz",
|
||||
"repo": "voidrice",
|
||||
"rev": "d8a8970715070f73bcb6333e3fe851b6802ac702",
|
||||
"rev": "f26e5678e626e604ed586fc6420b944dc023d3f2",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
||||
2
secrets
2
secrets
Submodule secrets updated: aaefa9ed14...aac75be4fd
Reference in New Issue
Block a user