qcal: add module
This commit is contained in:
parent
ea59b79f31
commit
8eb8c212e5
11 changed files with 186 additions and 0 deletions
5
tests/modules/programs/qcal/default.nix
Normal file
5
tests/modules/programs/qcal/default.nix
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
qcal-http = ./http-calendar.nix;
|
||||
qcal-webdav = ./webdav-calendar.nix;
|
||||
qcal-mixed = ./mixed.nix;
|
||||
}
|
||||
9
tests/modules/programs/qcal/http-calendar.json-expected
Normal file
9
tests/modules/programs/qcal/http-calendar.json-expected
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
{
|
||||
"Calendars": [
|
||||
{
|
||||
"Url": "https://example.com/events.ical"
|
||||
}
|
||||
],
|
||||
"DefaultNumDays": 30,
|
||||
"Timezone": "Local"
|
||||
}
|
||||
18
tests/modules/programs/qcal/http-calendar.nix
Normal file
18
tests/modules/programs/qcal/http-calendar.nix
Normal 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
|
||||
}
|
||||
'';
|
||||
}
|
||||
14
tests/modules/programs/qcal/mixed.json-expected
Normal file
14
tests/modules/programs/qcal/mixed.json-expected
Normal 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"
|
||||
}
|
||||
28
tests/modules/programs/qcal/mixed.nix
Normal file
28
tests/modules/programs/qcal/mixed.nix
Normal 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
|
||||
}
|
||||
'';
|
||||
}
|
||||
11
tests/modules/programs/qcal/webdav-calendar.json-expected
Normal file
11
tests/modules/programs/qcal/webdav-calendar.json-expected
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"Calendars": [
|
||||
{
|
||||
"PasswordCmd": "pass show calendar",
|
||||
"Url": "https://cal.example.com/anton/work",
|
||||
"Username": "anton"
|
||||
}
|
||||
],
|
||||
"DefaultNumDays": 23,
|
||||
"Timezone": "Europe/Berlin"
|
||||
}
|
||||
26
tests/modules/programs/qcal/webdav-calendar.nix
Normal file
26
tests/modules/programs/qcal/webdav-calendar.nix
Normal 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
|
||||
}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue