nixpkgs/pkgs/applications/virtualization/driver/win-qemu/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

39 lines
1.4 KiB
Nix

{ lib, stdenv, fetchurl, p7zip }:
stdenv.mkDerivation {
name = "win-qemu-0.1.105-1";
version = "0.1.105-1";
phases = [ "buildPhase" "installPhase" ];
src = fetchurl {
url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.105-1/virtio-win.iso";
sha256 = "065gz7s77y0q9kfqbr27451sr28rm9azpi88sqjkfph8c6r8q3wc";
};
buildPhase = ''
${p7zip}/bin/7z x $src
'';
installPhase =
let
copy_pvpanic = arch: version: "mkdir -p $out/${arch}/qemupanic; cp pvpanic/${version}/${arch}/* $out/${arch}/qemupanic/. \n";
copy_pciserial = arch: "mkdir -p $out/${arch}/qemupciserial; cp qemupciserial/* $out/${arch}/qemupciserial/. \n";
copy_agent = arch: ''
mkdir -p $out/${arch}/qemuagent
cp guest-agent/${if arch=="x86" then "qemu-ga-x86.msi" else "qemu-ga-x64.msi"} $out/${arch}/qemuagent/qemu-guest-agent.msi
(cd $out/${arch}/qemuagent; ${p7zip}/bin/7z x qemu-guest-agent.msi; rm qemu-guest-agent.msi)
'';
copy = arch: version: (copy_pvpanic arch version) + (copy_pciserial arch) + (copy_agent arch);
in
(copy "amd64" "w8.1") + (copy "x86" "w8.1");
meta = with lib; {
description = "Windows QEMU Drivers";
homepage = "https://fedoraproject.org/wiki/Windows_Virtio_Drivers";
maintainers = [ maintainers.tstrobel ];
platforms = platforms.linux;
license = licenses.gpl2;
};
}