dunst.nix (2954B)
1 { config, pkgs, lib, ... }: 2 3 with lib; 4 5 { 6 options.dunst = { 7 enable = mkEnableOption "Dunst"; 8 9 geometry = { 10 width = mkOption { 11 type = types.int; 12 default = 300; 13 example = 200; 14 description = "Width of notifications"; 15 }; 16 height = mkOption { 17 type = types.int; 18 default = 5; 19 example = 10; 20 description = "Height of notifications"; 21 }; 22 x = mkOption { 23 type = types.int; 24 default = 30; 25 example = 50; 26 description = "x position of notifications"; 27 }; 28 y = mkOption { 29 type = types.int; 30 default = 20; 31 example = 50; 32 description = "y position of notifications"; 33 }; 34 }; 35 36 font = mkOption { 37 type = types.str; 38 default = "Hack"; 39 example = "Hack"; 40 description = "Font used"; 41 }; 42 }; 43 44 config = mkIf config.dunst.enable { 45 home.packages = [ pkgs.libnotify ]; 46 services.dunst = { 47 enable = true; 48 settings = { 49 global = { 50 follow = "keyboard"; 51 52 geometry = (g: "${toString g.width}x${toString g.height}-${toString g.x}+${toString g.y}") config.dunst.geometry; 53 #corner_radius = 0; 54 #transparency = 0; 55 56 #progress_bar = true; 57 #progress_bar_height = 10; 58 #progress_bar_frame_width = 1; 59 #progress_bar_min_width = 150; 60 #progress_bar_max_width = 300; 61 62 #indicate_hidden = true; 63 64 #shrink = false; 65 66 #notification_height = 0; 67 68 #separator_height = 2; 69 #separator_color = "auto"; 70 71 #padding = 0; 72 #horizontal_padding = 0; 73 #text_icon_padding = 0; 74 75 #frame_color = "#888888"; 76 #frame_width = 0; 77 78 #sort = true; 79 80 #idle_threshold = 0; 81 82 font = config.dunst.font; 83 84 #line_height = 0; 85 86 #markup = "no"; 87 88 #format = "%s %b"; 89 90 #alignment = "left"; 91 #vertical_alignment = "center"; 92 93 #show_age_threshold = -1; 94 95 #word_wrap = false; 96 97 #ellipsize = "middle"; 98 99 #ignore_newline = false; 100 101 #stack_duplicates = true; 102 #hide_duplicate_count = false; 103 104 #show_indicatores = true; 105 106 #icon_position = "off"; 107 #min_icon_size = 0; 108 #max_icon_size = 0; 109 110 #sticky_history = true; 111 #history_length = 20; 112 113 #dmenu = an option; 114 #browser = an option; 115 116 #always_run_script = true; 117 118 #title = "Dunst"; 119 #class = "Dunst"; 120 121 #startup_notification = false; 122 123 #verbosity = "mesg"; 124 125 #mouse_left_click = "none"; 126 #mouse_middle_click = "none"; 127 #mouse_right_click = "none"; 128 129 #ignore_dbusclose = false; 130 }; 131 urgency_critical = {}; 132 urgency_normal = {}; 133 urgency_low = {}; 134 }; 135 }; 136 }; 137 }