This repository has been archived on 2023-08-08. You can view files and clone it, but cannot push or open issues or pull requests.
nil/modules/applications/dunst.nix

94 lines
2.2 KiB
Nix
Raw Normal View History

{ options, config, lib, pkgs, user, ... }:
2022-03-08 05:16:32 +00:00
let
2022-08-14 02:42:16 +00:00
this = config.my.application.dunst;
2022-08-14 02:42:04 +00:00
i3 = config.my.application.i3;
graphical = config.my.graphical;
in
with lib; {
2022-03-08 05:16:32 +00:00
options = {
2022-08-14 02:42:04 +00:00
my.application.dunst.enable = mkOption {
default = i3.enable;
2022-03-24 04:00:26 +00:00
type = with types; bool;
2022-03-08 05:16:32 +00:00
};
};
2022-08-14 02:42:16 +00:00
config = mkIf this.enable {
home-manager.users."${user.name}" = {
2022-03-08 05:16:32 +00:00
systemd.user.startServices = true;
services.dunst.enable = true;
home.packages = with pkgs; [ libnotify ];
xdg.configFile."dunst/dunstrc".text = ''
[global]
monitor = 0
follow = mouse
shrink = no
padding = 20
horizontal_padding = 20
2022-03-17 04:35:32 +00:00
width = 300
2022-03-08 05:16:32 +00:00
height = 100
offset = 40x60
origin = top-right
frame_width = 0
separator_height = 0
frame_color = "#151515"
separator_color = "#151515"
sort = no
font = Overpass 10.5
markup = full
format = "<b>%s</b>\n%b"
alignment = left
show_age_threshold = 60
word_wrap = yes
ignore_newline = no
stack_duplicates = true
hide_duplicate_count = no
show_indicators = yes
icon_position = left
max_icon_size= 60
sticky_history = no
history_length = 6
title = Dunst
class = Dunst
corner_radius = 3
mouse_left_click = close_current
mouse_middle_click = do_action
mouse_right_click = close_all
[urgency_low]
background = "#1a1826"
foreground = "#f5c2e7"
timeout = 5
[urgency_normal]
background = "#1a1826"
foreground = "#f5c2e7"
timeout = 10
[urgency_critical]
background = "#1a1826"
foreground = "#f5c2e7"
timeout = 20
'';
};
2022-03-27 02:03:16 +00:00
2022-03-08 05:16:32 +00:00
systemd.user.services.dunst = {
enable = true;
2022-03-27 02:03:16 +00:00
description = "Notifications ";
wantedBy = [ "i3-session.target" ];
2022-03-08 05:16:32 +00:00
partOf = [ "graphical-session.target" ];
serviceConfig = {
2022-03-27 02:03:16 +00:00
ExecStart = "${pkgs.dunst}/bin/dunst";
2022-03-08 05:16:32 +00:00
RestartSec = 5;
Restart = "always";
};
};
};
}