summary refs log tree commit diff
path: root/flake.nix
diff options
context:
space:
mode:
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix94
1 files changed, 94 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 00000000..32620670
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,94 @@
+{
+  description = "Nheko Nightly";
+
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
+    flake-utils.url = "github:numtide/flake-utils";
+    mtxclientSrc = {
+      url = "github:Nheko-reborn/mtxclient/master";
+      flake = false;
+    };
+  };
+  outputs = { self, nixpkgs, flake-utils, mtxclientSrc }:
+    flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
+      let
+        pkgs = import nixpkgs {
+          inherit system;
+        };
+        lib = pkgs.lib;
+        stdenv = pkgs.stdenv;
+        voipSupport = true;
+      in rec {
+        packages.default = stdenv.mkDerivation {
+          pname = "nheko";
+          #version = "git+master";
+          version = if (self ? rev) then self.rev else "dirty";
+          src = ./.;
+
+          nativeBuildInputs = with pkgs; [
+            lmdbxx
+            cmake
+            pkg-config
+            asciidoctor
+            qt6.wrapQtAppsHook
+          ];
+
+          buildInputs = with pkgs; [
+            qt6.qtbase
+            qt6.qttools
+            qt6.qtsvg
+            qt6.qtmultimedia
+            qt6.qtimageformats
+            qt6Packages.qtkeychain
+            kdsingleapplication
+            cmark
+            coeurl
+            curl
+            libevent
+            lmdb
+            (pkgs.callPackage ./mtxclient-git.nix { inherit mtxclientSrc; })
+            nlohmann_json
+            olm
+            re2
+            spdlog
+            httplib
+          ] ++ lib.optionals voipSupport (with gst_all_1; [
+            gstreamer
+            gst-plugins-base
+            (gst-plugins-good.override { qt5Support = true; })
+            gst-plugins-bad
+            libnice
+          ]);
+
+          LC_ALL = lib.optionalString (!stdenv.isDarwin) "C.UTF-8";
+
+          cmakeFlags = [
+            "-DCOMPILE_QML=ON" # see https://github.com/Nheko-Reborn/nheko/issues/389
+            "-DCMAKE_BUILD_TYPE=Release"
+            "-DBUILD_SHARED_LIBS=OFF"
+            #Rory&
+            "-DMAN=OFF"
+            
+          ] ++ lib.optionals (!voipSupport) [
+            "-DVOIP=OFF"
+          ];
+
+
+          preFixup = lib.optionalString voipSupport ''
+            # add gstreamer plugins path to the wrapper
+            qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
+          '';
+
+          meta = with lib; {
+            description = "Desktop client for the Matrix protocol";
+            homepage = "https://github.com/Nheko-Reborn/nheko";
+            platforms = platforms.all;
+            license = licenses.gpl3Plus;
+          };
+        } ;
+        devShell = pkgs.mkShell {
+          buildInputs = [ self.packages."${system}".default.buildInputs ];
+        };
+      }
+    );
+}