qcal: add module

This commit is contained in:
Anton Mosich 2023-08-12 22:07:04 +02:00 committed by Robert Helgesson
parent ea59b79f31
commit 8eb8c212e5
No known key found for this signature in database
GPG key ID: 36BDAA14C2797E89
11 changed files with 186 additions and 0 deletions

View file

@ -0,0 +1,5 @@
{
qcal-http = ./http-calendar.nix;
qcal-webdav = ./webdav-calendar.nix;
qcal-mixed = ./mixed.nix;
}

View file

@ -0,0 +1,9 @@
{
"Calendars": [
{
"Url": "https://example.com/events.ical"
}
],
"DefaultNumDays": 30,
"Timezone": "Local"
}

View file

@ -0,0 +1,18 @@
{ pkgs, lib, ... }:
{
programs.qcal.enable = true;
accounts.calendar.accounts.test = {
qcal.enable = true;
remote = { url = "https://example.com/events.ical"; };
};
test.stubs = { qcal = { }; };
nmt.script = ''
assertFileExists home-files/.config/qcal/config.json
assertFileContent home-files/.config/qcal/config.json ${
./http-calendar.json-expected
}
'';
}

View file

@ -0,0 +1,14 @@
{
"Calendars": [
{
"Url": "https://example.com/events.ical"
},
{
"PasswordCmd": "pass show calendar",
"Url": "https://cal.example.com/anton/work",
"Username": "anton"
}
],
"DefaultNumDays": 30,
"Timezone": "Local"
}

View file

@ -0,0 +1,28 @@
{ pkgs, lib, ... }:
{
programs.qcal.enable = true;
accounts.calendar.accounts = {
http-test = {
remote = { url = "https://example.com/events.ical"; };
qcal.enable = true;
};
webdav-test = {
remote = {
url = "https://cal.example.com/anton/work";
userName = "anton";
passwordCommand = [ "pass" "show" "calendar" ];
};
qcal.enable = true;
};
};
test.stubs = { qcal = { }; };
nmt.script = ''
assertFileExists home-files/.config/qcal/config.json
assertFileContent home-files/.config/qcal/config.json ${
./mixed.json-expected
}
'';
}

View file

@ -0,0 +1,11 @@
{
"Calendars": [
{
"PasswordCmd": "pass show calendar",
"Url": "https://cal.example.com/anton/work",
"Username": "anton"
}
],
"DefaultNumDays": 23,
"Timezone": "Europe/Berlin"
}

View file

@ -0,0 +1,26 @@
{ pkgs, lib, ... }:
{
programs.qcal = {
enable = true;
defaultNumDays = 23;
timezone = "Europe/Berlin";
};
accounts.calendar.accounts.test = {
qcal.enable = true;
remote = {
url = "https://cal.example.com/anton/work";
userName = "anton";
passwordCommand = [ "pass" "show" "calendar" ];
};
};
test.stubs = { qcal = { }; };
nmt.script = ''
assertFileExists home-files/.config/qcal/config.json
assertFileContent home-files/.config/qcal/config.json ${
./webdav-calendar.json-expected
}
'';
}