system/nix/wm/bar/polybar/default.nix

38 lines
760 B
Nix
Raw Normal View History

2022-08-24 23:54:30 +03:00
{ lib, config, pkgs, ...}:
with lib;
let
cfg = config.wm.bar.polybar;
pcfg = config.services.polybar;
2022-08-24 23:54:30 +03:00
# TODO: create a theme
2022-08-24 23:54:30 +03:00
colors = {
orange = "#ee9a00";
};
polybarConfig = import ./config.nix { inherit lib config pkgs colors; };
2022-08-24 23:54:30 +03:00
in
{
options.wm.bar.polybar = {
enable = mkOption {
type = types.bool;
default = false;
description = "Enable polybar status bar";
};
};
config = mkIf cfg.enable {
systemd.user.services.polybar = {
# Add additional /usr/bin to run custom scripts
Service.Environment = mkForce "PATH=${pcfg.package}/bin:/run/wrappers/bin:/usr/bin";
};
2022-08-24 23:54:30 +03:00
services.polybar = {
enable = true;
script = "polybar &";
settings = polybarConfig;
2022-08-24 23:54:30 +03:00
};
};
}