fix: update autoshutdown script on droppie
This commit is contained in:
parent
d8f7dcc2fc
commit
dfab06117a
|
@ -1,11 +1,11 @@
|
|||
{pkgs, ...}: let
|
||||
shutdownWaitMinutes = 10;
|
||||
shutdownScript = pkgs.writeShellScriptBin "shutdown-wait" ''
|
||||
ssh_login_active="$(ps aux | grep "sshd: yule" | grep -v grep)"
|
||||
ssh_login_active="$(${pkgs.procps}/bin/ps aux | ${pkgs.gnugrep}/bin/grep "sshd: yule" | ${pkgs.gnugrep}/bin/grep -v grep | ${pkgs.coreutils-full}/bin/wc -l)"
|
||||
|
||||
if [ -n "''${ssh_login_active}" ] && [ "''${ssh_login_active}" != "0" ]; then
|
||||
echo "There is still an active ssh connection"
|
||||
exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "WARNING: System will be shut down within the next ${builtins.toString shutdownWaitMinutes} minutes" | ${pkgs.util-linux}/bin/wall
|
||||
|
@ -26,7 +26,7 @@ in {
|
|||
systemd.timers."shutdown-after-backup" = {
|
||||
enable = true;
|
||||
timerConfig = {
|
||||
OnCalendar = "*-*-* 02..09:05,15,25,35,45,55:00 Etc/UTC";
|
||||
OnCalendar = "*-*-* 02..11:05,15,25,35,45,55:00 Etc/UTC";
|
||||
};
|
||||
wantedBy = ["timers.target"];
|
||||
partOf = ["shutdown-after-backup.service"];
|
||||
|
|
|
@ -17,22 +17,24 @@
|
|||
boot.kernelModules = ["kvm-amd"];
|
||||
boot.extraModulePackages = [];
|
||||
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-uuid/1dca9d02-555c-4b23-9450-8f3413fa7694";
|
||||
fsType = "xfs";
|
||||
};
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/1dca9d02-555c-4b23-9450-8f3413fa7694";
|
||||
fsType = "xfs";
|
||||
};
|
||||
|
||||
fileSystems."/boot" = {
|
||||
device = "/dev/disk/by-uuid/A24C-F252";
|
||||
fsType = "vfat";
|
||||
};
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/A24C-F252";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
fileSystems."/media/internal" = {
|
||||
device = "/dev/disk/by-uuid/5cf314a8-82f4-4037-a724-62d2ff226cff";
|
||||
fsType = "ext4";
|
||||
};
|
||||
fileSystems."/media/internal" =
|
||||
{ device = "/dev/disk/by-uuid/5cf314a8-82f4-4037-a724-62d2ff226cff";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
swapDevices = [{device = "/dev/disk/by-uuid/0203b641-280f-4a3d-971d-fd32a666c852";}];
|
||||
swapDevices =
|
||||
[ { device = "/dev/disk/by-uuid/0203b641-280f-4a3d-971d-fd32a666c852"; }
|
||||
];
|
||||
|
||||
powerManagement.cpuFreqGovernor = lib.mkDefault "ondemand";
|
||||
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
|
|
Loading…
Reference in a new issue