Nix: add devshell

This commit is contained in:
Mihai Fufezan 2024-10-13 21:52:26 +03:00
parent e740e9ab01
commit fc6ef308e2
Signed by: fufexan
SSH Key Fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 14 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

1
.gitignore vendored
View File

@ -35,3 +35,4 @@
.cache/ .cache/
build/ build/
compile_commands.json

View File

@ -34,5 +34,17 @@
default = self.packages.${system}.hyprsysteminfo; default = self.packages.${system}.hyprsysteminfo;
inherit (pkgsFor.${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 .
'';
};
});
}; };
} }