Skip to content

Commit bc24209

Browse files
committed
runner: make prettyProcnames configurable
1 parent 967216a commit bc24209

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

lib/runner.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ let
1919
preStart = hypervisorConfig.preStart or microvmConfig.preStart;
2020
tapMultiQueue = hypervisorConfig.tapMultiQueue or false;
2121

22+
execArg = lib.optionalString microvmConfig.prettyProcname
23+
''-a "microvm@${microvmConfig.hostName}"'';
24+
2225
runScriptBin = pkgs.buildPackages.writeScriptBin "microvm-run" ''
2326
#! ${pkgs.buildPackages.runtimeShell} -e
2427
2528
${preStart}
2629
${createVolumesScript pkgs.buildPackages microvmConfig.volumes}
2730
${lib.optionalString (hypervisorConfig.requiresMacvtapAsFds or false) openMacvtapFds}
2831
29-
exec -a "microvm-${microvmConfig.hostName}" ${command}
32+
exec ${execArg} ${command}
3033
'';
3134

3235
shutdownScriptBin = pkgs.buildPackages.writeScriptBin "microvm-shutdown" ''

nixos-modules/microvm/options.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ in
414414
description = "A Hypervisor's sandbox directory";
415415
};
416416

417+
prettyProcnames = mkOption {
418+
type = types.bool;
419+
default = true;
420+
description = ''
421+
Set a recognizable process name right before executing the Hyperisor.
422+
'';
423+
};
424+
417425
runner = mkOption {
418426
description = "Generated Hypervisor runner for this NixOS";
419427
type = with types; attrsOf package;

0 commit comments

Comments
 (0)