nixos/qemu-vm: add option to specify security model to use for a shared directory

This commit is contained in:
Anders Johan Jamtli 2024-02-09 07:12:44 +01:00
parent c65ffe3f17
commit 777f5b67c2
No known key found for this signature in database

View File

@ -250,7 +250,7 @@ let
${concatStringsSep " " config.virtualisation.qemu.networkingOptions} \
${concatStringsSep " \\\n "
(mapAttrsToList
(tag: share: "-virtfs local,path=${share.source},security_model=none,mount_tag=${tag}")
(tag: share: "-virtfs local,path=${share.source},security_model=${share.securityModel},mount_tag=${tag}")
config.virtualisation.sharedDirectories)} \
${drivesCmdLine config.virtualisation.qemu.drives} \
${concatStringsSep " \\\n " config.virtualisation.qemu.options} \
@ -474,6 +474,11 @@ in
type = types.path;
description = lib.mdDoc "The mount point of the directory inside the virtual machine";
};
options.securityModel = mkOption {
type = types.enum [ "passthrough" "mapped" "mapped-xattr" "mapped-file" "none" ];
default = "none";
description = lib.mdDoc "The security model to use for this share";
};
});
default = { };
example = {