fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let cfg = config . programs . xmobar ; 6in { 7options . programs . xmobar = { 8enable = mkEnableOption "Xmobar, a minimalistic status bar" ; 9 10package = mkOption { 11default = pkgs . haskellPackages . xmobar ; 12defaultText = literalExpression "pkgs.haskellPackages.xmobar" ; 13type = types . package ; 14description = '' 15Package providing the {command}`xmobar` binary. 16'' ; 17}; 18 19extraConfig = mkOption { 20default = "" ; 21example = literalExpression '' 22Config 23{ font = "Fira Code" 24, borderColor = "#d0d0d0" 25, border = FullB 26, borderWidth = 3 27, bgColor = "#222" 28, fgColor = "grey" 29, position = TopSize C 99 30 30, commands = 31[ Run Cpu ["-t", "cpu: <fc=#4eb4fa><bar> <total>%</fc>"] 10 32, Run Network "enp3s0" ["-S", "True", "-t", "eth: <fc=#4eb4fa><rx></fc>/<fc=#4eb4fa><tx></fc>"] 10 33, Run Memory ["-t","mem: <fc=#4eb4fa><usedbar> <usedratio>%</fc>"] 10 34, Run Date "date: <fc=#4eb4fa>%a %d %b %Y %H:%M:%S </fc>" "date" 10 35, Run StdinReader 36] 37, sepChar = "%" 38, alignSep = "}{" 39, template = " %StdinReader% | %cpu% | %memory% | %enp3s0% }{%date% " 40} 41'' ; 42type = types . lines ; 43description = '' 44Extra configuration lines to add to 45{file}`$XDG_CONFIG_HOME/xmobar/.xmobarrc`. 46See 47<https://xmobar.org/#configuration> 48for options. 49'' ; 50}; 51}; 52 53config = mkIf cfg . enable { 54home . packages = [ cfg . package ]; 55xdg . configFile . "xmobar/.xmobarrc" . text = cfg . extraConfig ; 56}; 57 58meta . maintainers = [ hm . maintainers . t4ccer ]; 59}