From d4b629cc275769c2553db819643849cda2395a17 Mon Sep 17 00:00:00 2001 From: Stefan Weigl-Bosker Date: Mon, 5 Jan 2026 12:40:09 -0500 Subject: init wip wip, pt2 wip, pt3 --- nix/flake.nix | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 nix/flake.nix (limited to 'nix/flake.nix') 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 = ""; + }; + } + ); +} + -- cgit v1.2.3