git.iko.soy/typeable/nixpkgs
on master help sign in
nixos: rework evolution-data-server module
commitd671677eab09fcd18c3cdac72849b8eb86efe2f4 authorSymphorien Gibol <symphorien+git@xlumurb.eu> dateSun 25 Oct 2020, 16:09 (6 years ago) parente44b3c5
3 files changed+36−22
nixos/modules/services/desktops/gnome3/evolution-data-server.nix+32−18 pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix+3−3 pkgs/top-level/all-packages.nix+1−1
nixos/modules/services/desktops/gnome3/evolution-data-server.nix+32−18
@@ -15,30 +15,44 @@ 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
3539 config =
36− let evolution-with-plugins = (import ../../../../.. {}).evolution-with-plugins; in
37− mkIf config.services.gnome3.evolution-data-server.enable {
38− environment.systemPackages = [ evolution-with-plugins ];
39−
40− services.dbus.packages = [ evolution-with-plugins ];
41−
42− systemd.packages = [ evolution-with-plugins ];
43− };
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+ })
57+ ];
4458}
pkgs/applications/networking/mailreaders/evolution/evolution/wrapper.nix+3−3
@@ -1,8 +1,8 @@
1−{ lib, makeWrapper, symlinkJoin, evolution, evolution-ews, gnome3 }:
1+{ lib, makeWrapper, symlinkJoin, gnome3, plugins }:
22
33symlinkJoin {
44 name = "evolution-with-plugins";
5− paths = [ evolution evolution-ews gnome3.evolution-data-server];
5+ paths = [ gnome3.evolution-data-server ] ++ plugins;
66
77 buildInputs = [ makeWrapper ];
88
@@ -34,7 +34,7 @@ symlinkJoin {
3434 fixSymlink $out/share/dbus-1/service
3535 fixSymlink $out/lib/systemd/user
3636 for i in $out/share/dbus-1/services/*.service $out/lib/systemd/user/*.service; do
37− echo fixing service file $i
37+ echo fixing service file $i to point to $out
3838 sed -i "s@/nix/store/[^/]*/@$out/@" $i
3939 done
4040 '';
pkgs/top-level/all-packages.nix+1−1
@@ -21823,7 +21823,7 @@ in
2182321823 evolution-data-server = gnome3.evolution-data-server;
2182421824 evolution-ews = callPackage ../applications/networking/mailreaders/evolution/evolution-ews { };
2182521825 evolution = callPackage ../applications/networking/mailreaders/evolution/evolution { };
21826− evolution-with-plugins = callPackage ../applications/networking/mailreaders/evolution/evolution/wrapper.nix { };
21826+ evolutionWithPlugins = callPackage ../applications/networking/mailreaders/evolution/evolution/wrapper.nix { plugins = [ evolution evolution-ews ]; };
2182721827
2182821828 keepass = callPackage ../applications/misc/keepass { };
2182921829