summary refs log tree commit diff
path: root/pkgs/os-specific/linux/spectrum/spectrum-vm/default.nix
blob: c56d2537c63768fafce140d39adc79ada7cb1881 (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
35
{ stdenv, lib, makeWrapper, utillinux, crosvm, linux, sys-vms }:

stdenv.mkDerivation {
  name = "spectrum-vm";

  src = ./spectrum-vm.in;

  nativeBuildInputs = [ makeWrapper ];

  unpackPhase = ''
    cp $src spectrum-vm.in
  '';

  configurePhase = ''
    substituteAll spectrum-vm.in spectrum-vm
    chmod +x spectrum-vm
  '';

  getopt = "${lib.getBin utillinux}/bin/getopt";
  crosvm = "${lib.getBin crosvm}/bin/crosvm";
  kernel = "${sys-vms.comp.linux}/bzImage";
  rootfs = sys-vms.comp.rootfs.squashfs;

  installPhase = ''
    mkdir -p $out/bin
    cp spectrum-vm $out/bin
  '';

  meta = with lib; {
    description = "Utility for testing Spectrum VM components";
    maintainers = with maintainers; [ qyliss ];
    license = licenses.gpl3Plus;
    inherit (crosvm.meta) platforms;
  };
}