summary refs log tree commit diff
path: root/pkgs/applications/virtualization/kvmtool/default.nix
blob: e7429f3312dacdee963ef87b8e4166f66ad61470 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ stdenv, fetchgit, lib, dtc }:

stdenv.mkDerivation {
  pname = "kvmtool";
  version = "unstable-2023-07-12";

  src = fetchgit {
    url = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git";
    rev = "106e2ea7756d980454d68631b87d5e25ba4e4881";
    sha256 = "sha256-wpc5DfHnui0lBVH4uOq6a7pXVUZStjNLRvauu6QpRvE=";
  };

  buildInputs = lib.optionals stdenv.hostPlatform.isAarch64 [ dtc ];

  enableParallelBuilding = true;

  makeFlags = [
    "prefix=${placeholder "out"}"
  ] ++ lib.optionals stdenv.hostPlatform.isAarch64 ([
    "LIBFDT_DIR=${dtc}/lib"
  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
    "CROSS_COMPILE=aarch64-unknown-linux-gnu-"
    "ARCH=arm64"
  ]);

  meta = with lib; {
    description = "A lightweight tool for hosting KVM guests";
    homepage = "https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git/tree/README";
    license = licenses.gpl2Only;
    maintainers = with maintainers; [ astro mfrw ];
    platforms = [ "x86_64-linux" "aarch64-linux" ];
    mainProgram = "lkvm";
  };
}