snapshot pre-autoupdate-2026-07-26T12-32-47Z

This commit is contained in:
2026-07-26 14:32:47 +02:00
parent ba4f2b5bf2
commit a9874f1b2a
5 changed files with 27 additions and 16 deletions
+5 -2
View File
@@ -6,8 +6,11 @@
age.identityPaths = [
"/home/tomasr/.ssh/id_ed25519"
];
age.secrets.my-secret = {
file = ../../secrets/my-secret.age;
age.secrets.ntfy = {
file = ../../secrets/ntfy.age;
owner = "tomasr";
group = "users";
mode = "0400";
};
};
}
+21 -8
View File
@@ -1,5 +1,8 @@
{self, ...}: {
flake.nixosModules.autoUpdate-laptop = {pkgs, ...}: {
flake.nixosModules.autoUpdate-laptop = {pkgs, config, ...}: {
age.secrets.ntfy = {
file = ../../secrets/ntfy.age;
};
# Ensure your script is available system-wide
environment.systemPackages = [
self.packages.${pkgs.system}.custom-autoupdate-laptop
@@ -12,6 +15,9 @@
description = "NixOS flake auto update";
serviceConfig = {
Environment = [
"NTFY_SECRET=${config.age.secrets.ntfy.path}"
];
Type = "oneshot";
ExecStart = "/run/current-system/sw/bin/custom-autoupdate";
@@ -98,11 +104,13 @@
runtimeInputs = with pkgs; [
git
nixos-rebuild
matrix-commander-rs
curl
libnotify
];
text = ''
# shellcheck disable=SC1090
source "$NTFY_SECRET"
set -e
FLAKE_DIR="/home/tomasr/nixos"
@@ -128,9 +136,11 @@
notify-send "Flake autoupdate" "Rebuild OK"
matrix-commander-rs --verbose -m "Flake rebuild succesfull.<br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
curl \
-u ":$NTFY_TOKEN" \
-d "Flake rebuild successful" \
-H "Title: Flake autoupdate" \
"$NTFY_SERVER/Alerts"
else
notify-send "Flake autoupdate" "No changes"
git -C "$FLAKE_DIR" push
@@ -141,9 +151,12 @@
notify-send -u critical "Flake autoupdate" "FAILED"
matrix-commander-rs --verbose -m "Flake rebuild failed.<br>Error: <pre>$ERROR_MSG</pre><br><a href=\"https://matrix.to/#/@notificationbot_0000:matrix.org\">@notificationbot_0000</a>" \
--html \
-r "\!BXRRokBmEdNOyYdfOF:matrix.org"
curl \
-u ":$NTFY_TOKEN" \
-d "Flake rebuild failed. Error: $ERROR_MSG" \
-H "Title: Flake autoupdate FAILED" \
-H "Priority: urgent" \
"$NTFY_SERVER/Alerts"
git -C "$FLAKE_DIR" reset --hard "pre-autoupdate-$TIME"
fi
-5
View File
@@ -1,5 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 pcPqbA GG04OY1WKDS1Rc1aRhODZShiWZfdw0cDHN+s/8XqDzA
9/SS7ZOQDh1H+27JT7fTi3GV5C19CjIPR9i4jjKjM9E
--- Irxkq9bamw6q0qsEZHlym6pC0gDxpty+bbg14OAgkxQ
ëĶ‘²ó<…¥ ɨ¬!†K!þ‘L;Ú~´]¶F ñ»Ak‰õwÐy62ϽK<B{P=,@q-WÑUUh|c]ZÝœsR‰²›¨3%[â´¾eC WË2M#ìõ3ìSÇ␍pû˜³tZEtbK4{×Ñ¡bÄ3QuhzȘ(òË ¬%¹ZÒ»@ÇI[£_².˜ð
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -2,7 +2,7 @@ let
myKey = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIC6WNm4YAQO85j0aNQkKSH7QnmhgzKA4hA2ggi6cDyKk tomasr@nixos";
in
{
"my-secret.age".publicKeys = [
"ntfy.age".publicKeys = [
myKey
];
}