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.
This commit is contained in:
parent
ae79840bc7
commit
cd690d2021
|
@ -34,8 +34,10 @@ in {
|
||||||
'';
|
'';
|
||||||
description = ''
|
description = ''
|
||||||
Configuration written to
|
Configuration written to
|
||||||
<filename>$XDG_CONFIG_HOME/lazygit/config.yml</filename> on Linux
|
<filename>$XDG_CONFIG_HOME/lazygit/config.yml</filename>
|
||||||
or <filename>~/Library/Application Support/lazygit/config.yml</filename> on Darwin. See
|
on Linux or on Darwin if <xref linkend="opt-xdg.enable"/> is set, otherwise
|
||||||
|
<filename>~/Library/Application Support/lazygit/config.yml</filename>.
|
||||||
|
See
|
||||||
<link xlink:href="https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md"/>
|
<link xlink:href="https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md"/>
|
||||||
for supported values.
|
for supported values.
|
||||||
'';
|
'';
|
||||||
|
@ -46,12 +48,12 @@ in {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
home.file."Library/Application Support/lazygit/config.yml" =
|
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;
|
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||||
};
|
};
|
||||||
|
|
||||||
xdg.configFile."lazygit/config.yml" =
|
xdg.configFile."lazygit/config.yml" =
|
||||||
mkIf (cfg.settings != { } && !isDarwin) {
|
mkIf (cfg.settings != { } && !(isDarwin && !config.xdg.enable)) {
|
||||||
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
source = yamlFormat.generate "lazygit-config" cfg.settings;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue