mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 15:09:46 +01:00
3d65009eff
Some prefer to handle modules-* imperatively for more flexibility, e.g., via waybar "includes" (https://github.com/Alexays/Waybar/wiki/Configuration). Current HM defaults modules-* to `[]` instead of null for most other settings, so they get written to ~/.config/waybar/config even though no explicit configuration has been made. And they take precedence over the imperative ones because of how waybar's includes work: ==== Paths to additional configuration files. Each file can contain a single object with any of the bar configuration options. In case of duplicate options, the first defined value takes precedence, i.e. including file -> first included file -> etc. Nested includes are permitted, but make sure to avoid circular imports. For a multi-bar config, the include directive affects only current bar configuration object. ====
41 lines
1,019 B
Nix
41 lines
1,019 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
|
config = {
|
|
home.stateVersion = "22.05";
|
|
|
|
programs.waybar = {
|
|
package = config.lib.test.mkStubPackage { outPath = "@waybar@"; };
|
|
enable = true;
|
|
settings = [{
|
|
modules-center = [ "test" ];
|
|
modules = { "test" = { }; };
|
|
}];
|
|
};
|
|
|
|
test.asserts.assertions.expected = [''
|
|
The `programs.waybar.settings.[].modules` option has been removed.
|
|
It is now possible to declare modules in the configuration without nesting them under the `modules` option.
|
|
''];
|
|
|
|
nmt.script = ''
|
|
assertPathNotExists home-files/.config/waybar/style.css
|
|
assertFileContent \
|
|
home-files/.config/waybar/config \
|
|
${
|
|
builtins.toFile "waybar-deprecated-modules-option.json" ''
|
|
[
|
|
{
|
|
"modules-center": [
|
|
"test"
|
|
],
|
|
"test": {}
|
|
}
|
|
]
|
|
''
|
|
}
|
|
'';
|
|
};
|
|
}
|