radicale: Add birthday calendar generating hook

This commit is contained in:
SebastianStork 2025-09-02 21:33:25 +02:00
parent 885b6a035c
commit 5095577e3b
3 changed files with 28 additions and 0 deletions

17
flake.lock generated
View file

@ -268,6 +268,22 @@
"type": "github"
}
},
"radicale-birthday-calendar": {
"flake": false,
"locked": {
"lastModified": 1738694693,
"narHash": "sha256-X/tahL01rGyc6eg1UqXhINi0mbuhwdzi4cYN8B0K+5c=",
"owner": "iBigQ",
"repo": "radicale-birthday-calendar",
"rev": "535ae54ef6464b1aba825af794ecc4c4dbf3d3c3",
"type": "github"
},
"original": {
"owner": "iBigQ",
"repo": "radicale-birthday-calendar",
"type": "github"
}
},
"root": {
"inputs": {
"betterfox": "betterfox",
@ -281,6 +297,7 @@
"nixos-hardware": "nixos-hardware",
"nixpkgs": "nixpkgs",
"nixpkgs-unstable": "nixpkgs-unstable",
"radicale-birthday-calendar": "radicale-birthday-calendar",
"sops": "sops",
"treefmt": "treefmt",
"vscode-extensions": "vscode-extensions"

View file

@ -57,6 +57,11 @@
url = "https://github.com/nextcloud-releases/twofactor_totp/releases/download/v6.4.1/twofactor_totp-v6.4.1.tar.gz";
flake = false;
};
radicale-birthday-calendar = {
url = "github:iBigQ/radicale-birthday-calendar";
flake = false;
};
};
outputs =

View file

@ -1,5 +1,6 @@
{
config,
inputs,
pkgs,
lib,
...
@ -43,9 +44,12 @@ in
htpasswd_filename = config.sops.templates."radicale/htpasswd".path;
htpasswd_encryption = "plain";
};
storage.filesystem_folder = "/var/lib/radicale/collections";
storage.hook =
let
createBirthdayCalendar = "${inputs.radicale-birthday-calendar}/create_birthday_calendar.py";
hookScript = pkgs.writeShellApplication {
name = "radicale-git-hook";
runtimeInputs = [
@ -61,6 +65,8 @@ in
text = ''
readonly username="$1"
git status --porcelain | awk '{print $2}' | python3 ${createBirthdayCalendar}
git add -A
if ! git diff --cached --quiet; then
git commit --message "Changes by $username"