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

93 lines
2.2 KiB
Nix

{ options, config, lib, pkgs, ... }:
let
cfg = config.this.application.dunst;
i3 = config.this.application.i3;
graphical = config.this.graphical;
in with lib; {
options = {
this.application.dunst.enable = mkOption {
default = i3.enable;
type = with types; bool;
};
};
config = mkIf cfg.enable {
home-manager.users.james = {
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
width = 300
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
'';
};
systemd.user.services.dunst = {
enable = true;
description = "Notifications ";
wantedBy = [ "i3-session.target" ];
partOf = [ "graphical-session.target" ];
serviceConfig = {
ExecStart = "${pkgs.dunst}/bin/dunst";
RestartSec = 5;
Restart = "always";
};
};
};
}