mirror of
https://github.com/nix-community/home-manager.git
synced 2026-06-05 21:02:51 +00:00
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:
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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}
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user