diff options
author | Mx Kookie <kookie@spacekookie.de> | 2020-12-23 16:41:20 +0100 |
---|---|---|
committer | Mx Kookie <kookie@spacekookie.de> | 2020-12-23 16:41:20 +0100 |
commit | 606c9d9d1bc41b9ed3b188758109bd44450c90da (patch) | |
tree | 5a02f5e376eeb46b86deb5df0f8d702464297359 /infra/libkookie/modules/workstation/mail/core/default.nix | |
parent | 93d18a00d9d6ec81ea3f0e1790c80a7ffe879585 (diff) |
libkookie: implement mail module handling via external configuration
Diffstat (limited to 'infra/libkookie/modules/workstation/mail/core/default.nix')
-rw-r--r-- | infra/libkookie/modules/workstation/mail/core/default.nix | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/infra/libkookie/modules/workstation/mail/core/default.nix b/infra/libkookie/modules/workstation/mail/core/default.nix new file mode 100644 index 000000000000..58d372ffa122 --- /dev/null +++ b/infra/libkookie/modules/workstation/mail/core/default.nix @@ -0,0 +1,35 @@ +{ pkgs, config, ... } @ args: + +let cfg = config.libkookie.workstation.mail; +in +{ + # Might want to run mbsync manually + environment.systemPackages = with pkgs; [ isync ]; + + # Setup user to fetch mail + users.users.mail-user = { + createHome = true; + inherit (cfg.access) group; + home = "/var/lib/mail"; + }; + + systemd.services.isync = (import ./isync.nix) args; + + systemd.timers.isync = { + timerConfig.Unit = "isync.service"; + timerConfig.OnCalendar = "*:0/5"; + timerConfig.Persistent = "true"; + after = [ "network-online.target" ]; + wantedBy = [ "timers.target" ]; + }; + + # FIXME: this doesn't work and has never worked + # This sudoers rule allows anyone in the wheel group to run this + # particular command without a password. Make sure that 'startISync' + # is present in a path (environment.systemPackages above)! + # security.sudo.extraRules = [ + # { commands = [ { command = "${startISync}/bin/start-isync"; + # options = [ "NOPASSWD" ]; } ]; + # groups = [ "wheel" ]; } + # ]; +} |