Compare commits
No commits in common. "b1cd6018baad1dd73e8d10cd6be0b633e8682b47" and "00bf70b29ae0e7c801c9b2e3128751afefe35012" have entirely different histories.
b1cd6018ba
...
00bf70b29a
|
@ -119,7 +119,6 @@ in
|
|||
gitPull = true;
|
||||
gitDeploymentKeyFile = "/secrets/ssh_id_gitea_nixos_configuration";
|
||||
gitUser = "fruchti";
|
||||
rebootIgnoreUsersActive = [ "waldi" ];
|
||||
};
|
||||
|
||||
# systemd.services.nixos-upgrade.onFailure = lib.mkIf config.system.autoUpgrade.enable [ "status-email@%n.service" ];
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
"Berthold"
|
||||
"Ernesto"
|
||||
"Emitter"
|
||||
"Adelheid"
|
||||
]);
|
||||
superClients = [
|
||||
config.networking.hostName
|
||||
|
|
|
@ -36,13 +36,6 @@ in
|
|||
User used for the `git pull` operation (if `gitPull` is enabled).
|
||||
'';
|
||||
};
|
||||
rebootIgnoreUsersActive = mkOption {
|
||||
type = types.listOf types.str;
|
||||
default = [];
|
||||
description = mdDoc ''
|
||||
If reboots are allowed, active users will prohibit a reboot. Users listed here are ignored from that check.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -163,14 +156,6 @@ in
|
|||
EOF
|
||||
)"
|
||||
activate_configuration="no"
|
||||
|
||||
# Check if any user sessions are open
|
||||
active_users=$(users | tr ' ' '\n' | sort | uniq | grep -vE '^(${concatStringsSep "|" cfg.rebootIgnoreUsersActive})$')
|
||||
if [ "$reboot_allowed" = "yes" ] && [ -n "$active_users" ] ; then
|
||||
reboot_allowed=no
|
||||
email_body="$(printf "%s\n%s\n%s" "$email_body" "The system cannot reboot since the following users are active:" "$active_users")"
|
||||
fi
|
||||
|
||||
if [ "$reboot_allowed" = "yes" ] && [ $exit_code -eq 0 ] ; then
|
||||
email_body="$(printf "%s\n%s" "$email_body" "The system will reboot now.")"
|
||||
do_reboot="yes"
|
||||
|
|
Loading…
Reference in a new issue