about summary refs log tree commit diff
path: root/pkgs/applications/virtualization
diff options
context:
space:
mode:
authorArthur Gautier <arthur.gautier@arista.com>2022-08-31 20:06:54 -0700
committerArthur Gautier <arthur.gautier@arista.com>2022-09-01 18:57:30 -0700
commit22bedaa70914039d6e0ed65111bc6f879bfcbeff (patch)
tree036fff43a836ce15b6c63ec78b83fca37ddb317a /pkgs/applications/virtualization
parent9c48988907a45f28f6e042e30cac4a79ef8be117 (diff)
ovmfvartool: init at unstable-2021-06-16
Diffstat (limited to 'pkgs/applications/virtualization')
-rw-r--r--pkgs/applications/virtualization/ovmfvartool/default.nix33
1 files changed, 33 insertions, 0 deletions
diff --git a/pkgs/applications/virtualization/ovmfvartool/default.nix b/pkgs/applications/virtualization/ovmfvartool/default.nix
new file mode 100644
index 0000000000000..dc140254ca2ab
--- /dev/null
+++ b/pkgs/applications/virtualization/ovmfvartool/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenvNoCC, fetchFromGitHub, python3 }:
+
+stdenvNoCC.mkDerivation rec {
+  name = "ovmfvartool";
+  version = "unstable-2021-06-16";
+
+  src = fetchFromGitHub {
+    owner = "hlandau";
+    repo = name;
+    rev = "c4c0c24dce1d201f95dfd69fd7fd9d51ea301377";
+    hash = "sha256-3OvYAB41apPn1c2YTKBIEITmHSUMQ0oEijY5DhZWWGo=";
+  };
+
+  postPatch = let
+    pythonPkg = python3.withPackages (p: with p; [ pyyaml ]);
+  in ''
+    # needed in build but /usr/bin/env is not available in sandbox
+    substituteInPlace ovmfvartool \
+      --replace "/usr/bin/env python3" "${pythonPkg.interpreter}"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install -m 755 ovmfvartool $out/bin/
+  '';
+
+  meta = with lib; {
+    description = "Parse and generate OVMF_VARS.fd from Yaml";
+    homepage = "https://github.com/hlandau/ovmfvartool";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ baloo raitobezarius ];
+  };
+}