diff options
| author | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-01-05 12:40:09 -0500 |
|---|---|---|
| committer | Stefan Weigl-Bosker <stefan@s00.xyz> | 2026-01-10 15:37:46 -0500 |
| commit | d4b629cc275769c2553db819643849cda2395a17 (patch) | |
| tree | 6dcc5d0c886945f8b58b4d8fd6c7eea4bb1b194d /nix/flake.nix | |
| download | compiler-d4b629cc275769c2553db819643849cda2395a17.tar.gz | |
init
wip
wip, pt2
wip, pt3
Diffstat (limited to 'nix/flake.nix')
| -rw-r--r-- | nix/flake.nix | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/nix/flake.nix b/nix/flake.nix new file mode 100644 index 0000000..240619c --- /dev/null +++ b/nix/flake.nix @@ -0,0 +1,60 @@ +{ + description = "pedagogical compiler monorepo (bazel + nix + clang + ccache)"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + # pkgs = import nixpkgs { inherit system; config.replaceStdenv = {pkgs, ...}: pkgs.clangStdenv; }; + pkgs = import nixpkgs { inherit system; }; + # lock = builtins.fromJSON (builtins.readFile ./flake.lock); + # spec = lock.nodes.nixpkgs.locked; + # nixpkgs = fetchTarball "https://github.com/${spec.owner}/${spec.repo}/archive/${spec.rev}.tar.gz"; + in + { + devShells.default = pkgs.mkShell { + name = "compiler stuff"; + packages = with pkgs; [ + # clang-tools + # bazelisk + bazel_8 + bazel-buildtools + nix + git + gcc + + doxygen + ccache + python3 + + ninja + clang-tools + + z3 + gtest + pkg-config + lit + + buildifier + buildozer + ]; + CC = "ccache clang"; + CXX = "ccache clang++"; + # LD_LIBRARY_PATH = nixpkgs.lib.makeLibraryPath [ pkgs.libcxx ]; + NIX_HARDENING_ENABLE = ""; + }; + } + ); +} + |