diff options
author | Martin Schwaighofer <mschwaig@users.noreply.github.com> | 2021-06-06 12:45:40 +0200 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-11-30 13:06:22 +0000 |
commit | 5d06f6933d5373f9f4c4ea63d03029869855f876 (patch) | |
tree | 912d01ed49153482f0443aa4dc6833469ddb1ae5 /pkgs/applications/virtualization | |
parent | f57e1a4dab4d7a9f350232db85f4ed4883d6a784 (diff) |
qemu, runInLinuxVM: fix KVM availability check
KVM should only be considered abailable if /dev/kvm exists and is read-writable by the user that is trying to launch it. The previous check for existance only had the consequence that on some Linux distributions running VMs with Nix's QEMU only worked if KVM was NOT installed. fixes #124371
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r-- | pkgs/applications/virtualization/qemu/default.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix index 93a215f1003b6..7e89871786d65 100644 --- a/pkgs/applications/virtualization/qemu/default.nix +++ b/pkgs/applications/virtualization/qemu/default.nix @@ -231,7 +231,7 @@ stdenv.mkDerivation rec { if [ -x $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} ]; then makeWrapper $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} \ $out/bin/qemu-kvm \ - --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)" + --add-flags "\$([ -r /dev/kvm -a -w /dev/kvm ] && echo -enable-kvm)" fi ''; |