nixos: rework evolution-data-server module

This commit is contained in:
Symphorien Gibol 2020-10-25 16:09:56 +01:00
parent e44b3c5187
commit d671677eab
3 changed files with 34 additions and 20 deletions

View File

@ -15,30 +15,44 @@ with lib;
options = { options = {
services.gnome3.evolution-data-server = { services.gnome3.evolution-data-server = {
enable = mkEnableOption "Evolution Data Server, a collection of services for storing addressbooks and calendars.";
enable = mkOption { plugins = mkOption {
type = types.bool; type = types.listOf types.package;
default = false; default = [ ];
description = '' description = "Plugins for Evolution Data Server.";
Whether to enable Evolution Data Server, a collection of services for };
storing addressbooks and calendars. };
''; 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 ###### implementation
config = config =
let evolution-with-plugins = (import ../../../../.. {}).evolution-with-plugins; in let
mkIf config.services.gnome3.evolution-data-server.enable { bundle = pkgs.evolutionWithPlugins.override { inherit (config.services.gnome3.evolution-data-server) plugins; };
environment.systemPackages = [ evolution-with-plugins ]; in
mkMerge [
(mkIf config.services.gnome3.evolution-data-server.enable {
environment.systemPackages = [ bundle ];
services.dbus.packages = [ evolution-with-plugins ]; services.dbus.packages = [ bundle ];
systemd.packages = [ evolution-with-plugins ]; systemd.packages = [ bundle ];
}; })
(mkIf config.programs.evolution.enable {
services.gnome3.evolution-data-server = {
enable = true;
plugins = [ pkgs.evolution ] ++ config.programs.evolution.plugins;
};
})
];
} }

View File

@ -1,8 +1,8 @@
{ lib, makeWrapper, symlinkJoin, evolution, evolution-ews, gnome3 }: { lib, makeWrapper, symlinkJoin, gnome3, plugins }:
symlinkJoin { symlinkJoin {
name = "evolution-with-plugins"; name = "evolution-with-plugins";
paths = [ evolution evolution-ews gnome3.evolution-data-server]; paths = [ gnome3.evolution-data-server ] ++ plugins;
buildInputs = [ makeWrapper ]; buildInputs = [ makeWrapper ];
@ -34,7 +34,7 @@ symlinkJoin {
fixSymlink $out/share/dbus-1/service fixSymlink $out/share/dbus-1/service
fixSymlink $out/lib/systemd/user fixSymlink $out/lib/systemd/user
for i in $out/share/dbus-1/services/*.service $out/lib/systemd/user/*.service; do 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 sed -i "s@/nix/store/[^/]*/@$out/@" $i
done done
''; '';

View File

@ -21823,7 +21823,7 @@ in
evolution-data-server = gnome3.evolution-data-server; evolution-data-server = gnome3.evolution-data-server;
evolution-ews = callPackage ../applications/networking/mailreaders/evolution/evolution-ews { }; evolution-ews = callPackage ../applications/networking/mailreaders/evolution/evolution-ews { };
evolution = callPackage ../applications/networking/mailreaders/evolution/evolution { }; 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 { }; keepass = callPackage ../applications/misc/keepass { };