From 95b1dc038ec74035eb647be562717d2222fcb68f Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Mon, 2 Oct 2023 16:58:54 +0100 Subject: [PATCH] Davmail service uses package directly instead of container --- README.org | 14 ++++++-------- home/accounts/email.nix | 37 +++++-------------------------------- hosts/Ronin/home.nix | 2 +- 3 files changed, 12 insertions(+), 41 deletions(-) diff --git a/README.org b/README.org index 3ba0bd97..a4e45d67 100644 --- a/README.org +++ b/README.org @@ -31,19 +31,17 @@ Register app-password with gnome-keyring: secret-tool store --label="iCloud mail mbsync" email e.litherlandsmith@icloud.com #+end_src ** UKAEA -*** Davmail -Docker source: [[https://hub.docker.com/r/connectical/davmail/][Docker]] - -No setup needed but initial pull may take a while, if systemd unit times out run: -#+begin_src bash -podman run --rm -d --name=davmail -p 127.0.0.1:1026:1025 -p 127.0.0.1:1144:1143 -p 127.0.0.1:1080:1080 connectical/davmail -#+end_src -and subsequent systemd runs should start fine. *** Password Register app-password with gnome-keyring: #+begin_src bash secret-tool store --label="UKAEA mail mbsync" email evie.litherland-smith@ukaea.uk #+end_src +*** Configuration +Example .davmail.properties needs copying to home directory, make rule can handle this. +Will need to restart systemd service after copying to pick up new settings +#+begin_src bash +systemctl --user restart davmail.service +#+end_src * Vdirsyncer ** Password Register app-password with gnome-keyring; diff --git a/home/accounts/email.nix b/home/accounts/email.nix index 57c45160..344178cf 100644 --- a/home/accounts/email.nix +++ b/home/accounts/email.nix @@ -207,41 +207,14 @@ }; davmail = lib.mkIf config.accounts.email.accounts.ukaea.mbsync.enable { Unit = { - Description = "Podman container-davmail.service"; - Documentation = [ "man:podman-generate-systemd(1)" ]; - Wants = [ "network-online.target" ]; - After = [ "network-online.target" ]; - RequiresMountsFor = "%t/containers"; + Description = "Davmail server"; + Wants = [ "network-online.target" "graphical-session.target" ]; + After = [ "network-online.target" "graphical-session.target" ]; }; Service = { - Environment = - [ "PODMAN_SYSTEMD_UNIT=%n" "PATH=/run/wrappers/bin/:$PATH" ]; + Environment = [ "PATH=/run/current-system/sw/bin/:$PATH" ]; Restart = "always"; - TimeoutStopSec = 70; - ExecStart = '' - ${pkgs.podman}/bin/podman run \ - --cidfile=%t/%n.ctr-id \ - --cgroups=no-conmon \ - --rm \ - --sdnotify=conmon \ - --replace \ - -d \ - --name=davmail \ - -p 127.0.0.1:1026:1025 \ - -p 127.0.0.1:1144:1143 \ - -p 127.0.0.1:1080:1080 connectical/davmail - ''; - ExecStop = '' - ${pkgs.podman}/bin/podman stop \ - --ignore -t 10 \ - --cidfile=%t/%n.ctr-id''; - ExecStopPost = '' - ${pkgs.podman}/bin/podman rm \ - -f \ - --ignore -t 10 \ - --cidfile=%t/%n.ctr-id''; - Type = "notify"; - NotifyAccess = "all"; + ExecStart = "${pkgs.davmail}/bin/davmail -notray"; }; Install.WantedBy = [ "default.target" ]; }; diff --git a/hosts/Ronin/home.nix b/hosts/Ronin/home.nix index 57427e77..12bb9e97 100644 --- a/hosts/Ronin/home.nix +++ b/hosts/Ronin/home.nix @@ -1,7 +1,7 @@ { config, pkgs, lib, user, ... }: { - home.packages = with pkgs; [ davmail openfortivpn nomachine-client ]; + home.packages = with pkgs; [ openfortivpn nomachine-client ]; programs = { git.userEmail = "evie.litherland-smith@ukaea.uk"; ssh.matchBlocks = {