diff --git a/nixos-modules/host/default.nix b/nixos-modules/host/default.nix index b6f61ce..b15dc1b 100644 --- a/nixos-modules/host/default.nix +++ b/nixos-modules/host/default.nix @@ -281,7 +281,7 @@ in --socket-group=${config.users.users.microvm.group} \ --shared-dir "$SOURCE" \ --rlimit-nofile ${toString serviceConfig.LimitNOFILE} \ - --thread-pool-size `nproc` \ + --thread-pool-size ${toString config.microvm.virtiofsd.threadPoolSize} \ --posix-acl --xattr \ ${lib.optionalString (config.microvm.virtiofsd.inodeFileHandles != null) "--inode-file-handles=${config.microvm.virtiofsd.inodeFileHandles}" diff --git a/nixos-modules/host/options.nix b/nixos-modules/host/options.nix index c3747ec..d9d4dd7 100644 --- a/nixos-modules/host/options.nix +++ b/nixos-modules/host/options.nix @@ -170,6 +170,15 @@ ''; }; + virtiofsd.threadPoolSize = mkOption { + type = with types; oneOf [ str ints.unsigned ]; + default = "`nproc`"; + description = '' + The amounts of threads virtiofsd should spawn. This option also takes the special + string `\`nproc\`` which spawns as many threads as the host has cores. + ''; + }; + virtiofsd.extraArgs = mkOption { type = with types; listOf str; default = [];