generated from capy-ui/zig-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
67 lines (59 loc) · 1.69 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{
description = "RoombaController - C++ ImGui project with GLFW and OpenGL";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = { self, nixpkgs }:
let
pkgs = nixpkgs.legacyPackages."x86_64-linux"; # Adjust if you're on a different architecture
in {
# Define the devShell (development environment)
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = [
pkgs.cmake
pkgs.gcc
pkgs.glew
pkgs.pkg-config
pkgs.mesa # Provides OpenGL libraries
pkgs.glfw
pkgs.git
pkgs.doxygen
pkgs.doxygen_gui
pkgs.libclang
pkgs.gtest
pkgs.nodejs_22
];
shellHook = ''
echo "Welcome to the RoombaController development shell!"
'';
};
# Define a package for building the project
packages.x86_64-linux.roomba-controller = pkgs.stdenv.mkDerivation {
name = "RoombaControllers";
src = ./.;
buildInputs = [
pkgs.cmake
pkgs.gcc
pkgs.glew
pkgs.mesa # Provides OpenGL libraries
pkgs.glfw
];
nativeBuildInputs = [ pkgs.cmake ];
buildPhase = ''
mkdir -p build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
'';
installPhase = ''
mkdir -p $out/bin
cp build/RoombaControllers $out/bin/
'';
};
# Optionally, define a `run` command to run the app after building
apps.x86_64-linux.run = {
type = "app";
program = "${self.packages.x86_64-linux.roomba-controller}/bin/RoombaControllers";
};
};
}