mirror of
https://github.com/nix-community/home-manager.git
synced 2025-12-10 02:51:05 +01:00
pimsync: Make storage names unique
This includes the calendar/contacts prefix in the storage name as well as the pair name to ensure that if the same name is used for contacts and calendar then it is correctly referenced.
This commit is contained in:
parent
bcc7afa1d8
commit
43173abcb4
3 changed files with 29 additions and 29 deletions
|
|
@ -51,7 +51,7 @@
|
||||||
|
|
||||||
localStorage = calendar: name: acc: {
|
localStorage = calendar: name: acc: {
|
||||||
name = "storage";
|
name = "storage";
|
||||||
params = [ "${name}-local" ];
|
params = [ "${if calendar then "calendar" else "contacts"}-${name}-local" ];
|
||||||
children =
|
children =
|
||||||
(attrsToDirectives {
|
(attrsToDirectives {
|
||||||
inherit (acc.local) path;
|
inherit (acc.local) path;
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
|
|
||||||
remoteStorage = calendar: name: acc: {
|
remoteStorage = calendar: name: acc: {
|
||||||
name = "storage";
|
name = "storage";
|
||||||
params = [ "${name}-remote" ];
|
params = [ "${if calendar then "calendar" else "contacts"}-${name}-remote" ];
|
||||||
children =
|
children =
|
||||||
(attrsToDirectives {
|
(attrsToDirectives {
|
||||||
inherit (acc.remote) url;
|
inherit (acc.remote) url;
|
||||||
|
|
@ -91,8 +91,8 @@
|
||||||
params = lib.singleton "${if calendar then "calendar" else "contacts"}-${name}";
|
params = lib.singleton "${if calendar then "calendar" else "contacts"}-${name}";
|
||||||
children =
|
children =
|
||||||
(attrsToDirectives {
|
(attrsToDirectives {
|
||||||
storage_a = "${name}-local";
|
storage_a = "${if calendar then "calendar" else "contacts"}-${name}-local";
|
||||||
storage_b = "${name}-remote";
|
storage_b = "${if calendar then "calendar" else "contacts"}-${name}-remote";
|
||||||
})
|
})
|
||||||
++ acc.pimsync.extraPairDirectives;
|
++ acc.pimsync.extraPairDirectives;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
accounts.calendar = {
|
accounts.calendar = {
|
||||||
accounts.caldav = {
|
accounts.mine = {
|
||||||
pimsync.enable = true;
|
pimsync.enable = true;
|
||||||
remote = {
|
remote = {
|
||||||
passwordCommand = [
|
passwordCommand = [
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
accounts.contact = {
|
accounts.contact = {
|
||||||
accounts.carddav = {
|
accounts.mine = {
|
||||||
pimsync.enable = true;
|
pimsync.enable = true;
|
||||||
remote = {
|
remote = {
|
||||||
passwordCommand = [
|
passwordCommand = [
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
storage caldav-local {
|
storage calendar-http-local {
|
||||||
fileext .ics
|
|
||||||
path /home/hm-user/.local/state/calendar/caldav
|
|
||||||
type vdir/icalendar
|
|
||||||
}
|
|
||||||
storage http-local {
|
|
||||||
fileext .ics
|
fileext .ics
|
||||||
path /home/hm-user/.local/state/calendar/http
|
path /home/hm-user/.local/state/calendar/http
|
||||||
type vdir/icalendar
|
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
|
type caldav
|
||||||
url https://caldav.example.com
|
url https://caldav.example.com
|
||||||
username alice
|
username alice
|
||||||
|
|
@ -16,24 +20,20 @@ storage caldav-remote {
|
||||||
cmd pass caldav
|
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 {
|
pair calendar-http {
|
||||||
storage_a http-local
|
storage_a calendar-http-local
|
||||||
storage_b http-remote
|
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
|
fileext .vcf
|
||||||
path /home/hm-user/.local/state/contact/carddav
|
path /home/hm-user/.local/state/contact/mine
|
||||||
type vdir/vcard
|
type vdir/vcard
|
||||||
}
|
}
|
||||||
storage carddav-remote {
|
storage contacts-mine-remote {
|
||||||
type carddav
|
type carddav
|
||||||
url https://carddav.example.com
|
url https://carddav.example.com
|
||||||
username bob
|
username bob
|
||||||
|
|
@ -41,8 +41,8 @@ storage carddav-remote {
|
||||||
cmd pass carddav
|
cmd pass carddav
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pair contacts-carddav {
|
pair contacts-mine {
|
||||||
storage_a carddav-local
|
storage_a contacts-mine-local
|
||||||
storage_b carddav-remote
|
storage_b contacts-mine-remote
|
||||||
}
|
}
|
||||||
status_path /test/dir
|
status_path /test/dir
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue