summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2018-06-26 01:11:00 +0200
committerFranz Pletz <fpletz@fnordicwalking.de>2018-06-26 01:18:30 +0200
commit1d235be2086dde14050fc811dc37528dec301783 (patch)
treea1b930ad119a1ab38df7606893438d84b830100a
parent5d534c2663ad49f3dbdfffb27a2a550825980250 (diff)
downloadnixlib-1d235be2086dde14050fc811dc37528dec301783.tar
nixlib-1d235be2086dde14050fc811dc37528dec301783.tar.gz
nixlib-1d235be2086dde14050fc811dc37528dec301783.tar.bz2
nixlib-1d235be2086dde14050fc811dc37528dec301783.tar.lz
nixlib-1d235be2086dde14050fc811dc37528dec301783.tar.xz
nixlib-1d235be2086dde14050fc811dc37528dec301783.tar.zst
nixlib-1d235be2086dde14050fc811dc37528dec301783.zip
virtlyst: init at 1.1.0
Co-authored-by: elseym <elseym@me.com>
-rw-r--r--pkgs/servers/web-apps/virtlyst/add-admin-password-env.patch14
-rw-r--r--pkgs/servers/web-apps/virtlyst/default.nix32
-rw-r--r--pkgs/top-level/all-packages.nix2
3 files changed, 48 insertions, 0 deletions
diff --git a/pkgs/servers/web-apps/virtlyst/add-admin-password-env.patch b/pkgs/servers/web-apps/virtlyst/add-admin-password-env.patch
new file mode 100644
index 000000000000..e20acdb04a9e
--- /dev/null
+++ b/pkgs/servers/web-apps/virtlyst/add-admin-password-env.patch
@@ -0,0 +1,14 @@
+diff --git a/src/virtlyst.cpp b/src/virtlyst.cpp
+index acd195d..8809e4f 100644
+--- a/src/virtlyst.cpp
++++ b/src/virtlyst.cpp
+@@ -340,7 +340,8 @@ bool Virtlyst::createDB()
+         qCCritical(VIRTLYST) << "Error creating database" << query.lastError().text();
+         return false;
+     }
+-    const QString password = QString::fromLatin1(QUuid::createUuid().toRfc4122().toHex());
++    const QString password = qEnvironmentVariable("VIRTLYST_ADMIN_PASSWORD",
++            QString::fromLatin1(QUuid::createUuid().toRfc4122().toHex()));
+     query.bindValue(QStringLiteral(":password"), QString::fromLatin1(
+                         CredentialPassword::createPassword(password.toUtf8(), QCryptographicHash::Sha256, 10000, 16, 16)));
+     if (!query.exec()) {
diff --git a/pkgs/servers/web-apps/virtlyst/default.nix b/pkgs/servers/web-apps/virtlyst/default.nix
new file mode 100644
index 000000000000..c6245f9b40d2
--- /dev/null
+++ b/pkgs/servers/web-apps/virtlyst/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, autoPatchelfHook
+, qtbase, libvirt, cutelyst, grantlee }:
+
+stdenv.mkDerivation rec {
+  name = "virtlyst-${version}";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "cutelyst";
+    repo = "Virtlyst";
+    rev = "v${version}";
+    sha256 = "1rqv93dys666wsqbg1lvl3pjl8gpdx3dc3y71m3r8apalgr11ikw";
+  };
+
+  nativeBuildInputs = [ cmake pkgconfig autoPatchelfHook ];
+  buildInputs = [ qtbase libvirt cutelyst grantlee ];
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp src/libVirtlyst.so $out/lib
+    cp -r ../root $out
+  '';
+
+  patches = [ ./add-admin-password-env.patch ];
+
+  meta = with lib; {
+    description = "Web interface to manage virtual machines with libvirt";
+    homepage = https://github.com/cutelyst/Virtlyst;
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 31ad7bed63f0..9cae3fa291da 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -13171,6 +13171,8 @@ with pkgs;
     unifiTesting;
   unifi = unifiStable;
 
+  virtlyst = libsForQt5.callPackage ../servers/web-apps/virtlyst { };
+
   virtuoso6 = callPackage ../servers/sql/virtuoso/6.x.nix { };
 
   virtuoso7 = callPackage ../servers/sql/virtuoso/7.x.nix { };