mirror of
https://github.com/nix-community/home-manager
synced 2024-12-19 00:09:48 +01:00
7c0dc519e1
The empty configuration test for the bottom module introduced as of https://github.com/nix-community/home-manager/pull/2323 is not cross platform. Specifically, it silently fails under a darwin environment due to the configuration file not being generated at $XDG_CONFIG_HOME. This PR add cross platform support by specifying the platform-dependent configuration directories to check. The expected unit test data was also extracted to a separate file to differentiate between test data changes and changes to the test itself.
32 lines
624 B
Nix
32 lines
624 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
programs.bottom = {
|
|
enable = true;
|
|
package = config.lib.test.mkStubPackage { };
|
|
|
|
settings = {
|
|
flags = {
|
|
avg_cpu = true;
|
|
temperature_type = "c";
|
|
};
|
|
|
|
colors = { low_battery_color = "red"; };
|
|
};
|
|
};
|
|
|
|
nmt.script = let
|
|
configDir = if pkgs.stdenv.isDarwin then
|
|
"home-files/Library/Application Support"
|
|
else
|
|
"home-files/.config";
|
|
in ''
|
|
assertFileContent \
|
|
"${configDir}/bottom/bottom.toml" \
|
|
${./example-settings-expected.toml}
|
|
'';
|
|
};
|
|
}
|