From e112f552499e505a1c77a338d129acb45dd81afe Mon Sep 17 00:00:00 2001 From: rojfc Date: Wed, 20 May 2026 12:51:28 +0300 Subject: [PATCH 1/3] Add flake to build on nix. Also changed versions of packages so patches would work properly. And tar cause some dependencies break without it. --- .gitignore | 1 + flake.nix | 31 +++++++++++++++++++++++++++++++ package.json | 7 ++++--- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index d838f969d..d078f0a14 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,4 @@ tasks/construction_tasks/train/** server_data* **/.DS_Store src/mindcraft-py/__pycache__/ +flake.lock diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..9f13038fd --- /dev/null +++ b/flake.nix @@ -0,0 +1,31 @@ +{ + description = "MindCraft flake"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + }; + + outputs = { + nixpkgs, + ... + }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + devShell = pkgs.mkShell { + buildInputs = with pkgs; [ + nodejs_20 + python312 + libX11 + libXext + libXrender + libXi + libGL + libGLU + ]; + shellHook = '' + export LD_LIBRARY_PATH="${pkgs.libX11}/lib:${pkgs.libXext}/lib:$LD_LIBRARY_PATH" + ''; + }; + }; +} diff --git a/package.json b/package.json index 883f58989..aec7ad892 100644 --- a/package.json +++ b/package.json @@ -16,9 +16,9 @@ "globals": "^15.11.0", "google-translate-api-x": "^10.7.1", "groq-sdk": "^0.15.0", - "minecraft-data": "^3.97.0", + "minecraft-data": "3.97.0", "minecraft-assets": "^1.16.0", - "mineflayer": "^4.33.0", + "mineflayer": "4.33.0", "mineflayer-armor-manager": "^2.0.1", "mineflayer-auto-eat": "^3.3.6", "mineflayer-collectblock": "^1.4.1", @@ -39,7 +39,8 @@ }, "overrides": { "canvas": "^3.1.0", - "gl": "^8.1.6" + "gl": "^8.1.6", + "tar": "^7.5.11" }, "scripts": { "postinstall": "patch-package", From 9fbbd2cc94c3811ac0cceceb7e76d2f798311461 Mon Sep 17 00:00:00 2001 From: rojfc Date: Wed, 20 May 2026 13:23:05 +0300 Subject: [PATCH 2/3] Deleted unnecessary libraries --- flake.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/flake.nix b/flake.nix index 9f13038fd..5e195a793 100644 --- a/flake.nix +++ b/flake.nix @@ -15,13 +15,8 @@ devShell = pkgs.mkShell { buildInputs = with pkgs; [ nodejs_20 - python312 libX11 - libXext - libXrender - libXi - libGL - libGLU + libXext ]; shellHook = '' export LD_LIBRARY_PATH="${pkgs.libX11}/lib:${pkgs.libXext}/lib:$LD_LIBRARY_PATH" From 6b3bdfb3d16ef1d67692697b6c13daae5ded2bb1 Mon Sep 17 00:00:00 2001 From: rojfc Date: Wed, 20 May 2026 14:22:20 +0300 Subject: [PATCH 3/3] Added necessary library in order to start project on runtime --- flake.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index 5e195a793..19038fa0d 100644 --- a/flake.nix +++ b/flake.nix @@ -17,10 +17,18 @@ nodejs_20 libX11 libXext + libuuid ]; - shellHook = '' - export LD_LIBRARY_PATH="${pkgs.libX11}/lib:${pkgs.libXext}/lib:$LD_LIBRARY_PATH" - ''; + # shellHook = '' + # export LD_LIBRARY_PATH="${pkgs.libX11}/lib:${pkgs.libXext}/lib:$LD_LIBRARY_PATH" + # ''; + env = { + LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ + pkgs.libX11 + pkgs.libXext + pkgs.libuuid + ]; + }; }; }; }