summary refs log tree commit diff
diff options
context:
space:
mode:
authorSymphorien Gibol <symphorien+git@xlumurb.eu>2020-10-25 16:09:56 +0100
committerSymphorien Gibol <symphorien+git@xlumurb.eu>2021-01-17 11:13:54 +0100
commitd671677eab09fcd18c3cdac72849b8eb86efe2f4 (patch)
tree1ceef28cf7dace3529e330e01ba2f1413e2e9eb5
parente44b3c518793fcd742ed432dcfe1a700c4825716 (diff)
downloadnixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.tar
nixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.tar.gz
nixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.tar.bz2
nixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.tar.lz
nixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.tar.xz
nixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.tar.zst
nixpkgs-d671677eab09fcd18c3cdac72849b8eb86efe2f4.zip
nixos: rework evolution-data-server module
-rw-r--r--nixos/modules/services/desktops/gnome3/evolution-data-server.nix50
-rw-r--r--pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix6
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 36 insertions, 22 deletions
diff --git a/nixos/modules/services/desktops/gnome3/evolution-data-server.nix b/nixos/modules/services/desktops/gnome3/evolution-data-server.nix
index b8ad7a343c9..12f13f72979 100644
--- a/nixos/modules/services/desktops/gnome3/evolution-data-server.nix
+++ b/nixos/modules/services/desktops/gnome3/evolution-data-server.nix
@@ -15,30 +15,44 @@ with lib;
   options = {
 
     services.gnome3.evolution-data-server = {
-
-      enable = mkOption {
-        type = types.bool;
-        default = false;
-        description = ''
-          Whether to enable Evolution Data Server, a collection of services for
-          storing addressbooks and calendars.
-        '';
+      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 = literalExample "[ pkgs.evolution-ews ]";
+        description = "Plugins for Evolution.";
+      };
 
+    };
   };
 
-
   ###### implementation
 
   config =
-  let evolution-with-plugins = (import ../../../../.. {}).evolution-with-plugins; in
-  mkIf config.services.gnome3.evolution-data-server.enable {
-    environment.systemPackages = [ evolution-with-plugins ];
-
-    services.dbus.packages = [ evolution-with-plugins ];
-
-    systemd.packages = [ evolution-with-plugins ];
-  };
+    let
+      bundle = pkgs.evolutionWithPlugins.override { inherit (config.services.gnome3.evolution-data-server) plugins; };
+    in
+    mkMerge [
+      (mkIf config.services.gnome3.evolution-data-server.enable {
+        environment.systemPackages = [ bundle ];
+
+        services.dbus.packages = [ bundle ];
+
+        systemd.packages = [ bundle ];
+      })
+      (mkIf config.programs.evolution.enable {
+        services.gnome3.evolution-data-server = {
+          enable = true;
+          plugins = [ pkgs.evolution ] ++ config.programs.evolution.plugins;
+        };
+      })
+    ];
 }
diff --git a/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix b/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix
index 4f5278fce97..050082c6f93 100644
--- a/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix
+++ b/pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix
@@ -1,8 +1,8 @@
-{ lib, makeWrapper, symlinkJoin, evolution, evolution-ews, gnome3 }:
+{ lib, makeWrapper, symlinkJoin, gnome3, plugins }:
 
 symlinkJoin {
   name = "evolution-with-plugins";
-  paths = [ evolution evolution-ews gnome3.evolution-data-server];
+  paths = [ gnome3.evolution-data-server ] ++ plugins;
 
   buildInputs = [ makeWrapper ];
 
@@ -34,7 +34,7 @@ symlinkJoin {
     fixSymlink $out/share/dbus-1/service
     fixSymlink $out/lib/systemd/user
     for i in $out/share/dbus-1/services/*.service $out/lib/systemd/user/*.service; do
-      echo fixing service file $i
+      echo fixing service file $i to point to $out
       sed -i "s@/nix/store/[^/]*/@$out/@" $i
     done
   '';
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index f130c92f3b9..b6a9a0cf192 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -21823,7 +21823,7 @@ in
   evolution-data-server = gnome3.evolution-data-server;
   evolution-ews = callPackage ../applications/networking/mailreaders/evolution/evolution-ews { };
   evolution = callPackage ../applications/networking/mailreaders/evolution/evolution { };
-  evolution-with-plugins = callPackage ../applications/networking/mailreaders/evolution/evolution/wrapper.nix { };
+  evolutionWithPlugins = callPackage ../applications/networking/mailreaders/evolution/evolution/wrapper.nix { plugins = [ evolution evolution-ews ]; };
 
   keepass = callPackage ../applications/misc/keepass { };