nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 fetchgit,
4 lib,
5 dtc,
6}:
7
8stdenv.mkDerivation {
9 pname = "kvmtool";
10 version = "0-unstable-2024-04-09";
11
12 src = fetchgit {
13 url = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git";
14 rev = "da4cfc3e540341b84c4bbad705b5a15865bc1f80";
15 hash = "sha256-05tNsZauOXe1L1y1YchzvLZm3xOctPJhHCjyAyRnwy4=";
16 };
17
18 patches = [ ./strlcpy-glibc-2.38-fix.patch ];
19
20 buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [ dtc ];
21
22 enableParallelBuilding = true;
23
24 makeFlags = [
25 "prefix=${placeholder "out"}"
26 "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
27 "ARCH=${stdenv.hostPlatform.linuxArch}"
28 ]
29 ++ lib.optionals stdenv.hostPlatform.isAarch64 [
30 "LIBFDT_DIR=${dtc}/lib"
31 ];
32
33 meta = {
34 description = "Lightweight tool for hosting KVM guests";
35 homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/tree/README";
36 license = lib.licenses.gpl2Only;
37 maintainers = with lib.maintainers; [
38 astro
39 mfrw
40 peigongdsd
41 ];
42 platforms = [
43 "x86_64-linux"
44 "aarch64-linux"
45 ];
46 mainProgram = "lkvm";
47 };
48}