auto-updater: rename systemd service from auto_updater to auto-updater #1129
No files matched your search
@@ -119,9 +119,9 @@
|
|||||||
systemd.services.boot-control = {
|
systemd.services.boot-control = {
|
||||||
description = "Boot Control Service - Check Home Assistant for Windows boot preference";
|
description = "Boot Control Service - Check Home Assistant for Windows boot preference";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
after = [ "network-online.target" "auto_updater.service" ];
|
after = [ "network-online.target" "auto-updater.service" ];
|
||||||
wants = [ "network-online.target" ];
|
wants = [ "network-online.target" ];
|
||||||
requires = [ "auto_updater.service" ];
|
requires = [ "auto-updater.service" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "oneshot";
|
||||||
RemainAfterExit = false;
|
RemainAfterExit = false;
|
||||||
|
|||||||
@@ -35,17 +35,17 @@ in
|
|||||||
"d ${location} 0755 root root - -"
|
"d ${location} 0755 root root - -"
|
||||||
];
|
];
|
||||||
|
|
||||||
systemd.timers.auto_updater = {
|
systemd.timers."auto-updater" = {
|
||||||
wantedBy = [ "timers.target" ];
|
wantedBy = [ "timers.target" ];
|
||||||
timerConfig = {
|
timerConfig = {
|
||||||
OnBootSec = "15m";
|
OnBootSec = "15m";
|
||||||
OnUnitInactiveSec = "60m";
|
OnUnitInactiveSec = "60m";
|
||||||
RandomizedDelaySec = "30m";
|
RandomizedDelaySec = "30m";
|
||||||
Unit = "auto_updater.service";
|
Unit = "auto-updater.service";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
systemd.services.auto_updater = {
|
systemd.services."auto-updater" = {
|
||||||
description = "Automatically update NixOS configuration if already on main.";
|
description = "Automatically update NixOS configuration if already on main.";
|
||||||
|
|
||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./auto_updater.nix
|
./auto-updater.nix
|
||||||
./backups
|
./backups
|
||||||
./chia.nix
|
./chia.nix
|
||||||
./compressed_ram.nix
|
./compressed_ram.nix
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ let
|
|||||||
exec sudo ${pkgs.runtimeShell} "$0" "$@"
|
exec sudo ${pkgs.runtimeShell} "$0" "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create lock file to prevent auto_updater from running
|
# Create lock file to prevent auto-updater from running
|
||||||
LOCK_FILE="/run/nixos-update.lock"
|
LOCK_FILE="/run/nixos-update.lock"
|
||||||
echo "Creating update lock file..."
|
echo "Creating update lock file..."
|
||||||
touch "$LOCK_FILE"
|
touch "$LOCK_FILE"
|
||||||
@@ -27,14 +27,14 @@ let
|
|||||||
# Set up trap to clean up lock file on exit
|
# Set up trap to clean up lock file on exit
|
||||||
trap 'echo "Cleaning up lock file..."; rm -f "$LOCK_FILE"' EXIT
|
trap 'echo "Cleaning up lock file..."; rm -f "$LOCK_FILE"' EXIT
|
||||||
|
|
||||||
# Wait for any currently running auto_updater service to stop
|
# Wait for any currently running auto-updater service to stop
|
||||||
if ${pkgs.systemd}/bin/systemctl is-active --quiet auto_updater.service; then
|
if ${pkgs.systemd}/bin/systemctl is-active --quiet auto-updater.service; then
|
||||||
echo "Waiting for auto_updater service to finish..."
|
echo "Waiting for auto-updater service to finish..."
|
||||||
while ${pkgs.systemd}/bin/systemctl is-active --quiet auto_updater.service; do
|
while ${pkgs.systemd}/bin/systemctl is-active --quiet auto-updater.service; do
|
||||||
sleep 15
|
sleep 15
|
||||||
echo "Still waiting for auto_updater to stop..."
|
echo "Still waiting for auto-updater to stop..."
|
||||||
done
|
done
|
||||||
echo "Auto_updater service has stopped."
|
echo "Auto-updater service has stopped."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
|
|||||||
Reference in new issue
Block a user