Skip to content

Commit 80bddbd

Browse files
Add option to configure TimeoutSec for vms (#353)
* added option to configure startupTimeout for vms * fix: error: undefined variable 'int' * Update nixos-modules/host/options.nix * Apply suggestions from code review --------- Co-authored-by: Sandro <[email protected]>
1 parent 453d705 commit 80bddbd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

nixos-modules/host/default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ in
241241
WorkingDirectory = "${stateDir}/%i";
242242
ExecStart = "${stateDir}/%i/current/bin/microvm-run";
243243
ExecStop = "${stateDir}/%i/booted/bin/microvm-shutdown";
244-
TimeoutSec = 150;
244+
TimeoutSec = config.microvm.host.startupTimeout;
245245
Restart = "always";
246246
RestartSec = "5s";
247247
User = user;

nixos-modules/host/options.nix

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
Whether to enable the microvm.nix host module.
1010
'';
1111
};
12+
host.startupTimeout = mkOption {
13+
description = "Start up timeout for the VMs in seconds";
14+
type = types.ints.positive;
15+
default = 150;
16+
};
1217

1318
host.useNotifySockets = mkOption {
1419
type = types.bool;

0 commit comments

Comments
 (0)