mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 23:11: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
17
flake.lock
generated
17
flake.lock
generated
|
|
@ -268,6 +268,22 @@
|
||||||
"type": "github"
|
"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": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"betterfox": "betterfox",
|
"betterfox": "betterfox",
|
||||||
|
|
@ -281,6 +297,7 @@
|
||||||
"nixos-hardware": "nixos-hardware",
|
"nixos-hardware": "nixos-hardware",
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs",
|
||||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||||
|
"radicale-birthday-calendar": "radicale-birthday-calendar",
|
||||||
"sops": "sops",
|
"sops": "sops",
|
||||||
"treefmt": "treefmt",
|
"treefmt": "treefmt",
|
||||||
"vscode-extensions": "vscode-extensions"
|
"vscode-extensions": "vscode-extensions"
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,11 @@
|
||||||
url = "https://github.com/nextcloud-releases/twofactor_totp/releases/download/v6.4.1/twofactor_totp-v6.4.1.tar.gz";
|
url = "https://github.com/nextcloud-releases/twofactor_totp/releases/download/v6.4.1/twofactor_totp-v6.4.1.tar.gz";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
radicale-birthday-calendar = {
|
||||||
|
url = "github:iBigQ/radicale-birthday-calendar";
|
||||||
|
flake = false;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
|
inputs,
|
||||||
pkgs,
|
pkgs,
|
||||||
lib,
|
lib,
|
||||||
...
|
...
|
||||||
|
|
@ -43,9 +44,12 @@ in
|
||||||
htpasswd_filename = config.sops.templates."radicale/htpasswd".path;
|
htpasswd_filename = config.sops.templates."radicale/htpasswd".path;
|
||||||
htpasswd_encryption = "plain";
|
htpasswd_encryption = "plain";
|
||||||
};
|
};
|
||||||
|
storage.filesystem_folder = "/var/lib/radicale/collections";
|
||||||
|
|
||||||
storage.hook =
|
storage.hook =
|
||||||
let
|
let
|
||||||
|
createBirthdayCalendar = "${inputs.radicale-birthday-calendar}/create_birthday_calendar.py";
|
||||||
|
|
||||||
hookScript = pkgs.writeShellApplication {
|
hookScript = pkgs.writeShellApplication {
|
||||||
name = "radicale-git-hook";
|
name = "radicale-git-hook";
|
||||||
runtimeInputs = [
|
runtimeInputs = [
|
||||||
|
|
@ -61,6 +65,8 @@ in
|
||||||
text = ''
|
text = ''
|
||||||
readonly username="$1"
|
readonly username="$1"
|
||||||
|
|
||||||
|
git status --porcelain | awk '{print $2}' | python3 ${createBirthdayCalendar}
|
||||||
|
|
||||||
git add -A
|
git add -A
|
||||||
if ! git diff --cached --quiet; then
|
if ! git diff --cached --quiet; then
|
||||||
git commit --message "Changes by $username"
|
git commit --message "Changes by $username"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue