From 17af73ddd541d2f7860f3766074131af9d4e4a2e Mon Sep 17 00:00:00 2001 From: Periklis Tsirakidis Date: Thu, 21 Jun 2018 21:48:06 +0200 Subject: [PATCH] Fix args passing to execvp --- modules/services/mail/offlineimap.nix | 3 +-- tests/services-offlineimap.nix | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/services/mail/offlineimap.nix b/modules/services/mail/offlineimap.nix index e6a5753c..d7228c91 100644 --- a/modules/services/mail/offlineimap.nix +++ b/modules/services/mail/offlineimap.nix @@ -51,10 +51,9 @@ in { environment.etc."offlineimaprc".text = cfg.extraConfig; launchd.user.agents.offlineimap = { path = [ cfg.package ]; - command = "offlineimap"; + command = "${cfg.package}/bin/offlineimap -c /etc/offlineimaprc" + optionalString (cfg.runQuick) " -q"; serviceConfig.KeepAlive = false; serviceConfig.RunAtLoad = true; - serviceConfig.ProgramArguments = [ "-c" "/etc/offlineimaprc" ] ++ optional (cfg.runQuick) "-q"; serviceConfig.StartInterval = cfg.startInterval; serviceConfig.StandardErrorPath = "/var/log/offlineimap.log"; serviceConfig.StandardOutPath = "/var/log/offlineimap.log"; diff --git a/tests/services-offlineimap.nix b/tests/services-offlineimap.nix index dfbbb57d..a88e186f 100644 --- a/tests/services-offlineimap.nix +++ b/tests/services-offlineimap.nix @@ -34,7 +34,7 @@ in test = '' echo >&2 "checking offlineimap service in ~/Library/LaunchAgents" grep "org.nixos.offlineimap" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist - grep "exec\ offlineimap" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist + grep "bin/offlineimap" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist grep "\-q" ${config.out}/user/Library/LaunchAgents/org.nixos.offlineimap.plist echo >&2 "checking config in /etc/offlineimaprc"