From 1369d2cefb6f128c30e42fabcdebbacc07e18b3f Mon Sep 17 00:00:00 2001 From: Knut Magnus Aasrud Date: Thu, 26 Oct 2023 08:27:37 +0200 Subject: [PATCH] aerc: fix config paths on darwin When xdg.enable is set, aerc uses the $XDG_CONFIG_HOME variable instead of the default $HOME/Library/Preferences. home-manager needs to check this to make sure aerc can find the proper file in both cases. --- modules/programs/aerc.nix | 2 +- tests/modules/programs/aerc/settings.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/programs/aerc.nix b/modules/programs/aerc.nix index 0bfaa8f4a..7a48d91a5 100644 --- a/modules/programs/aerc.nix +++ b/modules/programs/aerc.nix @@ -24,7 +24,7 @@ let aerc-accounts = attrsets.filterAttrs (_: v: v.aerc.enable) config.accounts.email.accounts; - configDir = if pkgs.stdenv.isDarwin then + configDir = if (pkgs.stdenv.isDarwin && !config.xdg.enable) then "Library/Preferences/aerc" else "${config.xdg.configHome}/aerc"; diff --git a/tests/modules/programs/aerc/settings.nix b/tests/modules/programs/aerc/settings.nix index aa89cc4af..523b25646 100644 --- a/tests/modules/programs/aerc/settings.nix +++ b/tests/modules/programs/aerc/settings.nix @@ -5,7 +5,7 @@ with lib; { config = { nmt.script = let - dir = if pkgs.stdenv.isDarwin then + dir = if (pkgs.stdenv.isDarwin && !config.xdg.enable) then "home-files/Library/Preferences/aerc" else "home-files/.config/aerc";