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)
This commit is contained in:
amusingimpala75
2026-05-12 16:32:04 -07:00
committed by GitHub
parent 5878fdadfe
commit 6a0bbd6b47
2 changed files with 27 additions and 7 deletions

View File

@@ -42,7 +42,15 @@ in
config = mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."wallust/wallust.toml" = mkIf (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;
};
};

View File

@@ -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}
'';
}