Skip to content

Commit

Permalink
Add nix.shell
Browse files Browse the repository at this point in the history
  • Loading branch information
hamphet committed Sep 16, 2024
1 parent 06344ae commit 6abe9cd
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
use nix
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,6 @@

# Ignore the .gdb_history that's created next to the project-specific .gdbinit
.gdb_history

#Ignore direnv directory
/.direnv
29 changes: 29 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
{pkgs ? import <nixpkgs> {}}:
let
llvmPackages = pkgs.llvmPackages_19;
in
pkgs.mkShell.override { stdenv = llvmPackages.libcxxStdenv; } {
packages = [
pkgs.python3
pkgs.bazel_7
llvmPackages.clangUseLLVM
llvmPackages.libcxx
llvmPackages.libunwind
llvmPackages.llvm
llvmPackages.bintools
];

buildInputs = [
];
nativeBuildInputs = [
];

NIX_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
pkgs.stdenv.cc.cc
pkgs.libz
];
NIX_LD = pkgs.lib.fileContents "${pkgs.stdenv.cc}/nix-support/dynamic-linker";
}

0 comments on commit 6abe9cd

Please sign in to comment.