Initial commit
This commit is contained in:
52
cpp/flake.nix
Normal file
52
cpp/flake.nix
Normal file
@@ -0,0 +1,52 @@
|
||||
{
|
||||
description = "A C++ project flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
};
|
||||
|
||||
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
|
||||
flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
systems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
||||
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }: {
|
||||
packages.default = pkgs.stdenv.mkDerivation {
|
||||
pname = "my-cpp-app";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
|
||||
# Build-time dependencies (compilers, build systems)
|
||||
nativeBuildInputs = with pkgs; [
|
||||
cmake
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
|
||||
# Runtime dependencies (libraries your code links against)
|
||||
buildInputs = with pkgs; [
|
||||
# boost
|
||||
# fmt
|
||||
];
|
||||
|
||||
# Optional: Configure CMake flags
|
||||
cmakeFlags = [
|
||||
"-DCMAKE_BUILD_TYPE=Release"
|
||||
];
|
||||
};
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
inputsFrom = [ self'.packages.default ];
|
||||
|
||||
packages = with pkgs; [
|
||||
gdb
|
||||
clang-tools # Includes clang-format and clangd (LSP)
|
||||
valgrind
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user