1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-25 03:17:13 +00:00
nixpkgs/pkgs/applications/virtualization/driver/win-virtio/default.nix
2021-01-15 14:24:03 +07:00

37 lines
1.2 KiB
Nix

{ lib, stdenv, fetchurl, p7zip }:
stdenv.mkDerivation rec {
pname = "win-virtio";
version = "0.1.141-1";
phases = [ "buildPhase" "installPhase" ];
src = fetchurl {
url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-${version}/virtio-win.iso";
sha256 = "0mn5gcgb9dk59nrw9scdza628yiji4vdkxmixikn9v02kgwnkja3";
};
buildPhase = ''
${p7zip}/bin/7z x $src
'';
installPhase =
let
copy = arch: version: {input, output}: "mkdir -p $out/${arch}/${output}; cp ${input}/${version}/${arch}/* $out/${arch}/${output}/.";
virtio = [{input="Balloon"; output="vioballoon";}
{input="NetKVM"; output="vionet";}
{input="vioscsi"; output="vioscsi";}
{input="vioserial"; output="vioserial";}
{input="viostor"; output="viostor";}
{input="viorng"; output="viorng";}
];
in
lib.concatStringsSep "\n" ((map (copy "amd64" "w8.1") virtio) ++ (map (copy "x86" "w8.1") virtio));
meta = with lib; {
description = "Windows VirtIO Drivers";
homepage = "https://fedoraproject.org/wiki/Windows_Virtio_Drivers";
maintainers = [ maintainers.tstrobel ];
platforms = platforms.linux;
};
}