diff --git a/modules/programs/pimsync/default.nix b/modules/programs/pimsync/default.nix index b8edb7df5..bf772c8f7 100644 --- a/modules/programs/pimsync/default.nix +++ b/modules/programs/pimsync/default.nix @@ -51,7 +51,7 @@ localStorage = calendar: name: acc: { name = "storage"; - params = [ "${name}-local" ]; + params = [ "${if calendar then "calendar" else "contacts"}-${name}-local" ]; children = (attrsToDirectives { inherit (acc.local) path; @@ -63,7 +63,7 @@ remoteStorage = calendar: name: acc: { name = "storage"; - params = [ "${name}-remote" ]; + params = [ "${if calendar then "calendar" else "contacts"}-${name}-remote" ]; children = (attrsToDirectives { inherit (acc.remote) url; @@ -91,8 +91,8 @@ params = lib.singleton "${if calendar then "calendar" else "contacts"}-${name}"; children = (attrsToDirectives { - storage_a = "${name}-local"; - storage_b = "${name}-remote"; + storage_a = "${if calendar then "calendar" else "contacts"}-${name}-local"; + storage_b = "${if calendar then "calendar" else "contacts"}-${name}-remote"; }) ++ acc.pimsync.extraPairDirectives; }; diff --git a/tests/modules/programs/pimsync/basic.nix b/tests/modules/programs/pimsync/basic.nix index 2f9ae61e3..f029ea1f3 100644 --- a/tests/modules/programs/pimsync/basic.nix +++ b/tests/modules/programs/pimsync/basic.nix @@ -1,6 +1,6 @@ { accounts.calendar = { - accounts.caldav = { + accounts.mine = { pimsync.enable = true; remote = { passwordCommand = [ @@ -23,7 +23,7 @@ }; accounts.contact = { - accounts.carddav = { + accounts.mine = { pimsync.enable = true; remote = { passwordCommand = [ diff --git a/tests/modules/programs/pimsync/basic.scfg b/tests/modules/programs/pimsync/basic.scfg index a035e7883..6d09cbb3c 100644 --- a/tests/modules/programs/pimsync/basic.scfg +++ b/tests/modules/programs/pimsync/basic.scfg @@ -1,14 +1,18 @@ -storage caldav-local { - fileext .ics - path /home/hm-user/.local/state/calendar/caldav - type vdir/icalendar -} -storage http-local { +storage calendar-http-local { fileext .ics path /home/hm-user/.local/state/calendar/http type vdir/icalendar } -storage caldav-remote { +storage calendar-mine-local { + fileext .ics + path /home/hm-user/.local/state/calendar/mine + type vdir/icalendar +} +storage calendar-http-remote { + type webcal + url https://example.com/calendar +} +storage calendar-mine-remote { type caldav url https://caldav.example.com username alice @@ -16,24 +20,20 @@ storage caldav-remote { cmd pass caldav } } -storage http-remote { - type webcal - url https://example.com/calendar -} -pair calendar-caldav { - storage_a caldav-local - storage_b caldav-remote -} pair calendar-http { - storage_a http-local - storage_b http-remote + storage_a calendar-http-local + storage_b calendar-http-remote } -storage carddav-local { +pair calendar-mine { + storage_a calendar-mine-local + storage_b calendar-mine-remote +} +storage contacts-mine-local { fileext .vcf - path /home/hm-user/.local/state/contact/carddav + path /home/hm-user/.local/state/contact/mine type vdir/vcard } -storage carddav-remote { +storage contacts-mine-remote { type carddav url https://carddav.example.com username bob @@ -41,8 +41,8 @@ storage carddav-remote { cmd pass carddav } } -pair contacts-carddav { - storage_a carddav-local - storage_b carddav-remote +pair contacts-mine { + storage_a contacts-mine-local + storage_b contacts-mine-remote } status_path /test/dir