1# Evolution Data Server daemon.
2
3{ config, lib, pkgs, ... }:
4
5with lib;
6
7{
8
9 meta = {
10 maintainers = teams.gnome.members;
11 };
12
13 # Added 2021-05-07
14 imports = [
15 (mkRenamedOptionModule
16 [ "services" "gnome3" "evolution-data-server" "enable" ]
17 [ "services" "gnome" "evolution-data-server" "enable" ]
18 )
19 (mkRenamedOptionModule
20 [ "services" "gnome3" "evolution-data-server" "plugins" ]
21 [ "services" "gnome" "evolution-data-server" "plugins" ]
22 )
23 ];
24
25 ###### interface
26
27 options = {
28
29 services.gnome.evolution-data-server = {
30 enable = mkEnableOption (lib.mdDoc "Evolution Data Server, a collection of services for storing addressbooks and calendars");
31 plugins = mkOption {
32 type = types.listOf types.package;
33 default = [ ];
34 description = lib.mdDoc "Plugins for Evolution Data Server.";
35 };
36 };
37 programs.evolution = {
38 enable = mkEnableOption (lib.mdDoc "Evolution, a Personal information management application that provides integrated mail, calendaring and address book functionality");
39 plugins = mkOption {
40 type = types.listOf types.package;
41 default = [ ];
42 example = literalExpression "[ pkgs.evolution-ews ]";
43 description = lib.mdDoc "Plugins for Evolution.";
44 };
45
46 };
47 };
48
49 ###### implementation
50
51 config =
52 let
53 bundle = pkgs.evolutionWithPlugins.override { inherit (config.services.gnome.evolution-data-server) plugins; };
54 in
55 mkMerge [
56 (mkIf config.services.gnome.evolution-data-server.enable {
57 environment.systemPackages = [ bundle ];
58
59 services.dbus.packages = [ bundle ];
60
61 systemd.packages = [ bundle ];
62 })
63 (mkIf config.programs.evolution.enable {
64 services.gnome.evolution-data-server = {
65 enable = true;
66 plugins = [ pkgs.evolution ] ++ config.programs.evolution.plugins;
67 };
68 services.gnome.gnome-keyring.enable = true;
69 })
70 ];
71}