Add flake.nix

This commit is contained in:
2026-07-08 15:16:17 +01:00
parent 9620b57b96
commit fabcad8dc8
6 changed files with 74 additions and 1044 deletions
+1 -1
View File
@@ -5,6 +5,6 @@ bin/*
.clangd
include/binding/ruby_compiled.h
include/bindings/ruby_compiled.h
p.vim
+4 -4
View File
@@ -23,9 +23,9 @@ SDL_LIBS_RELEASE := $(shell pkg-config --libs sdl3 sdl3-ttf sdl3-image)
CFLAGS_DEBUG := \
-std=c++20 -Wall -Wextra \
-O0 -g -fno-omit-frame-pointer \
-Og -g -fno-omit-frame-pointer \
-Wno-unused-command-line-argument \
-I./include -I./libs/mruby/include \
-I./include -I./libs/mruby/build/host/include \
$(SDL_CFLAGS)
CFLAGS_RELEASE := \
@@ -33,7 +33,7 @@ CFLAGS_RELEASE := \
-flto=thin \
-fno-rtti -fomit-frame-pointer -DNDEBUG -s \
-Wno-unused-command-line-argument \
-I./include -I./libs/mruby/include \
-I./include -I./libs/mruby/build/host/include \
$(SDL_CFLAGS)
PCH_CFLAGS_DEBUG := $(CFLAGS_DEBUG) -x c++-header
@@ -123,4 +123,4 @@ $(OBJ_DIR)/release/%.o: $(SRC_DIR)/%.cc $(PCH_RELEASE)
clean:
@rm -rf $(OBJ_DIR) $(BIN_DIR)
@$(MGEM_DIR)/compile.sh clean
@echo "Cleaned build artifacts."
@echo "Cleaned build artifacts."
Generated
+27
View File
@@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1783224372,
"narHash": "sha256-8i/87eeoqiGE4yOTjwSA3Eh/ziJRQEmd/unYU+K27sk=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d407951447dcd00442e97087bf374aad70c04cea",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}
+41
View File
@@ -0,0 +1,41 @@
{
description = "game";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" ];
forAllSystems = f:
nixpkgs.lib.genAttrs systems (system:
f (import nixpkgs {
inherit system;
}));
in {
devShells = forAllSystems (pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
clang
ccache
pkg-config
gnumake
ruby
xxd
sdl3
sdl3-ttf
sdl3-image
];
shellHook = ''
export CC=clang
export CXX=clang++
export LD=clang
'';
};
});
};
}
File diff suppressed because it is too large Load Diff