-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (69 loc) · 2.45 KB
/
flake.nix
File metadata and controls
82 lines (69 loc) · 2.45 KB
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
description = "Build a dev environment";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
# Allows to define modifications for packages. Ideals to make packages work
# with specific versions.
overlay = (final: prev:
{
# Use yarn with a different nodejs version
# yarn = prev.yarn.override { nodejs = final.pkgs.nodejs-16_x; };
# Refer to https://nixos.wiki/wiki/Overlays
});
# The packages for this system and any defined overlay
pkgs = import nixpkgs {
inherit system;
overlays = [ overlay ];
};
# Packages required for building
nativeBuildInputs = with pkgs; [
# Compilers/Toolchains
clang_20
gcc14
# Makers
ninja
cmake
cmakeCurses
# Styler, Linter, other generators
ccache
cppcheck
nodePackages.prettier # JSON is everywhere. Make it pretty
cmake-format # Make cmake files look nice
clang-tools # clang-tidy, clang-format and others
# Utils
doxygen
graphviz-nox
# Packager to use and its dependencies:
vcpkg
pkg-config
];
# Packages required at runtime
buildInputs = with pkgs; [ ];
# Any script to run while activating the shell? Perfect for activating
# Python VENV, set env vars and more.
#
# HINT: you can directly reference paths from packages using:
# ${pkgs.emscripten}/bin/em++
shellHook = ''
echo "Hello `whoami`. Dev env loaded. Have fun!"
echo "use:"
echo " * Config: $ cmake --preset x64-release-clang"
echo " * Build: $ cmake --build --preset x64-release-clang"
echo ""
cmake --list-presets
'';
in {
devShells.default = pkgs.mkShell {
inherit buildInputs nativeBuildInputs shellHook;
# Ensure that prebuild binaries installed by pip/conda can find the sys libs
#LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [ pkgs.stdenv.cc.cc pkgs.zlib ];
# Make sure cmake can use the vcpkg toolchain file
VCPKG_ROOT = "${pkgs.vcpkg}/share/vcpkg";
};
});
}