From ad463e5f3f8a3bdf959806146bc541419bc43328 Mon Sep 17 00:00:00 2001 From: ItsDrike Date: Fri, 21 Jun 2024 13:09:02 +0200 Subject: [PATCH] Add dunst --- home/default.nix | 1 + home/services/default.nix | 4 +- home/services/dunst.nix | 100 ++++++++++++++++++++++++++++++++++++++ hosts/voyager/default.nix | 4 ++ options/home/default.nix | 1 + options/home/services.nix | 9 ++++ 6 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 home/services/dunst.nix create mode 100644 options/home/services.nix diff --git a/home/default.nix b/home/default.nix index fc15a74..90c64a0 100644 --- a/home/default.nix +++ b/home/default.nix @@ -34,6 +34,7 @@ in ./programs ./impermanence ./themes + ./services ]; config = { diff --git a/home/services/default.nix b/home/services/default.nix index 63b0638..9799edc 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,3 +1,5 @@ _: { - imports = [ ]; + imports = [ + ./dunst.nix + ]; } diff --git a/home/services/dunst.nix b/home/services/dunst.nix new file mode 100644 index 0000000..5293437 --- /dev/null +++ b/home/services/dunst.nix @@ -0,0 +1,100 @@ +{ + lib, + osConfig, + config, + ... +}: let + inherit (lib) mkIf; + + cfg = osConfig.myOptions.home-manager.services.dunst; +in { + config = mkIf cfg.enable { + services.dunst = { + enable = true; + iconTheme = { + package = config.gtk.iconTheme.package; + name = config.gtk.iconTheme.name; + }; + + settings = { + global = { + follow = "mouse"; + width = 270; + height = 300; + origin = "top-right"; + offset = "30x30"; + scale = 0; + alignment = "left"; + vertical_alignment = "center"; + ellipsize = "middle"; + padding = 10; + horizontal_padding = 10; + text_icon_padding = 0; + icon_position = "left"; + min_icon_size = 0; + max_icon_size = 32; + separator_height = 2; + frame_width = 3; + frame_color = "#27292c"; + separator_color = "frame"; + corner_radius = 0; + transparency = 20; + word_wrap = "yes"; + line_height = 0; + notification_limit = 3; + idle_threshold = 120; + history_length = 20; + show_age_threshold = 60; + markup = "full"; + format = "%a - %s\\n%b"; + font = "JetBrainsMono Nerd Font 11"; + sort = "yes"; + shrink = "no"; + sticky_history = "yes"; + ignore_newline = "no"; + show_indicators = "yes"; + stack_duplicates = true; + always_run_script = true; + hide_duplicate_count = false; + ignore_dbusclose = false; + force_xwayland = false; + force_xinerama = false; + mouse_left_click = "do_action, open_url, close_current"; + mouse_middle_click = "context"; + mouse_right_click = "close_current"; + indicate_hidden = "yes"; + progress_bar = true; + progress_bar_height = 30; + progress_bar_frame_width = 1; + progress_bar_min_width = 150; + progress_bar_max_width = 300; + title = "Dunst"; + class = "Dunst"; + }; + + fullscreen_delay_everything = {fullscreen = "delay";}; + + urgency_low = { + timeout = 5; + background = "#1e2137fa"; + foreground = "#ffffff"; + highlight = "#fe6c5a"; + }; + + urgency_normal = { + timeout = 10; + background = "#141c21fa"; + foreground = "#ffffffff"; + highlight = "#fe6c5a"; + }; + + urgency_critical = { + timeout = 0; + background = "#dd130ddd"; + foreground = "#ffffffff"; + highlight = "#fe6c5a"; + }; + }; + }; + }; +} diff --git a/hosts/voyager/default.nix b/hosts/voyager/default.nix index 5daf055..765225f 100644 --- a/hosts/voyager/default.nix +++ b/hosts/voyager/default.nix @@ -178,6 +178,10 @@ obs.enable = true; }; }; + + services = { + dunst.enable = true; + }; }; }; } diff --git a/options/home/default.nix b/options/home/default.nix index 8e7f5a8..9ea9de9 100644 --- a/options/home/default.nix +++ b/options/home/default.nix @@ -7,6 +7,7 @@ in ./git.nix ./wms.nix ./theme.nix + ./services.nix ]; options.myOptions.home-manager = { diff --git a/options/home/services.nix b/options/home/services.nix new file mode 100644 index 0000000..7586b0a --- /dev/null +++ b/options/home/services.nix @@ -0,0 +1,9 @@ +{ lib, ... }: with lib; let + inherit (lib) mkEnableOption mkOption types; +in +{ + options.myOptions.home-manager.services = { + dunst.enable = mkEnableOption "Dunst (lightweight notification daemon)"; + }; +} +