Files
home-manager/tests/modules/programs/hyfetch/settings.nix
sensura-san 36d5f7e937 hyfetch: add platform-dependent path support
Now supports the correct filepath for macOS systems, which hyfetch on macOS reads from by default.
Hyfetch test cases are updated to cover this.
2026-09-30 15:00:11 -05:00

40 lines
952 B
Nix

{
xdgEnable ? true,
configDir ? ".config",
}:
{ config, pkgs, ... }:
let
darwinConfigFile = "Library/Application Support/hyfetch.json";
xdgConfigFile = "${configDir}/hyfetch.json";
expectedConfigFile = if pkgs.stdenv.hostPlatform.isDarwin then darwinConfigFile else xdgConfigFile;
unexpectedConfigFile =
if pkgs.stdenv.hostPlatform.isDarwin then xdgConfigFile else darwinConfigFile;
in
{
xdg = {
enable = xdgEnable;
configHome = "${config.home.homeDirectory}/${configDir}";
};
programs.hyfetch = {
enable = true;
settings = {
preset = "rainbow";
mode = "rgb";
light_dark = "dark";
lightness = 0.5;
color_align = {
mode = "horizontal";
custom_colors = [ ];
fore_back = null;
};
};
};
nmt.script = ''
assertFileContent "home-files/${expectedConfigFile}" ${./hyfetch.json}
assertPathNotExists "home-files/${unexpectedConfigFile}"
'';
}