summaryrefslogtreecommitdiff
path: root/modules/nixos/personal
diff options
context:
space:
mode:
authorquentin@aristote.fr <quentin@aristote.fr>2025-03-18 07:25:37 +0100
committerquentin@aristote.fr <quentin@aristote.fr>2025-03-18 07:25:37 +0100
commitf65812bf74004cfc8cd7751a33ccba8bf18d3b68 (patch)
tree8d8ebd0358dc19dd8f03eeacbec9d2f8c6f3df82 /modules/nixos/personal
parenta0a36d283ad284e9c715bb9ffb6849e1a9e80e14 (diff)
nixos: autoUpgrade: disable timeouts when rebooting
Diffstat (limited to 'modules/nixos/personal')
-rw-r--r--modules/nixos/personal/nix.nix14
1 files changed, 10 insertions, 4 deletions
diff --git a/modules/nixos/personal/nix.nix b/modules/nixos/personal/nix.nix
index 0ecc459..abe291b 100644
--- a/modules/nixos/personal/nix.nix
+++ b/modules/nixos/personal/nix.nix
@@ -158,12 +158,18 @@ in {
lib.mkIf (cryptExists && config.system.autoUpgrade.allowReboot) {
path = [pkgs.cryptsetup];
script = lib.mkAfter ''
- cryptsetup --verbose luksAddKey --key-file /etc/luks/keys/master ${cryptCfg.device} /etc/luks/keys/tmp
+ if [ "$do_reboot" ]
+ then
+ cryptsetup --verbose luksAddKey --key-file /etc/luks/keys/master ${cryptCfg.device} /etc/luks/keys/tmp
+ fi
'';
+ serviceConfig.TimeoutStopSec = "infinity";
postStop = ''
- # if a reboot due to nixos-upgrade happens, it should occur within a minute
- sleep 120
- # if no reboot has happened, disable any leftover keyfile
+ # if a reboot due to nixos-upgrade happens,
+ # it should occur within a minute
+ sleep 60
+ # if no reboot has happened,
+ # disable any leftover keyfile
while cryptsetup --verbose luksRemoveKey ${cryptCfg.device} --key-file /etc/luks/keys/tmp
do
: