summary refs log tree commit diff
path: root/default.nix
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2024-04-12 21:04:21 +0200
committerMel <einebeere@gmail.com>2024-04-12 21:04:21 +0200
commit019b6fef94c8c8893ab8c4d6a87655b2e8999259 (patch)
tree7b6af91e3c5e007ae55951c9713f3998ce282d41 /default.nix
parent1aed0a492d8bc0b70f3c63143d1ca19bf873ccb0 (diff)
downloadmeowcraft-019b6fef94c8c8893ab8c4d6a87655b2e8999259.tar.zst
meowcraft-019b6fef94c8c8893ab8c4d6a87655b2e8999259.zip
Build with Nix flakes (x86_64-darwin only, for now)
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..ec42aa9
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, cmake, glew, glfw }:
+
+stdenv.mkDerivation {
+  pname = "meowcraft";
+  version = "0.0.1";
+
+  src = ./.;
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ glew glfw ];
+  # NOTE: Don't packages usually also add the Apple SDKs as buildInputs?
+  # Like OpenGL.framework, etc.? It seems to work without them, but I'm not sure.
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_INSTALL_PREFIX=\${out}"
+  ];
+
+  meta = with lib; {
+    description = "a dumb minecraft in c++ and opengl.";
+    homepage = "https://git.rnrd.eu/meowcraft";
+    license = licenses.free; # TODO: Choose a specific license.
+    platforms = [ "x86_64-darwin" ];
+    mainProgram = "meowcraft";
+  };
+}
\ No newline at end of file