From d1db9055ea3934e36a82332f6237b789b1d859ab Mon Sep 17 00:00:00 2001 From: Thierry Delafontaine Date: Mon, 21 Jul 2025 23:49:11 +0200 Subject: [PATCH] iamb: use correct config directory on macOS On macOS, configuration files are stored in the platform-standard directory `~/Library/Application Support/` by default. However, if the user enables the XDG Base Directory specification by setting `xdg.enable = true`, iamb should respect the `XDG_CONFIG_HOME` environment variable (along with other related XDG variables). Currently, this behavior is not implemented in iamb, a PR has been opened to fix that -> https://github.com/ulyssa/iamb/pull/478. --- modules/programs/iamb.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/programs/iamb.nix b/modules/programs/iamb.nix index a6a795127..61ccba7a1 100644 --- a/modules/programs/iamb.nix +++ b/modules/programs/iamb.nix @@ -7,6 +7,11 @@ let cfg = config.programs.iamb; tomlFormat = pkgs.formats.toml { }; + configDir = + if pkgs.stdenv.isDarwin && !config.xdg.enable then + "Library/Application Support" + else + config.xdg.configHome; in { options.programs.iamb = { @@ -46,7 +51,7 @@ in config = lib.mkIf cfg.enable { home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; - xdg.configFile."iamb/config.toml" = lib.mkIf (cfg.settings != { }) { + home.file."${configDir}/iamb/config.toml" = lib.mkIf (cfg.settings != { }) { source = tomlFormat.generate "iamb-config" cfg.settings; }; };