ntfy-sh: add default-command to ntfy-sh client settings

This commit is contained in:
Tigor Hutasuhut 2024-10-11 10:25:10 +07:00
parent 519fb5c078
commit 202d959be6
4 changed files with 13 additions and 7 deletions

View file

@ -3,8 +3,8 @@ let
cfg = config.profile.openssh; cfg = config.profile.openssh;
inherit (lib.meta) getExe; inherit (lib.meta) getExe;
in in
{ lib.mkMerge [
config = lib.mkIf cfg.enable { (lib.mkIf cfg.enable {
networking.firewall = { networking.firewall = {
allowedTCPPorts = lib.mkAfter [ 22 ]; allowedTCPPorts = lib.mkAfter [ 22 ];
}; };
@ -56,5 +56,12 @@ in
security.pam.services.sshd.text = lib.mkDefault (lib.mkAfter '' security.pam.services.sshd.text = lib.mkDefault (lib.mkAfter ''
session optional pam_exec.so ${getExe pkgs.bash} ${config.sops.templates."ntfy-ssh-login.sh".path} session optional pam_exec.so ${getExe pkgs.bash} ${config.sops.templates."ntfy-ssh-login.sh".path}
''); '');
}; })
{
profile.services.ntfy-sh.client.settings.subscribe = [
{
topic = "ssh";
} }
];
}
]

View file

@ -83,7 +83,6 @@ lib.mkMerge [
profile.services.ntfy-sh.client.settings.subscribe = [ profile.services.ntfy-sh.client.settings.subscribe = [
{ {
topic = "valheim"; topic = "valheim";
command = ''${pkgs.libnotify}/bin/notify-send --category=im.received --urgency=normal "$title" "$message"'';
} }
]; ];
} }

View file

@ -169,7 +169,6 @@ lib.mkMerge [
profile.services.ntfy-sh.client.settings.subscribe = [ profile.services.ntfy-sh.client.settings.subscribe = [
{ {
topic = "ytptube"; topic = "ytptube";
command = ''${pkgs.libnotify}/bin/notify-send --category=im.received --urgency=normal "$title" "$message"'';
} }
]; ];
} }

View file

@ -85,7 +85,8 @@ lib.mkMerge [
content = builtins.readFile ((pkgs.formats.yaml { }).generate filename ( content = builtins.readFile ((pkgs.formats.yaml { }).generate filename (
{ {
default-host = "https://${domain}"; default-host = "https://${domain}";
detault-token = config.sops.placeholder."ntfy/tokens/tigor"; default-token = config.sops.placeholder."ntfy/tokens/tigor";
default-command = ''${pkgs.libnotify}/bin/notify-send --category=im.received --urgency=normal "$title" "$message"'';
} // cfg.client.settings } // cfg.client.settings
)); ));
path = configPath; path = configPath;