git.iko.soy/typeable/nixpkgs
on master help sign in
qemu: set localstatedir

Otherwise qemu-qa, qemu-pr-helper, and virtiofsd, try to write to $out/var at runtime. Fixes: https://github.com/NixOS/nixpkgs/issues/113909 Fixes: https://github.com/NixOS/nixpkgs/pull/112886

commit8e71416e5d4306c3800133ca6dc2ad4469480b90 authorAlyssa Ross <hi@alyssa.is> dateWed 10 Feb 2021, 20:48 (6 years ago) parentc2b66f2
1 file changed+7
pkgs/applications/virtualization/qemu/default.nix+7
pkgs/applications/virtualization/qemu/default.nix+7
@@ -101,6 +101,12 @@ stdenv.mkDerivation rec {
101101 })
102102 ];
103103
104+ # Otherwise tries to ensure /var/run exists.
105+ postPatch = ''
106+ sed -i "/install_subdir('run', install_dir: get_option('localstatedir'))/d" \
107+ qga/meson.build
108+ '';
109+
104110 preConfigure = ''
105111 unset CPP # intereferes with dependency calculation
106112 # this script isn't marked as executable b/c it's indirectly used by meson. Needed to patch its shebang
@@ -119,6 +125,7 @@ stdenv.mkDerivation rec {
119125 "--enable-docs"
120126 "--enable-tools"
121127 "--enable-guest-agent"
128+ "--localstatedir=/var"
122129 "--sysconfdir=/etc"
123130 ]
124131 ++ optional numaSupport "--enable-numa"