From 840af567fb08f9bd3e05f1daa951b89340709e77 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Fri, 18 Oct 2024 21:43:43 +0200 Subject: [PATCH] nixos/libvirt: fix shellcheck findings with enableStrictShellChecks enabled Signed-off-by: Sefa Eyeoglu --- nixos/modules/virtualisation/libvirtd.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 195c5259a324..35f5c4070b5a 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -426,9 +426,11 @@ in libvirt/qemu/networks/*.xml \ libvirt/nwfilter/*.xml ); do - mkdir -p /var/lib/$(dirname $i) -m 755 - if [ ! -e /var/lib/$i ]; then - cp -pd ${cfg.package}/var/lib/$i /var/lib/$i + # Intended behavior + # shellcheck disable=SC2174 + mkdir -p "/var/lib/$(dirname "$i")" -m 755 + if [ ! -e "/var/lib/$i" ]; then + cp -pd "${cfg.package}/var/lib/$i" "/var/lib/$i" fi done @@ -440,9 +442,7 @@ in ln -s --force "$emulator" /run/${dirName}/nix-emulators/ done - for helper in bin/qemu-pr-helper; do - ln -s --force ${cfg.qemu.package}/$helper /run/${dirName}/nix-helpers/ - done + ln -s --force ${cfg.qemu.package}/bin/qemu-pr-helper /run/${dirName}/nix-helpers/ ${optionalString cfg.qemu.ovmf.enable (let ovmfpackage = pkgs.buildEnv {