summary refs log tree commit diff
path: root/pkgs/tools/misc/rkvm
diff options
context:
space:
mode:
authorckie <git-525ff67@ckie.dev>2023-08-22 19:33:45 +0300
committerckie <git-525ff67@ckie.dev>2023-10-18 06:21:32 +0300
commit177e36be7fde6b81ac264521b1481af6370441d1 (patch)
tree82363e4a349cd532dc189b315451d2641603479a /pkgs/tools/misc/rkvm
parent18036c0be90f4e308ae3ebcab0e14aae0336fe42 (diff)
downloadnixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.tar
nixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.tar.gz
nixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.tar.bz2
nixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.tar.lz
nixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.tar.xz
nixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.tar.zst
nixpkgs-177e36be7fde6b81ac264521b1481af6370441d1.zip
rkvm: init at 0.5.1
Co-authored-by: Lin Jian <me@linj.tech>
Diffstat (limited to 'pkgs/tools/misc/rkvm')
-rw-r--r--pkgs/tools/misc/rkvm/default.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/pkgs/tools/misc/rkvm/default.nix b/pkgs/tools/misc/rkvm/default.nix
new file mode 100644
index 00000000000..073df38ed39
--- /dev/null
+++ b/pkgs/tools/misc/rkvm/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, fetchFromGitHub
+, rustPlatform
+, pkg-config
+, libevdev
+, openssl
+, makeWrapper
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rkvm";
+  version = "0.5.1";
+
+  src = fetchFromGitHub {
+    owner = "htrefil";
+    repo = pname;
+    rev = version;
+    hash = "sha256-3IdwBMN+VZBrcoT5vF7pF6xoNWZBn4k/jRJqADlpM7k=";
+  };
+
+  cargoHash = "sha256-/SZKJI4gMkike2m8UVzbwfMqj697A8zbJEKAnnbSx3s=";
+
+  nativeBuildInputs = [ pkg-config rustPlatform.bindgenHook makeWrapper ];
+  buildInputs = [ libevdev ];
+
+  postInstall = ''
+    install -Dm444 -t "$out/lib/systemd/system" systemd/rkvm-*.service
+    install -Dm444 example/server.toml "$out/etc/rkvm/server.example.toml"
+    install -Dm444 example/client.toml "$out/etc/rkvm/client.example.toml"
+
+    wrapProgram $out/bin/rkvm-certificate-gen --prefix PATH : ${lib.makeBinPath [ openssl ]}
+  '';
+
+  meta = with lib; {
+    description = "Virtual KVM switch for Linux machines";
+    homepage = "https://github.com/htrefil/rkvm";
+    changelog = "https://github.com/htrefil/rkvm/releases/tag/${version}";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ckie ];
+  };
+}