nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

hyperv-daemons: use python3 for kernels that support it

Support for python3 was added in https://github.com/torvalds/linux/commit/8a99c920092f444cf9f1d737ae76527102886d8e
it is therefore supported in every kernel including and after 4.19

ajs124 698bf970 e223f84c

+3 -6
+3 -6
pkgs/os-specific/linux/hyperv-daemons/default.nix
··· 1 - { stdenv, lib, python, kernel, makeWrapper, writeText 1 + { stdenv, lib, python2, python3, kernel, makeWrapper, writeText 2 2 , gawk, iproute2 }: 3 3 4 4 let ··· 9 9 inherit (kernel) src version; 10 10 11 11 nativeBuildInputs = [ makeWrapper ]; 12 + buildInputs = [ (if lib.versionOlder version "4.19" then python2 else python3) ]; 12 13 13 14 # as of 4.9 compilation will fail due to -Werror=format-security 14 15 hardeningDisable = [ "format" ]; ··· 33 32 install -Dm755 lsvmbus $out/bin/lsvmbus 34 33 install -Dm755 hv_get_dhcp_info.sh $out/${libexec}/hv_get_dhcp_info 35 34 install -Dm755 hv_get_dns_info.sh $out/${libexec}/hv_get_dns_info 36 - 37 - # I don't know why this isn't being handled automatically by fixupPhase 38 - substituteInPlace $out/bin/lsvmbus \ 39 - --replace '/usr/bin/env python' ${python.interpreter} 40 35 41 36 runHook postInstall 42 37 ''; ··· 83 86 Wants=hv-fcopy.service hv-kvp.service hv-vss.service 84 87 EOF 85 88 86 - for f in $lib/lib/systemd/system/* ; do 89 + for f in $lib/lib/systemd/system/*.service ; do 87 90 substituteInPlace $f --replace @out@ ${daemons}/bin 88 91 done 89 92