From 21fd1f89939ac63141a6947ef06c411ef1601d52 Mon Sep 17 00:00:00 2001 From: Pierre Bourdon Date: Mon, 26 Aug 2024 20:21:36 +0200 Subject: [PATCH] flake: add devShells, including a clang one for clang-tidy & more --- flake.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/flake.nix b/flake.nix index 859b418c..b26c7b40 100644 --- a/flake.nix +++ b/flake.nix @@ -73,6 +73,21 @@ default = pkgsBySystem.${system}.hydra; }); + devShells = forEachSystem (system: let + pkgs = pkgsBySystem.${system}; + lib = pkgs.lib; + + mkDevShell = stdenv: (pkgs.mkShell.override { inherit stdenv; }) { + inputsFrom = [ (self.packages.${system}.default.override { inherit stdenv; }) ]; + + packages = + lib.optional (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) pkgs.clang-tools; + }; + in { + default = mkDevShell pkgs.stdenv; + clang = mkDevShell pkgs.clangStdenv; + }); + nixosModules = import ./nixos-modules { overlays = overlayList; };