System/home-manager/linux/programs/desktop/notifs.nix

49 lines
1.4 KiB
Nix

{ config, lib, pkgs, inputs, ... }:
let
fuzzel-command = config.nathan.config.desktop.fuzzel-command;
hyprland = config.nathan.programs.hyprland.enable;
targets = config.nathan.config.desktop.targets;
shortcuts = inputs.self.packages.${pkgs.system}.shortcuts;
notif-package =
inputs.nixpkgs-unstable.legacyPackages.${pkgs.system}.swaynotificationcenter;
in lib.mkMerge [
# Hyprland specific
(lib.mkIf hyprland {
wayland.windowManager.hyprland.extraConfig = ''
# Notif bind
bind = SUPER, T, exec, swaync-client -t -sw
'';
})
# General configuration
(lib.mkIf hyprland {
home.packages = with pkgs; [ swayosd notif-package ];
# Setup swayosd as a service
systemd.user.services.swayosd = {
Unit = {
Description = "Swayosd";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${pkgs.swayosd}/bin/swayosd";
Restart = "on-failure";
};
Install = { WantedBy = [ "hyprland-session.target" ]; };
};
# Then sway notification center
systemd.user.services.swaync = {
Unit = {
Description = "SwayNotificationCenter";
After = [ "graphical-session.target" ];
};
Service = {
Type = "simple";
ExecStart = "${notif-package}/bin/swaync";
Restart = "on-failure";
};
Install = { WantedBy = [ "hyprland-session.target" ]; };
};
})
]