idk
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
nix-build-mail = pkgs.writeShellScript "echo -e \"Content-Type: text/plain\\r\\nSubject: NixOS cache rebuild failed\\r\\n\\r\\nThe nix-rebuild-cache service failed at $(date).\" | sendmail jalle008@proton.me";
|
||||
in
|
||||
{
|
||||
# "https://cache.mjallen.dev"
|
||||
# "cache.mjallen.dev-1:IzFmKCd8/gggI6lcCXsW65qQwiCLGFFN9t9s2iw7Lvc="
|
||||
@@ -32,6 +35,7 @@
|
||||
gnugrep
|
||||
gnused
|
||||
openssh
|
||||
nix-build-mail
|
||||
];
|
||||
script = ''
|
||||
#!/usr/bin/env bash
|
||||
@@ -66,7 +70,7 @@
|
||||
if nix build .\#nixosConfigurations.steamdeck.config.system.build.toplevel --no-link; then
|
||||
echo "steamdeck built successfully at $(date)"
|
||||
git add .
|
||||
git commit -m "Dteamdeck Updates $(date)"
|
||||
git commit -m "Steamdeck Updates $(date)"
|
||||
else
|
||||
echo "steamdeck failed to build at $(date)"
|
||||
git reset --hard
|
||||
@@ -117,18 +121,10 @@
|
||||
echo "jallen-nas failed to build at $(date)"
|
||||
git reset --hard
|
||||
fi
|
||||
|
||||
# git push
|
||||
'';
|
||||
# Send an email on failure (optional)
|
||||
startPost = ''
|
||||
if [ $SERVICE_RESULT != "success" ]; then
|
||||
${pkgs.mailutils}/bin/mail -s "NixOS cache rebuild failed" jalle008@proton.me <<EOF
|
||||
The nix-rebuild-cache service failed at $(date).
|
||||
Please check the logs with: journalctl -u nix-rebuild-cache
|
||||
EOF
|
||||
fi
|
||||
'';
|
||||
onSuccess = [ "git push" ];
|
||||
# Send an email on failure
|
||||
# onFailure = [ "nix-build-mail" ];
|
||||
};
|
||||
|
||||
systemd.timers.nix-rebuild-cache = {
|
||||
|
||||
Reference in New Issue
Block a user