File tree Expand file tree Collapse file tree 2 files changed +113
-0
lines changed Expand file tree Collapse file tree 2 files changed +113
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ description = "A minimal C++ development environment using flake-utils" ;
3
+
4
+ inputs = {
5
+ nixpkgs . url = "github:NixOS/nixpkgs" ;
6
+ flake-utils . url = "github:numtide/flake-utils" ;
7
+ } ;
8
+
9
+ outputs =
10
+ {
11
+ self ,
12
+ nixpkgs ,
13
+ flake-utils ,
14
+ } :
15
+ flake-utils . lib . eachDefaultSystem (
16
+ system :
17
+ let
18
+ pkgs = import nixpkgs { inherit system ; } ;
19
+
20
+ # Common build inputs for both shells
21
+ commonBuildInputs = with pkgs ; [
22
+ gcc
23
+ cmake
24
+ pkg-config
25
+ ] ;
26
+
27
+ in
28
+ {
29
+ devShells = {
30
+ default = pkgs . mkShell {
31
+ buildInputs = commonBuildInputs ;
32
+ shellHook = ''
33
+ echo "Welcome to the C++ development environment!"
34
+ '' ;
35
+ } ;
36
+
37
+ lsp = pkgs . mkShell {
38
+ buildInputs =
39
+ with pkgs ;
40
+ [
41
+ cmake-language-server
42
+ clang-tools
43
+ ]
44
+ ++ commonBuildInputs ;
45
+ shellHook = ''
46
+ export CMAKE_EXPORT_COMPILE_COMMANDS=ON
47
+ echo "Welcome to the C++ development environment with LSP tools!"
48
+ '' ;
49
+ } ;
50
+ } ;
51
+ }
52
+ ) ;
53
+ }
You can’t perform that action at this time.
0 commit comments