mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
radicale: Add birthday calendar generating hook
This commit is contained in:
parent
885b6a035c
commit
5095577e3b
3 changed files with 28 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue