This commit is contained in:
Toast 2025-04-17 13:02:17 +02:00
commit 2209bda83f
7 changed files with 60 additions and 0 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use flake

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
build/
.cache/
.direnv/

10
CMakeLists.txt Normal file
View file

@ -0,0 +1,10 @@
cmake_minimum_required(VERSION 3.31)
project(
cpp_experiments
VERSION 1.0
LANGUAGES CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
set(CMAKE_CXX_STANDARD 23)
add_subdirectory(src)

23
flake.lock generated Normal file
View file

@ -0,0 +1,23 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 0,
"narHash": "sha256-F7n4+KOIfWrwoQjXrL2wD9RhFYLs2/GGe/MQY1sSdlE=",
"path": "/nix/store/fwhfa9pbx8vdi8nd5pcys665baz6xdxf-source",
"type": "path"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

16
flake.nix Normal file
View file

@ -0,0 +1,16 @@
{
description = "C/C++ environment";
# inputs.nixpkgs.url = "nixpkgs";
outputs = { nixpkgs, ... }: {
devShells.x86_64-linux.default = nixpkgs.legacyPackages.x86_64-linux.mkShell {
name = "C_CPP-devshell";
packages = with nixpkgs.legacyPackages.x86_64-linux; [
clang-tools
cmake
cmake-language-server
];
};
};
}

1
src/CMakeLists.txt Normal file
View file

@ -0,0 +1 @@
add_executable(Hello helloWorld.cpp)

6
src/helloWorld.cpp Normal file
View file

@ -0,0 +1,6 @@
#include <iostream>
int main() {
std::cout << "Hello world!";
return 0;
}