flake: some improvements

Development tools should be nativeBuildInputs. Also added a clang
version of the dev shell.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2024-02-18 23:13:53 +00:00
parent bef295f4c4
commit 336943d99c
No known key found for this signature in database
GPG Key ID: D3A4405BE6CC17F4
1 changed files with 8 additions and 7 deletions

View File

@ -43,19 +43,20 @@
overlays
;
defaultPackage = pkgs.picom;
devShell = defaultPackage.overrideAttrs {
buildInputs =
defaultPackage.buildInputs
++ (with pkgs; [
clang-tools_17
llvmPackages_17.clang-unwrapped.python
]);
devShells.default = defaultPackage.overrideAttrs (o: {
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [
clang-tools_17
llvmPackages_17.clang-unwrapped.python
]);
hardeningDisable = ["fortify"];
shellHook = ''
# Workaround a NixOS limitation on sanitizers:
# See: https://github.com/NixOS/nixpkgs/issues/287763
export LD_LIBRARY_PATH+=":/run/opengl-driver/lib"
'';
});
devShells.useClang = devShells.default.override {
inherit (pkgs.llvmPackages_17) stdenv;
};
});
}