From fc6ef308e26d3314c7f67802a83a22f95b851bd3 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Sun, 13 Oct 2024 21:52:26 +0300 Subject: [PATCH] Nix: add devshell --- .envrc | 1 + .gitignore | 1 + flake.nix | 12 ++++++++++++ 3 files changed, 14 insertions(+) create mode 100644 .envrc diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 936c972..49a9e3b 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ .cache/ build/ +compile_commands.json diff --git a/flake.nix b/flake.nix index 519c7ca..673d67f 100644 --- a/flake.nix +++ b/flake.nix @@ -34,5 +34,17 @@ default = self.packages.${system}.hyprsysteminfo; inherit (pkgsFor.${system}) hyprsysteminfo; }); + + devShells = eachSystem (system: { + default = pkgsFor.${system}.mkShell { + inputsFrom = [self.packages.${system}.hyprsysteminfo]; + + shellHook = '' + # Generate compile_commands.json + CMAKE_EXPORT_COMPILE_COMMANDS=1 cmake -S . -B ./build + ln -s build/compile_commands.json . + ''; + }; + }); }; }