nix-eval-jobs/shell.nix

43 lines
1.3 KiB
Nix
Raw Normal View History

{ pkgs ? (
let
inherit (builtins) fromJSON readFile;
flakeLock = fromJSON (readFile ./flake.lock);
2023-07-21 01:24:29 +00:00
inherit (flakeLock.nodes.nixpkgs) locked;
nixpkgs = assert locked.type == "github"; builtins.fetchTarball {
url = "https://github.com/${locked.owner}/${locked.repo}/archive/${locked.rev}.tar.gz";
sha256 = locked.narHash;
};
in
import nixpkgs { }
)
, srcDir ? null
2022-05-09 07:20:56 +00:00
, nix
}:
let
inherit (pkgs) lib stdenv;
2023-01-02 10:35:39 +00:00
nix-eval-jobs = pkgs.callPackage ./default.nix {
inherit srcDir nix;
};
in
2023-01-02 10:35:39 +00:00
pkgs.mkShell {
inherit (nix-eval-jobs) buildInputs;
nativeBuildInputs = nix-eval-jobs.nativeBuildInputs ++ [
pkgs.clang-tools
2021-09-25 03:17:06 +00:00
(pkgs.python3.withPackages (ps: [
ps.pytest
]))
2023-12-15 20:50:33 +00:00
] ++ lib.optional stdenv.isLinux # broken on darwin
(pkgs.writeShellScriptBin "update-include-what-you-use" ''
#!${pkgs.stdenv.shell}
export PATH=${pkgs.include-what-you-use}/bin:$PATH
find src -type f -name '*.cpp' -o -name '*.hh' -print0 | \
xargs -n1 --null include-what-you-use -std=c++20 -isystem ${lib.getDev nix}/include/nix 2>&1 | \
fix_includes.py
'');
2022-04-26 09:34:51 +00:00
shellHook = lib.optionalString stdenv.isLinux ''
export NIX_DEBUG_INFO_DIRS="${pkgs.curl.debug}/lib/debug:${nix.debug}/lib/debug''${NIX_DEBUG_INFO_DIRS:+:$NIX_DEBUG_INFO_DIRS}"
2022-04-21 17:12:22 +00:00
'';
2023-01-02 10:35:39 +00:00
}