From 829b688827a3de38d7e43e2d045f28a727be25eb Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 8 Dec 2019 21:46:30 +0100 Subject: [PATCH] mbsync: skip maildir creation if no account is defined Fixes #937 (cherry picked from commit 621c98f15a31e7f0c1389f69aaacd0ac267ce29e) --- modules/programs/mbsync.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/programs/mbsync.nix b/modules/programs/mbsync.nix index 908a1add7..e50086bb2 100644 --- a/modules/programs/mbsync.nix +++ b/modules/programs/mbsync.nix @@ -178,11 +178,13 @@ in ++ groupsConfig ) + "\n"; - home.activation.createMaildir = - dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' - $DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${ - concatMapStringsSep " " (a: a.maildir.absPath) mbsyncAccounts - } - ''; + home.activation = mkIf (mbsyncAccounts != []) { + createMaildir = + dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] '' + $DRY_RUN_CMD mkdir -m700 -p $VERBOSE_ARG ${ + concatMapStringsSep " " (a: a.maildir.absPath) mbsyncAccounts + } + ''; + }; }; }