Compare commits
3 commits
78210642c0
...
bcdaa091eb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bcdaa091eb | ||
|
|
e9bce3fd6a | ||
|
|
301d0f7807 |
3 changed files with 23 additions and 20 deletions
|
|
@ -33,9 +33,10 @@ let
|
||||||
ERRMAIL
|
ERRMAIL
|
||||||
'';
|
'';
|
||||||
|
|
||||||
onFailureUnits =
|
onFailureUnits = [
|
||||||
[ "email@%n.service" ]
|
"email@%n.service"
|
||||||
++ optionals (cfg.ntfy.tokenFile != null) [ "ntfy-failure@%n.service" ];
|
]
|
||||||
|
++ optionals (cfg.ntfy.tokenFile != null) [ "ntfy-failure@%n.service" ];
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options = {
|
options = {
|
||||||
|
|
@ -103,21 +104,25 @@ in
|
||||||
systemd.services."ntfy-failure@" = {
|
systemd.services."ntfy-failure@" = {
|
||||||
description = "Send ntfy notification on service failure";
|
description = "Send ntfy notification on service failure";
|
||||||
onFailure = mkForce [ ];
|
onFailure = mkForce [ ];
|
||||||
|
unitConfig = {
|
||||||
|
StartLimitIntervalSec = "5m";
|
||||||
|
StartLimitBurst = 1;
|
||||||
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
ExecStart = pkgs.writeShellScript "ntfy-failure-notify" ''
|
|
||||||
TOKEN=$(cat ${cfg.ntfy.tokenFile})
|
|
||||||
UNIT="$1"
|
|
||||||
${pkgs.curl}/bin/curl -s \
|
|
||||||
-H "Authorization: Bearer $TOKEN" \
|
|
||||||
-H "Title: Service failed: $UNIT" \
|
|
||||||
-H "Priority: urgent" \
|
|
||||||
-H "Tags: rotating_light" \
|
|
||||||
-d "$(systemctl status --full "$UNIT" 2>&1 | head -40)" \
|
|
||||||
${cfg.ntfy.url}/${cfg.ntfy.topic}
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
scriptArgs = "%I";
|
script = ''
|
||||||
|
TOKEN=$(cat ${cfg.ntfy.tokenFile})
|
||||||
|
UNIT="$1"
|
||||||
|
${pkgs.curl}/bin/curl -s \
|
||||||
|
-H "Authorization: Bearer $TOKEN" \
|
||||||
|
-H "Title: Service failed: $UNIT" \
|
||||||
|
-H "Priority: urgent" \
|
||||||
|
-H "Tags: rotating_light" \
|
||||||
|
-d "$(systemctl status --full "$UNIT" 2>&1 | head -40)" \
|
||||||
|
${cfg.ntfy.url}/${cfg.ntfy.topic}
|
||||||
|
'';
|
||||||
|
scriptArgs = "%i";
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,10 @@ final: prev: {
|
||||||
gemini-cli
|
gemini-cli
|
||||||
opencode
|
opencode
|
||||||
tailscale
|
tailscale
|
||||||
#claude-code
|
claude-code
|
||||||
qwen-code
|
qwen-code
|
||||||
llama-cpp-rocm
|
llama-cpp-rocm
|
||||||
|
direnv
|
||||||
# open-webui
|
# open-webui
|
||||||
# vscode
|
# vscode
|
||||||
# nodejs_20
|
# nodejs_20
|
||||||
|
|
@ -21,7 +22,7 @@ final: prev: {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
# goose-cli = channels.unstable.callPackage ./goose.nix { };
|
# goose-cli = channels.unstable.callPackage ./goose.nix { };
|
||||||
claude-code = channels.unstable.callPackage ./claude-code/package.nix { };
|
# claude-code = channels.unstable.callPackage ./claude-code/package.nix { };
|
||||||
# gemini-cli = channels.unstable.callPackage ./gemini-cli/package.nix { };
|
# gemini-cli = channels.unstable.callPackage ./gemini-cli/package.nix { };
|
||||||
# vscode-extensions = channels.unstable.vscode-extensions // {
|
# vscode-extensions = channels.unstable.vscode-extensions // {
|
||||||
# rooveterinaryinc = { roo-cline = channels.unstable.callPackage ./roo-code.nix { }; };
|
# rooveterinaryinc = { roo-cline = channels.unstable.callPackage ./roo-code.nix { }; };
|
||||||
|
|
|
||||||
|
|
@ -36,13 +36,10 @@ with lib.metacfg;
|
||||||
environment.systemPackages = with pkgs; [
|
environment.systemPackages = with pkgs; [
|
||||||
attic-client
|
attic-client
|
||||||
claude-code
|
claude-code
|
||||||
dnsmasq
|
|
||||||
gh
|
gh
|
||||||
imagemagick
|
imagemagick
|
||||||
libvirt
|
|
||||||
nodejs
|
nodejs
|
||||||
qemu
|
qemu
|
||||||
virt-manager
|
|
||||||
sox
|
sox
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue