From 6a0bbd6b4720da1c9ce7ebf35ff5c41a82db367a Mon Sep 17 00:00:00 2001 From: amusingimpala75 <69653100+amusingimpala75@users.noreply.github.com> Date: Tue, 12 May 2026 16:32:04 -0700 Subject: [PATCH] wallust: fix config location on darwin This fixes the path of the wallust config file to be under Library/Application Support/wallust when on Darwin, instead of assuming it always falls under the XDG_CONFIG_HOME (for whatever reason the owner of the Rust dirs package refuses to allow XDG on macOS, since it's non-standard) --- modules/programs/wallust.nix | 14 +++++++++++--- tests/modules/programs/wallust/wallust.nix | 20 ++++++++++++++++---- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/modules/programs/wallust.nix b/modules/programs/wallust.nix index 8e5f20afb..86a966d46 100644 --- a/modules/programs/wallust.nix +++ b/modules/programs/wallust.nix @@ -42,8 +42,16 @@ in config = mkIf cfg.enable { home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; - xdg.configFile."wallust/wallust.toml" = mkIf (cfg.settings != { }) { - source = tomlFormat.generate "wallust.toml" cfg.settings; - }; + xdg.configFile."wallust/wallust.toml" = + mkIf (cfg.settings != { } && !pkgs.stdenv.hostPlatform.isDarwin) + { + source = tomlFormat.generate "wallust.toml" cfg.settings; + }; + + home.file."Library/Application Support/wallust/wallust.toml" = + mkIf (cfg.settings != { } && pkgs.stdenv.hostPlatform.isDarwin) + { + source = tomlFormat.generate "wallust.toml" cfg.settings; + }; }; } diff --git a/tests/modules/programs/wallust/wallust.nix b/tests/modules/programs/wallust/wallust.nix index eaf9048af..2ec70153a 100644 --- a/tests/modules/programs/wallust/wallust.nix +++ b/tests/modules/programs/wallust/wallust.nix @@ -1,3 +1,7 @@ +{ + pkgs, + ... +}: { home.enableNixpkgsReleaseCheck = false; programs.wallust = { @@ -9,8 +13,16 @@ }; }; - nmt.script = '' - assertFileExists home-files/.config/wallust/wallust.toml - assertFileContent home-files/.config/wallust/wallust.toml ${./expected.toml} - ''; + nmt.script = + let + path = + if pkgs.stdenv.hostPlatform.isDarwin then + "home-files/Library/Application Support/wallust/wallust.toml" + else + "home-files/.config/wallust/wallust.toml"; + in + '' + assertFileExists '${path}' + assertFileContent '${path}' ${./expected.toml} + ''; }