1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-03 23:51:03 +01:00
home-manager/modules/programs/yambar.nix
Austin Horstman cba2f9ce95 treewide: reformat nixfmt-rfc-style
Reformat repository using new nixfmt-rfc-style.
2025-04-08 08:50:05 -07:00

60 lines
1.3 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.programs.yambar;
yamlFormat = pkgs.formats.yaml { };
in
{
meta.maintainers = [ lib.maintainers.carpinchomug ];
options.programs.yambar = {
enable = lib.mkEnableOption "Yambar";
package = lib.mkPackageOption pkgs "yambar" { nullable = true; };
settings = lib.mkOption {
type = yamlFormat.type;
default = { };
example = lib.literalExpression ''
bar = {
location = "top";
height = 26;
background = "00000066";
right = [
{
clock.content = [
{
string.text = "{time}";
}
];
}
];
};
'';
description = ''
Configuration written to {file}`$XDG_CONFIG_HOME/yambar/config.yml`.
See {manpage}`yambar(5)` for options.
'';
};
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "programs.yambar" pkgs lib.platforms.linux)
];
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
xdg.configFile."yambar/config.yml" = lib.mkIf (cfg.settings != { }) {
source = yamlFormat.generate "config.yml" cfg.settings;
};
};
}