flake parts

This commit is contained in:
2026-02-14 16:24:35 -06:00
parent 874de65dba
commit f01bd49fb1
12 changed files with 296 additions and 373 deletions

View File

@@ -1,6 +1,8 @@
{ inputs, ... }: {
perSystem = { system, pkgs, self', ... }: {
perSystem = { lib, system, pkgs, ... }: {
packages.exampleApps_ImguiEmbed = pkgs.stdenvNoCC.mkDerivation {
name = "Archimedes";
@@ -24,7 +26,7 @@
buildPhase = ''
clang++ \
$src/src/example_apps/ImguiEmbed/*.cpp \
$src/example_apps/ImguiEmbed/*.cpp \
$src/modules/MainGUI/*.cpp \
$src/modules/WindowModule/*.cpp \
$src/modules/ImguiModule/*.cpp \

View File

@@ -16,7 +16,7 @@
buildPhase = ''
clang++ \
$src/src/example_apps/MinimalApp/MinimalApp.cpp \
$src/example_apps/MinimalApp/MinimalApp.cpp \
-I $src/include \
-Wall \
-o $name

View File

@@ -2,37 +2,47 @@
perSystem = { system, pkgs, self', ... }: {
packages.exampleApps_MinimalApp = pkgs.stdenvNoCC.mkDerivation {
packages.exampleApps_TerminalEmbed = pkgs.stdenvNoCC.mkDerivation {
name = "Archimedes";
src = inputs.src;
outputs = [ "out" "dev" ];
imgui = inputs.imgui;
nativeBuildInputs = with pkgs; [
clang
];
buildInputs = with pkgs; [
glfw
glew
];
buildPhase = ''
clang++ \
$src/src/example_apps/MinimalApp/MinimalApp.cpp \
-I $src/include \
example_apps/TerminalEmbed/*.cpp \
modules/Archimedes-Modules/Terminal/*.cpp \
modules/WindowModule/*.cpp \
modules/ImguiModule/*.cpp \
$imgui/backends/imgui_impl_glfw.cpp \
$imgui/backends/imgui_impl_opengl3.cpp \
$imgui/misc/cpp/*.cpp \
$imgui/*.cpp \
-DRENDERER=1 \
-DWINDOW=1 \
-I include -I $imgui -I . \
-lGL -lglfw -lGLEW \
-Wall \
-o $name
'';
-o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
'';
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
mkdir -p $dev/include/modules
cp -r include/* $dev/include
cp -r modules $dev/include/modules
'';
};
};
}

View File

@@ -2,37 +2,48 @@
perSystem = { system, pkgs, self', ... }: {
packages.exampleApps_MinimalApp = pkgs.stdenvNoCC.mkDerivation {
packages.exampleApps_TriangleEmbed = pkgs.stdenvNoCC.mkDerivation {
name = "Archimedes";
name = "Archimedes";
src = inputs.src;
src = inputs.src;
outputs = [ "out" "dev" ];
imgui = inputs.imgui;
nativeBuildInputs = with pkgs; [
clang
];
nativeBuildInputs = with pkgs; [
clang
];
buildPhase = ''
clang++ \
$src/src/example_apps/MinimalApp/MinimalApp.cpp \
-I $src/include \
-Wall \
-o $name
'';
buildInputs = with pkgs; [
glfw
glew
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
glm
nlohmann_json
curl
];
mkdir -p $dev/include/modules
cp -r include/* $dev/include
cp -r modules $dev/include/modules
'';
buildPhase = ''
clang++ \
src/example_apps/TriangleEmbed/*.cpp \
modules/Archimedes-Modules/TestTriangle/*.cpp \
modules/WindowModule/*.cpp \
-DRENDERER_OPENGL=1 \
-DWINDOW_GLFW=1 \
-I include -I . \
-lEGL -lGL -lglfw -lGLEW \
$(curl-config --cflags) \
$(curl-config --libs) \
-Wall \
-o $name
'';
};
};
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
'';
}; };
}

View File

@@ -0,0 +1,40 @@
{ ... }: {
perSystem = { system, pkgs, self', ... }: {
packages.ClientModule = pkgs.stdenvNoCC.mkDerivation {
name = "ClientModule";
src = ./.;
nativeBuildInputs = with pkgs; [
clang
];
buildInputs = with pkgs; [
gamenetworkingsockets
];
buildPhase = ''
clang++ \
modules/ClientModule/*.cpp \
-fpic -shared \
-I include \
-I ${pkgs.gamenetworkingsockets}/include/GameNetworkingSockets \
-lGameNetworkingSockets \
-DCLIENTMODULE_DYNAMIC \
-Wall \
-o $name
'';
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
'';
};
};
}

View File

@@ -0,0 +1,50 @@
{ inputs, ... }: {
perSystem = { system, pkgs, self', ... }: {
packages.ImguiModule = pkgs.stdenvNoCC.mkDerivation {
name = "ImguiModule";
src = ./.;
imgui = inputs.imgui;
nativeBuildInputs = with pkgs; [
clang
];
buildInputs = with pkgs; [
glfw
glew
];
buildPhase = ''
clang++ \
modules/ImguiModule/*.cpp \
modules/WindowModule/*.cpp \
$imgui/backends/imgui_impl_glfw.cpp \
$imgui/backends/imgui_impl_opengl3.cpp \
$imgui/misc/cpp/*.cpp \
$imgui/*.cpp \
-DRENDERER=1 \
-DWINDOW=1 \
-DIMGUIMODULE_DYNAMIC \
-DCUSTOMFONT=${pkgs.fira-code}/share/fonts/truetype/FiraCode-VF.ttf \
-fpic -shared \
-I include -I $imgui -I . \
-lGL -lglfw -lGLEW \
-Wall \
-o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
'';
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
'';
};
};
}

View File

@@ -0,0 +1,50 @@
{ inputs, ... }: {
perSystem = { system, pkgs, self', ... }: {
packages.MainGUI = pkgs.stdenvNoCC.mkDerivation {
name = "MainGUI";
src = inputs.src;
imgui = inputs.imgui;
nativeBuildInputs = with pkgs; [
clang
];
buildInputs = with pkgs; [
glfw
glew
];
buildPhase = ''
clang++ \
modules/MainGUI/*.cpp \
modules/ImguiModule/*.cpp \
modules/WindowModule/*.cpp \
$imgui/backends/imgui_impl_glfw.cpp \
$imgui/backends/imgui_impl_opengl3.cpp \
$imgui/misc/cpp/*.cpp \
$imgui/*.cpp \
-DRENDERER=1 \
-DWINDOW=1 \
-DMAINGUI_DYNAMIC \
-fpic -shared \
-I include -I $imgui -I . \
-lGL -lglfw -lGLEW \
-Wall \
-o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
'';
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
'';
};
};
}

View File

@@ -0,0 +1,40 @@
{ ... }: {
perSystem = { system, pkgs, self', ... }: {
packages.ServerModule = pkgs.stdenvNoCC.mkDerivation {
name = "ServerModule";
src = ./.;
nativeBuildInputs = with pkgs; [
clang
];
buildInputs = with pkgs; [
gamenetworkingsockets
];
buildPhase = ''
clang++ \
modules/ServerModule/*.cpp \
-fpic -shared \
-I include \
-I ${pkgs.gamenetworkingsockets}/include/GameNetworkingSockets \
-lGameNetworkingSockets \
-DSERVERMODULE_DYNAMIC \
-Wall \
-o $name
'';
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
'';
};
};
}

View File

@@ -0,0 +1,42 @@
{ ... }: {
perSystem = { system, pkgs, self', ... }: {
packages.WindowModule = pkgs.stdenvNoCC.mkDerivation {
name = "WindowModule";
src = ./.;
nativeBuildInputs = with pkgs; [
clang
];
buildInputs = with pkgs; [
glfw
glew
];
buildPhase = ''
clang++ \
modules/WindowModule/*.cpp \
-fpic -shared \
-I include \
-DRENDERER=1 \
-DWINDOW=1 \
-DWINDOWMODULE_DYNAMIC \
-lGL -lglfw -lGLEW \
-Wall \
-o $name -DIMGUI_IMPL_GLFW_DISABLE_X11
'';
installPhase = ''
mkdir -p $out/bin
cp $name $out/bin
'';
};
};
}