@@ -15,31 +15,45 @@ with lib;
1515 options = {
1616
1717 services.gnome3.evolution-data-server = {
18−
19− enable = mkOption {
20− type = types.bool;
21− default = false;
22− description = ''
23− Whether to enable Evolution Data Server, a collection of services for
24− storing addressbooks and calendars.
25− '';
18+ enable = mkEnableOption "Evolution Data Server, a collection of services for storing addressbooks and calendars.";
19+ plugins = mkOption {
20+ type = types.listOf types.package;
21+ default = [ ];
22+ description = "Plugins for Evolution Data Server.";
2623 };
27−
2824 };
25+ programs.evolution = {
26+ enable = mkEnableOption "Evolution, a Personal information management application that provides integrated mail, calendaring and address book functionality.";
27+ plugins = mkOption {
28+ type = types.listOf types.package;
29+ default = [ ];
30+ example = literalExample "[ pkgs.evolution-ews ]";
31+ description = "Plugins for Evolution.";
32+ };
2933
34+ };
3035 };
3136
32−
3337 ###### implementation
3438
35− config = mkIf config.services.gnome3.evolution-data-server.enable {
36−
37− environment.systemPackages = [ pkgs.gnome3.evolution-data-server ];
38−
39− services.dbus.packages = [ pkgs.gnome3.evolution-data-server ];
40−
41− systemd.packages = [ pkgs.gnome3.evolution-data-server ];
42−
43− };
44−
39+ config =
40+ let
41+ bundle = pkgs.evolutionWithPlugins.override { inherit (config.services.gnome3.evolution-data-server) plugins; };
42+ in
43+ mkMerge [
44+ (mkIf config.services.gnome3.evolution-data-server.enable {
45+ environment.systemPackages = [ bundle ];
46+
47+ services.dbus.packages = [ bundle ];
48+
49+ systemd.packages = [ bundle ];
50+ })
51+ (mkIf config.programs.evolution.enable {
52+ services.gnome3.evolution-data-server = {
53+ enable = true;
54+ plugins = [ pkgs.evolution ] ++ config.programs.evolution.plugins;
55+ };
56+ services.gnome3.gnome-keyring.enable = true;
57+ })
58+ ];
4559}