refactor waybar, and use waybar default config

This commit is contained in:
ulic-youthlic 2025-01-15 19:14:54 +08:00
parent 85aa8b1ae0
commit 964ad68305
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
6 changed files with 255 additions and 1 deletions

33
home/modules/waybar.nix Normal file
View file

@ -0,0 +1,33 @@
{
pkgs,
config,
lib,
...
}:
let
cfg = config.youthlic.programs.waybar;
in
{
options = {
youthlic.programs.waybar = {
enable = lib.mkEnableOption "waybar";
configDir = lib.mkOption {
type = lib.types.path;
example = ./config;
description = ''
path to waybar config dir
'';
};
};
};
config = lib.mkIf cfg.enable {
home.packages = with pkgs; [
waybar
];
xdg.configFile."waybar" = {
enable = true;
source = cfg.configDir;
recursive = true;
};
};
}