diff --git a/home/modules/hyprland/default.nix b/home/modules/hyprland/default.nix index db6a97a..6a4d7c5 100644 --- a/home/modules/hyprland/default.nix +++ b/home/modules/hyprland/default.nix @@ -21,6 +21,7 @@ in ./alacritty.nix ./swayosd.nix ./sway-notification-center.nix + ./ntfy-sh.nix ]; config = lib.mkIf cfg.enable { home.packages = with pkgs; [ diff --git a/home/modules/hyprland/ntfy-sh.nix b/home/modules/hyprland/ntfy-sh.nix new file mode 100644 index 0000000..1e98e69 --- /dev/null +++ b/home/modules/hyprland/ntfy-sh.nix @@ -0,0 +1,13 @@ +{ config, pkgs, lib, ... }: +let + hyprland = config.profile.hyprland; + cfg = config.profile.services.ntfy-sh.client; + inherit (lib) mkIf; +in +{ + config = mkIf (hyprland.enable && cfg.enable) { + wayland.windowManager.hyprland.settings.exec-once = [ + "${pkgs.ntfy-sh}/bin/ntfy subscribe --config /etc/ntfy/client.yml --from-config" + ]; + }; +} diff --git a/system/services/ntfy-sh.nix b/system/services/ntfy-sh.nix index 52962d1..76ee6db 100644 --- a/system/services/ntfy-sh.nix +++ b/system/services/ntfy-sh.nix @@ -50,25 +50,6 @@ lib.mkMerge [ NTFY_CONFIG = configPath; }; - systemd.services.ntfy-client = { - enable = true; - wantedBy = [ "multi-user.target" ]; - description = "ntfy client"; - after = [ "network-online.target" ]; - restartTriggers = [ (builtins.toJSON cfg.client.settings) ]; - environment = { - DISPLAY = ":0"; - DBUS_SESSION_BUS_ADDRESS = "unix:path=/run/user/${toString config.profile.user.uid}/bus"; - }; - path = [ pkgs.bash ]; - serviceConfig = { - User = toString config.profile.user.uid; - Group = toString config.profile.user.gid; - ExecStart = "${pkgs.ntfy-sh}/bin/ntfy subscribe --config ${configPath} --from-config"; - Restart = "on-failure"; - }; - }; - sops = { secrets = let