nixos/dunst: init module (#387511)

This commit is contained in:
Gergő Gutyina
2026-01-29 22:33:02 +00:00
committed by GitHub
4 changed files with 84 additions and 1 deletions
@@ -36,6 +36,8 @@
- [dsearch](https://github.com/AvengeMedia/danksearch), a fast filesystem search service with fuzzy matching. Available as [programs.dsearch](#opt-programs.dsearch.enable).
- [Dunst](https://github.com/dunst-project/dunst), a lightweight and customizable notification daemon. Available as [services.dunst](#opt-services.dunst.enable).
- [Ente Auth](https://ente.io/auth/), an open source 2FA authenticator, with end-to-end encrypted backups. Available as [programs.ente-auth](#opt-programs.ente-auth.enable).
- [Dawarich](https://dawarich.app/), a self-hostable location history tracker. Available as [services.dawarich](#opt-services.dawarich.enable).
+1
View File
@@ -558,6 +558,7 @@
./services/desktops/bonsaid.nix
./services/desktops/cpupower-gui.nix
./services/desktops/dleyna.nix
./services/desktops/dunst.nix
./services/desktops/espanso.nix
./services/desktops/flatpak.nix
./services/desktops/geoclue2.nix
+79
View File
@@ -0,0 +1,79 @@
{
config,
pkgs,
lib,
...
}:
let
toml = pkgs.formats.toml { };
cfg = config.services.dunst;
in
{
options.services.dunst = {
enable = lib.mkEnableOption "Dunst notification daemon";
package = lib.mkPackageOption pkgs "dunst" { } // {
apply =
p:
p.override {
withX11 = cfg.enableX11;
withWayland = cfg.enableWayland;
};
};
settings = lib.mkOption {
type = toml.type;
default = { };
description = "Dunst configuration, see dunst(5)";
example = lib.literalExpression ''
{
global = {
width = 300;
height = 300;
offset = "30x50";
origin = "top-right";
transparency = 10;
frame_color = "#eceff1";
font = "Droid Sans 9";
};
urgency_normal = {
background = "#37474f";
foreground = "#eceff1";
timeout = 10;
};
};
'';
};
enableX11 = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable X11 support.";
};
enableWayland = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Whether to enable Wayland support.";
};
};
config = lib.mkIf cfg.enable {
assertions = [
{
assertion = cfg.enableX11 || cfg.enableWayland;
message = "Dunst must be built with at least either X11 support or Wayland support";
}
];
environment = {
systemPackages = [ cfg.package ];
etc."xdg/dunst/dunstrc".source = toml.generate "dunstrc" cfg.settings;
};
services.dbus.packages = [ cfg.package ];
};
meta.maintainers = with lib.maintainers; [ nyukuru ];
}
+2 -1
View File
@@ -77,7 +77,8 @@ stdenv.mkDerivation (finalAttrs: {
makeFlags = [
"PREFIX=$(out)"
"VERSION=$(version)"
"SYSCONFDIR=$(out)/etc"
"SYSCONFDIR=/etc/xdg"
"SYSCONF_FORCE_NEW=0"
"SERVICEDIR_DBUS=$(out)/share/dbus-1/services"
"SERVICEDIR_SYSTEMD=$(out)/lib/systemd/user"
]