fork/home-manager
git clone https://git.julia.blue/fork/home-manager
75790441
master
1{ config , lib , pkgs , ...} : 2 3with lib ; 4 5let 6cfg = config . wayland . windowManager . sway . swaynag ; 7 8iniFormat = pkgs . formats . ini { }; 9 10confFormat = with types ; 11let 12confAtom = nullOr ( oneOf [ bool int float str ]) // { 13description = "Swaynag config atom (null, bool, int, float, str)" ; 14}; 15in attrsOf confAtom ; 16in { 17meta . maintainers = with maintainers ; [ polykernel ]; 18 19options = { 20wayland . windowManager . sway . swaynag = { 21enable = mkEnableOption 22"configuration of swaynag, a lightweight error bar for sway" ; 23 24settings = mkOption { 25type = types . attrsOf confFormat ; 26default = { }; 27description = '' 28Configuration written to 29{file}`$XDG_CONFIG_HOME/swaynag/config`. 30 31See 32{manpage}`swaynag(5)` 33for a list of available options and an example configuration. 34Note, configurations declared under `<config>` 35will override the default type values of swaynag. 36'' ; 37example = literalExpression '' 38{ 39"<config>" = { 40edge = "bottom"; 41font = "Dina 12"; 42}; 43 44green = { 45edge = "top"; 46background = "00AA00"; 47text = "FFFFFF"; 48button-background = "00CC00"; 49message-padding = 10; 50}; 51} 52'' ; 53}; 54}; 55}; 56 57config = mkIf cfg . enable { 58assertions = [ 59( hm . assertions . assertPlatform "wayland.windowManager.sway.swaynag" pkgs 60platforms . linux ) 61]; 62 63xdg . configFile . "swaynag/config" = mkIf ( cfg . settings != { }) { 64source = iniFormat . generate "swaynag.conf" cfg . settings ; 65}; 66}; 67}