libvirt: fix virt-secret-init-encryption (#496839)

This commit is contained in:
Pascal Bach
2026-03-06 10:44:06 +00:00
committed by GitHub
2 changed files with 23 additions and 2 deletions
+4 -1
View File
@@ -530,7 +530,10 @@ in
"nix-helpers"
"nix-ovmf"
];
StateDirectory = subDirs [ "dnsmasq" ];
StateDirectory = subDirs [
"dnsmasq"
"secrets"
];
};
};
+19 -1
View File
@@ -33,11 +33,13 @@
python3,
readline,
rpcsvc-proto,
runtimeShell,
stdenv,
replaceVars,
xhtml1,
json_c,
writeScript,
writeShellApplication,
nixosTests,
# Linux
@@ -180,7 +182,23 @@ stdenv.mkDerivation rec {
sed -i '/libxlxml2domconfigtest/d' tests/meson.build
substituteInPlace src/libxl/libxl_capabilities.h \
--replace-fail /usr/lib/xen ${xen}/libexec/xen
'';
''
+ lib.optionalString isLinux (
let
script = writeShellApplication {
name = "virt-secret-init-encryption-sh";
runtimeInputs = [
coreutils
systemd
];
text = ''exec ${runtimeShell} "$@"'';
};
in
''
substituteInPlace src/secret/virt-secret-init-encryption.service.in \
--replace-fail /usr/bin/sh ${lib.getExe script}
''
);
strictDeps = true;