setup flake dependencies

This commit is contained in:
2026-01-22 12:32:37 +01:00
parent bf5a069c4f
commit 997d4d2b9f
6 changed files with 47 additions and 16 deletions

2
.clangd Normal file
View File

@@ -0,0 +1,2 @@
CompileFlags:
CompilationDatabase: build/

2
.gitignore vendored
View File

@@ -39,3 +39,5 @@
/.vscode/*
/.vs/
/.cache/

18
.zed/debug.json Normal file
View File

@@ -0,0 +1,18 @@
// Project-local debug tasks
//
// For more documentation on how to configure debug tasks,
// see: https://zed.dev/docs/debugger
[
{
"label": "Debug native binary",
"build": {
"command": "make build-debug",
// "args": ["-j8"],
"cwd": "$ZED_WORKTREE_ROOT",
},
"program": "$ZED_WORKTREE_ROOT/build-debug/glowbox",
"cwd": "$ZED_WORKTREE_ROOT/build-debug",
"request": "launch",
"adapter": "CodeLLDB",
},
]

4
flake.lock generated
View File

@@ -4,13 +4,13 @@
"locked": {
"lastModified": 1768886240,
"narHash": "sha256-C2TjvwYZ2VDxYWeqvvJ5XPPp6U7H66zeJlRaErJKoEM=",
"owner": "nixos",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "80e4adbcf8992d3fd27ad4964fbb84907f9478b0",
"type": "github"
},
"original": {
"owner": "nixos",
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"

View File

@@ -1,35 +1,41 @@
{
description = "assignment 1 of graphics and visualizations";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
pkgs = nixpkgs.legacyPackages.x86_64-linux;
runtimeLibs = with pkgs; [
libGL
libx11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
xorg.libXinerama
];
in
{
devShells.${system}.default = pkgs.mkShell {
buildInputs = with pkgs; [
python3
devShells.x86_64-linux.default = pkgs.mkShell {
nativeBuildInputs = with pkgs; [
cmake
git
libgcc
# x11 shenanigans
libx11.dev
libxcb.dev
xorg.libXrandr.dev
xorg.libXi.dev
xorg.libXcursor.dev
xorg.libXinerama.dev
python3
openal
flac.dev
libvorbis.dev
libogg.dev
flac.dev
xwayland-satellite
gdb
];
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath runtimeLibs}:$LD_LIBRARY_PATH"
'';
};
};
}

View File

@@ -24,6 +24,9 @@ GLFWwindow* initialise()
if (!glfwInit())
{
fprintf(stderr, "Could not start GLFW\n");
const char* desc;
int code = glfwGetError(&desc);
fprintf(stderr, "GLFW error %d: %s\n", code, desc);
exit(EXIT_FAILURE);
}