Platform Unstable #97

Merged
max merged 34 commits from platform-unstable into master 2024-06-07 00:17:36 +03:00
Showing only changes of commit 57c2e69397 - Show all commits

View file

@ -23,10 +23,10 @@ in
async = true; async = true;
deploy = { deploy = {
agents = callUpon hour; agents = callUpon hour;
rollbackScript = genAttrs systems (flip withSystem ({ pkgs, ... }: rollbackScript = genAttrs systems (flip withSystem ({ config, pkgs, ... }:
let let
scheduleReboot = pkgs.writeShellScript "schedule-reboot.sh" '' scheduleReboot = pkgs.writeShellScript "schedule-reboot.sh" ''
export PATH="${pkgs.consul}/bin:${pkgs.systemd}/bin:${pkgs.coreutils}/bin" export PATH="${config.packages.consul}/bin:${pkgs.systemd}/bin:${pkgs.coreutils}/bin"
currentTime=$(date +%s) currentTime=$(date +%s)
lastScheduledTime=$(consul kv get system/coordinated-reboot/last) lastScheduledTime=$(consul kv get system/coordinated-reboot/last)
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
@ -46,7 +46,7 @@ in
ScheduleShutdown st reboot ''${nextScheduledTime}000000 ScheduleShutdown st reboot ''${nextScheduledTime}000000
''; '';
in pkgs.writeShellScript "post-effect.sh" '' in pkgs.writeShellScript "post-effect.sh" ''
export PATH="${pkgs.consul}/bin:${pkgs.coreutils}/bin" export PATH="${config.packages.consul}/bin:${pkgs.coreutils}/bin"
if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /nix/var/nix/profiles/system/kernel)" ]]; then if [[ "$(realpath /run/booted-system/kernel)" != "$(realpath /nix/var/nix/profiles/system/kernel)" ]]; then
echo "Scheduling reboot for kernel upgrade" echo "Scheduling reboot for kernel upgrade"
if ! consul members >/dev/null; then if ! consul members >/dev/null; then