summary refs log tree commit diff
path: root/nixos/modules/services/desktops/gnome/evolution-data-server.nix
blob: bd2242d98182e78a419c0cb372db9b8c2017ea7c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Evolution Data Server daemon.

{ config, lib, pkgs, ... }:

with lib;

{

  meta = {
    maintainers = teams.gnome.members;
  };

  # Added 2021-05-07
  imports = [
    (mkRenamedOptionModule
      [ "services" "gnome3" "evolution-data-server" "enable" ]
      [ "services" "gnome" "evolution-data-server" "enable" ]
    )
    (mkRenamedOptionModule
      [ "services" "gnome3" "evolution-data-server" "plugins" ]
      [ "services" "gnome" "evolution-data-server" "plugins" ]
    )
  ];

  ###### interface

  options = {

    services.gnome.evolution-data-server = {
      enable = mkEnableOption "Evolution Data Server, a collection of services for storing addressbooks and calendars.";
      plugins = mkOption {
        type = types.listOf types.package;
        default = [ ];
        description = "Plugins for Evolution Data Server.";
      };
    };
    programs.evolution = {
      enable = mkEnableOption "Evolution, a Personal information management application that provides integrated mail, calendaring and address book functionality.";
      plugins = mkOption {
        type = types.listOf types.package;
        default = [ ];
        example = literalExpression "[ pkgs.evolution-ews ]";
        description = "Plugins for Evolution.";
      };

    };
  };

  ###### implementation

  config =
    let
      bundle = pkgs.evolutionWithPlugins.override { inherit (config.services.gnome.evolution-data-server) plugins; };
    in
    mkMerge [
      (mkIf config.services.gnome.evolution-data-server.enable {
        environment.systemPackages = [ bundle ];

        services.dbus.packages = [ bundle ];

        systemd.packages = [ bundle ];
      })
      (mkIf config.programs.evolution.enable {
        services.gnome.evolution-data-server = {
          enable = true;
          plugins = [ pkgs.evolution ] ++ config.programs.evolution.plugins;
        };
        services.gnome.gnome-keyring.enable = true;
      })
    ];
}