ntfy-sh: client activation moved to hyprland module

This commit is contained in:
Tigor Hutasuhut 2024-10-16 10:51:40 +07:00
parent 26ff543629
commit 05b77f5b34
3 changed files with 14 additions and 19 deletions

View file

@ -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; [

View file

@ -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"
];
};
}

View file

@ -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