From cc4e4f66b583efbc35c2ef7f7b8673152b45d8c4 Mon Sep 17 00:00:00 2001 From: polygon Date: Sun, 7 May 2023 16:10:02 +0200 Subject: [PATCH] First working version --- .gitignore | 1 + flake.lock | 46 ++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 23 +++++++++++++++++++++++ gpt4all-chat.nix | 41 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 .gitignore create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 gpt4all-chat.nix diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e2f5dd2 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +result \ No newline at end of file diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..725e5c4 --- /dev/null +++ b/flake.lock @@ -0,0 +1,46 @@ +{ + "nodes": { + "gpt4all-chat": { + "flake": false, + "locked": { + "lastModified": 1683465609, + "narHash": "sha256-+FnySE2i92rDOndoyCeb1IVpyqQSIn4srlwXgZJWbd8=", + "ref": "refs/heads/master", + "rev": "9bd5609ba0fd19e8445a2ae816c494e7a01baaa1", + "revCount": 321, + "submodules": true, + "type": "git", + "url": "https://github.com/nomic-ai/gpt4all-chat" + }, + "original": { + "submodules": true, + "type": "git", + "url": "https://github.com/nomic-ai/gpt4all-chat" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1683408522, + "narHash": "sha256-9kcPh6Uxo17a3kK3XCHhcWiV1Yu1kYj22RHiymUhMkU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "897876e4c484f1e8f92009fd11b7d988a121a4e7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "gpt4all-chat": "gpt4all-chat", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..c2e6ec5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,23 @@ +{ + description = "A very basic flake"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + inputs.gpt4all-chat = { + url = "https://github.com/nomic-ai/gpt4all-chat"; + flake = false; + submodules = true; + type = "git"; + }; + + outputs = { self, nixpkgs, gpt4all-chat }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + in + { + packages.${system} = { + gpt4all-chat = pkgs.qt6Packages.callPackage ./gpt4all-chat.nix { src=gpt4all-chat; }; + default = self.packages.${system}.gpt4all-chat; + }; + }; +} diff --git a/gpt4all-chat.nix b/gpt4all-chat.nix new file mode 100644 index 0000000..e4c6bc1 --- /dev/null +++ b/gpt4all-chat.nix @@ -0,0 +1,41 @@ +{ src +, lib +, stdenv +, fetchFromGitHub +, cmake +, qmake +, qtquicktimeline +, qtsvg +, wrapQtAppsHook +}: + +stdenv.mkDerivation { + pname = "gpt4all-chat"; + version = "nightly"; + + inherit src; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace 'set(CMAKE_INSTALL_PREFIX ''${CMAKE_BINARY_DIR}/install)' "" + ''; + + nativeBuildInputs = [ + wrapQtAppsHook + cmake + qmake + ]; + + buildInputs = [ + qtquicktimeline + qtsvg + ]; + + + meta = with lib; { + description = "Gpt4all-j chat"; + homepage = "https://github.com/nomic-ai/gpt4all-chat"; + license = licenses.mit; + maintainers = with maintainers; [ ]; + }; +}