Merge pull request #332346 from MatthewCash/fix/hyperv-deamons-fcopy

hyperv-daemons: fix fcopy build and nixfmt-rfc-style

authored by Masum Reza and committed by GitHub 34146ed1 1a51b7b8

+36 -10
+36 -10
pkgs/os-specific/linux/hyperv-daemons/default.nix
··· 1 - { stdenv, lib, python2, python3, kernel, makeWrapper, writeText 2 - , gawk, iproute2 }: 3 4 let 5 libexec = "libexec/hypervkvpd"; 6 7 daemons = stdenv.mkDerivation rec { 8 pname = "hyperv-daemons-bin"; ··· 26 installPhase = '' 27 runHook preInstall 28 29 - for f in fcopy kvp vss ; do 30 install -Dm755 hv_''${f}_daemon -t $out/bin 31 done 32 ··· 39 40 postFixup = '' 41 wrapProgram $out/bin/hv_kvp_daemon \ 42 - --prefix PATH : $out/bin:${lib.makeBinPath [ gawk iproute2 ]} 43 ''; 44 }; 45 46 - service = bin: title: check: 47 writeText "hv-${bin}.service" '' 48 [Unit] 49 Description=Hyper-V ${title} daemon ··· 61 WantedBy=hyperv-daemons.target 62 ''; 63 64 - in stdenv.mkDerivation { 65 pname = "hyperv-daemons"; 66 inherit (kernel) version; 67 68 # we just stick the bins into out as well as it requires "out" 69 - outputs = [ "bin" "lib" "out" ]; 70 71 buildInputs = [ daemons ]; 72 73 buildCommand = '' 74 system=$lib/lib/systemd/system 75 76 - install -Dm444 ${service "fcopy" "file copy (FCOPY)" "hv_fcopy" } $system/hv-fcopy.service 77 - install -Dm444 ${service "kvp" "key-value pair (KVP)" "hv_kvp" } $system/hv-kvp.service 78 - install -Dm444 ${service "vss" "volume shadow copy (VSS)" "hv_vss" } $system/hv-vss.service 79 80 cat > $system/hyperv-daemons.target <<EOF 81 [Unit]
··· 1 + { 2 + stdenv, 3 + lib, 4 + python2, 5 + python3, 6 + kernel, 7 + makeWrapper, 8 + writeText, 9 + gawk, 10 + iproute2, 11 + }: 12 13 let 14 libexec = "libexec/hypervkvpd"; 15 + 16 + fcopy_name = (if lib.versionOlder kernel.version "6.10" then "fcopy" else "fcopy_uio"); 17 18 daemons = stdenv.mkDerivation rec { 19 pname = "hyperv-daemons-bin"; ··· 37 installPhase = '' 38 runHook preInstall 39 40 + for f in ${fcopy_name} kvp vss ; do 41 install -Dm755 hv_''${f}_daemon -t $out/bin 42 done 43 ··· 50 51 postFixup = '' 52 wrapProgram $out/bin/hv_kvp_daemon \ 53 + --prefix PATH : $out/bin:${ 54 + lib.makeBinPath [ 55 + gawk 56 + iproute2 57 + ] 58 + } 59 ''; 60 }; 61 62 + service = 63 + bin: title: check: 64 writeText "hv-${bin}.service" '' 65 [Unit] 66 Description=Hyper-V ${title} daemon ··· 78 WantedBy=hyperv-daemons.target 79 ''; 80 81 + in 82 + stdenv.mkDerivation { 83 pname = "hyperv-daemons"; 84 inherit (kernel) version; 85 86 # we just stick the bins into out as well as it requires "out" 87 + outputs = [ 88 + "bin" 89 + "lib" 90 + "out" 91 + ]; 92 93 buildInputs = [ daemons ]; 94 95 buildCommand = '' 96 system=$lib/lib/systemd/system 97 98 + install -Dm444 ${ 99 + service "${ 100 + fcopy_name 101 + }" "file copy (FCOPY)" "/sys/bus/vmbus/devices/eb765408-105f-49b6-b4aa-c123b64d17d4/uio" 102 + } $system/hv-fcopy.service 103 + install -Dm444 ${service "kvp" "key-value pair (KVP)" "hv_kvp"} $system/hv-kvp.service 104 + install -Dm444 ${service "vss" "volume shadow copy (VSS)" "hv_vss"} $system/hv-vss.service 105 106 cat > $system/hyperv-daemons.target <<EOF 107 [Unit]