zaphyra's git: nixfiles

zaphyra's nixfiles

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 
{
  config,
  lib,
  pkgs,
  ...
}:

{
  options.zpha.programs.gnome-online-accounts.enable =
    lib.mkEnableOption "Enable gnome-online-accounts and evolution-data-server";

  config = lib.mkIf config.zpha.programs.gnome-online-accounts.enable (
    let
      gnome-online-accounts = pkgs.gnome-online-accounts.overrideAttrs (prevAttrs: {
        mesonFlags = prevAttrs.mesonFlags ++ [
          "-Dexchange=false"
          "-Dgoogle=false"
          "-Dkerberos=false"
          "-Downcloud=false"
          "-Dms_graph=false"
        ];
      });

    in
    {
      preservation.preserveAt."/persist".users.zaphyra.directories = [
        ".local/share/evolution"
        ".config/goa-1.0"
      ];

      users.users.zaphyra.maid = {
        dbus.packages = [ gnome-online-accounts ];
        packages = with pkgs; [
          gnome-online-accounts-gtk
          (evolution-data-server-gtk4.override {
            withGtk4 = true;
            enableOAuth2 = false;
          })
        ];
        systemd.services.gnome-online-accounts = {
          unitConfig.Description = "Gnome Online Accounts";
          serviceConfig = {
            Type = "dbus";
            ExecStart = "${gnome-online-accounts}/libexec/goa-daemon";
            BusName = "org.gnome.OnlineAccounts";
          };
        };
      };

    }
  );

}