summary refs log tree commit diff
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorMartin Schwaighofer <mschwaig@users.noreply.github.com>2021-06-06 12:45:40 +0200
committerAlyssa Ross <hi@alyssa.is>2021-11-30 13:06:22 +0000
commit5d06f6933d5373f9f4c4ea63d03029869855f876 (patch)
tree912d01ed49153482f0443aa4dc6833469ddb1ae5 /pkgs/applications/virtualization
parentf57e1a4dab4d7a9f350232db85f4ed4883d6a784 (diff)
downloadnixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.tar
nixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.tar.gz
nixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.tar.bz2
nixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.tar.lz
nixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.tar.xz
nixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.tar.zst
nixpkgs-5d06f6933d5373f9f4c4ea63d03029869855f876.zip
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.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
index 93a215f1003..7e89871786d 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
   '';