From cd690d202176c251f2a5ed31b621937f8a95268d Mon Sep 17 00:00:00 2001 From: Utkarsh Gupta Date: Fri, 14 Apr 2023 17:15:24 +0530 Subject: [PATCH] lazygit: use xdg.configHome on Darwin If XDG_CONFIG_HOME is set then lazygit will use it. We therefore write to that directory if Home Manager is managing the XDG directory variables. --- modules/programs/lazygit.nix | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/programs/lazygit.nix b/modules/programs/lazygit.nix index 84dab379c..7e7312be9 100644 --- a/modules/programs/lazygit.nix +++ b/modules/programs/lazygit.nix @@ -34,8 +34,10 @@ in { ''; description = '' Configuration written to - $XDG_CONFIG_HOME/lazygit/config.yml on Linux - or ~/Library/Application Support/lazygit/config.yml on Darwin. See + $XDG_CONFIG_HOME/lazygit/config.yml + on Linux or on Darwin if is set, otherwise + ~/Library/Application Support/lazygit/config.yml. + See for supported values. ''; @@ -46,12 +48,12 @@ in { home.packages = [ cfg.package ]; home.file."Library/Application Support/lazygit/config.yml" = - mkIf (cfg.settings != { } && isDarwin) { + mkIf (cfg.settings != { } && (isDarwin && !config.xdg.enable)) { source = yamlFormat.generate "lazygit-config" cfg.settings; }; xdg.configFile."lazygit/config.yml" = - mkIf (cfg.settings != { } && !isDarwin) { + mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable)) { source = yamlFormat.generate "lazygit-config" cfg.settings; }; };