1
1
Fork 1
mirror of https://github.com/oddlama/nix-config.git synced 2025-10-11 07:10:39 +02:00

feat: add deadd-notification-center

This commit is contained in:
oddlama 2023-09-30 02:51:51 +02:00
parent 090aab181f
commit d9b1bf7e9a
No known key found for this signature in database
GPG key ID: 14EFE510775FE39A
6 changed files with 548 additions and 6 deletions

View file

@ -0,0 +1,72 @@
{
config,
lib,
pkgs,
...
}: let
inherit
(lib)
mkOption
mkEnableOption
mkPackageOption
literalExpression
mkIf
types
;
settingsFormat = pkgs.formats.yaml {};
cfg = config.services.deadd-notification-center;
in {
options.services.deadd-notification-center = {
enable = mkEnableOption "deadd notification center";
package = mkPackageOption pkgs "deadd-notification-center" {};
settings = mkOption {
default = {};
type = types.submodule {
freeformType = settingsFormat.type;
};
description = ''
Settings for the notification center.
Refer to https://github.com/phuhl/linux_notification_center#configuration for available options.
'';
example = literalExpression ''
{
notification-center = {
marginTop = 30;
width = 500;
};
}
'';
};
style = mkOption {
type = types.lines;
description = "CSS styling for notifications.";
};
};
config = mkIf cfg.enable {
xdg.configFile."deadd/deadd.yml".source = settingsFormat.generate "deadd.yml" cfg.settings;
xdg.configFile."deadd/deadd.css".text = cfg.style;
systemd.user.services.deadd-notification-center = {
Install.WantedBy = ["graphical-session.target"];
Unit = {
Description = "Deadd Notification Center";
PartOf = ["graphical-session.target"];
After = ["graphical-session.target"];
X-Restart-Triggers = [
config.xdg.configFile."deadd/deadd.yml".source
config.xdg.configFile."deadd/deadd.css".source
];
};
Service = {
Type = "dbus";
BusName = "org.freedesktop.Notifications";
ExecStart = "${cfg.package}/bin/deadd-notification-center";
Restart = "on-failure";
};
};
};
}

View file

@ -1,8 +1,9 @@
{...}: {
imports = [
./neovim.nix
./secrets.nix
./deadd-notification-center.nix
./uid.nix
./secrets.nix
./neovim.nix
./config/htop.nix
./config/impermanence.nix