From 5686c97114bd810876e528d8cdbc59e0b734fbaa Mon Sep 17 00:00:00 2001 From: Florian RICHER Date: Sat, 8 Feb 2025 19:40:31 +0100 Subject: [PATCH] Add vscode LSP support --- .vscode/c_cpp_properties.json | 15 +++++++++++++++ .vscode/settings.json | 5 +++++ flake.nix | 9 +++++---- 3 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 .vscode/c_cpp_properties.json create mode 100644 .vscode/settings.json diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..5704d0a --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,15 @@ +{ + "configurations": [ + { + "name": "Linux", + "includePath": [ + "${workspaceFolder}/**", + "${env:C_INCLUDE_PATH}" + ], + "defines": [], + "cStandard": "c11", + "intelliSenseMode": "linux-gcc-x64" + } + ], + "version": 4 + } \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..dd72655 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "*.h": "c" + } +} \ No newline at end of file diff --git a/flake.nix b/flake.nix index da8fff5..697b9af 100644 --- a/flake.nix +++ b/flake.nix @@ -14,16 +14,17 @@ let pkgs = import nixpkgs { inherit system; }; - linux_dev = pkgs.linuxKernel.kernels.linux_zen.dev; + linux = pkgs.linuxKernel.kernels.linux_zen; in { devShells = { default = pkgs.mkShell { - packages = [ linux_dev ]; + packages = [ linux.moduleBuildDependencies ]; - LINUX_MODULES_FOLDER = "${linux_dev}/lib/modules/${linux_dev.modDirVersion}"; + LINUX_MODULES_FOLDER = "${linux.dev}/lib/modules/${linux.modDirVersion}"; + C_INCLUDE_PATH = "${linux.dev}/lib/modules/${linux.modDirVersion}/source/include"; shellHook = '' - echo "Current Linux Kernel used : ${linux_dev.version}" + echo "Current Linux Kernel used : ${linux.version}" ''; }; };