From ede05d4cbf5ece655bd33a3b415ac07a33fa02bf Mon Sep 17 00:00:00 2001 From: _cry64 Date: Mon, 13 Apr 2026 20:22:56 +1000 Subject: [PATCH] don't pin llvm version --- flake.nix | 201 ++++++++++++++++++++++++++---------------------------- 1 file changed, 97 insertions(+), 104 deletions(-) diff --git a/flake.nix b/flake.nix index a64229f..19c113a 100644 --- a/flake.nix +++ b/flake.nix @@ -24,7 +24,6 @@ allowUnfree = false; allowBroken = false; overlays = builtins.attrValues self.overlays or {}; - # config.replaceStdenv = {pkgs}: with pkgs; llvmPackages_21.stdenv; }; forAllSystems = f: @@ -36,9 +35,6 @@ }); in { overlays = { - default = self: super: { - libclang = super.llvmPackages_21.libclang; - }; fenix = inputs.fenix.overlays.default; }; @@ -47,129 +43,126 @@ pkgs, lib, ... - }: { - default = let - nixForBindings = pkgs.nixVersions.nix_2_34; - inherit (pkgs.rustc) llvmPackages; - in - pkgs.mkShell rec { - name = "nixide"; - shell = "${pkgs.bash}/bin/bash"; - strictDeps = true; + }: let + nixForBindings = pkgs.nixVersions.nix_2_34; + inherit (pkgs.rustc) llvmPackages; + in { + default = pkgs.mkShell rec { + name = "nixide"; + shell = "${pkgs.bash}/bin/bash"; + strictDeps = true; - # packages we need at runtime - packages = with pkgs; [ - rustc - llvmPackages.lld - llvmPackages.lldb - # lldb + # packages we need at runtime + packages = with pkgs; [ + rustc + llvmPackages.lld + llvmPackages.lldb + # lldb - cargo - cargo-c - cargo-llvm-cov - cargo-nextest + cargo + cargo-c + cargo-llvm-cov + cargo-nextest - clang # DEBUG - clang-tools # DEBUG + clang + clang-tools - libcxx + libcxx - rust-analyzer-unwrapped - (rustfmt.override {asNightly = true;}) - clippy - taplo - ]; + rust-analyzer-unwrapped + (rustfmt.override {asNightly = true;}) + clippy + taplo + ]; - # packages we need at build time - nativeBuildInputs = with pkgs; [ - pkg-config - glibc.dev - nixForBindings.dev + # packages we need at build time + nativeBuildInputs = with pkgs; [ + pkg-config + glibc.dev + nixForBindings.dev - rustPlatform.bindgenHook - ]; + rustPlatform.bindgenHook + ]; - # packages we link against - buildInputs = with pkgs; [ - stdenv.cc + # packages we link against + buildInputs = [ + # pkgs.stdenv.cc - nixForBindings - ]; + nixForBindings + ]; - env = let - inherit (llvmPackages) llvm libclang; - in { - LD_LIBRARY_PATH = builtins.toString (lib.makeLibraryPath buildInputs); - LIBCLANG_PATH = "${libclang.lib}/lib"; + env = { + LD_LIBRARY_PATH = builtins.toString (lib.makeLibraryPath buildInputs); + LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; - RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; - BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${pkgs.glibc.dev}"; + RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; + BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${pkgs.glibc.dev}"; - # `cargo-llvm-cov` reads these environment variables to find these binaries, - # which are needed to run the tests - LLVM_COV = "${llvm}/bin/llvm-cov"; - LLVM_PROFDATA = "${llvm}/bin/llvm-profdata"; - }; + # `cargo-llvm-cov` reads these environment variables to find these binaries, + # which are needed to run the tests + LLVM_COV = "${llvmPackages.llvm}/bin/llvm-cov"; + LLVM_PROFDATA = "${llvmPackages.llvm}/bin/llvm-profdata"; }; + }; - nightly = let - nixForBindings = pkgs.nixVersions.nix_2_34; - inherit (pkgs.rustc) llvmPackages; - in - pkgs.mkShell rec { - name = "nixide"; - shell = "${pkgs.bash}/bin/bash"; - strictDeps = true; + # nightly = let + # nixForBindings = pkgs.nixVersions.nix_2_34; + # inherit (pkgs.rustc) llvmPackages; + # in + # pkgs.mkShell rec { + # name = "nixide"; + # shell = "${pkgs.bash}/bin/bash"; + # strictDeps = true; - # packages we need at runtime - packages = with pkgs; [ - llvmPackages.lld - lldb - (pkgs.fenix.complete.withComponents [ - "cargo" - "clippy" - "rust-src" - "rustc" - "rustfmt" - ]) - rust-analyzer-nightly + # # packages we need at runtime + # packages = with pkgs; [ + # llvmPackages.lld + # lldb + # (pkgs.fenix.complete.withComponents [ + # "cargo" + # "clippy" + # "rust-src" + # "rustc" + # "rustfmt" + # ]) + # rust-analyzer-nightly - # cargo-c - # cargo-llvm-cov - # cargo-nextest - ]; + # # cargo-c + # # cargo-llvm-cov + # # cargo-nextest + # ]; - # packages we need at build time - nativeBuildInputs = with pkgs; [ - pkg-config - glibc.dev - nixForBindings.dev + # # packages we need at build time + # nativeBuildInputs = with pkgs; [ + # pkg-config + # glibc.dev + # nixForBindings.dev - rustPlatform.bindgenHook - ]; + # rustPlatform.bindgenHook + # ]; - # packages we link against - buildInputs = with pkgs; [ - stdenv.cc + # # packages we link against + # buildInputs = with pkgs; [ + # stdenv.cc - nixForBindings - ]; + # nixForBindings + # ]; - env = let - inherit (llvmPackages) llvm libclang; - in { - LD_LIBRARY_PATH = builtins.toString (lib.makeLibraryPath buildInputs); - LIBCLANG_PATH = "${libclang.lib}/lib"; + # env = let + # inherit (llvmPackages) llvm libclang; + # in { + # LD_LIBRARY_PATH = builtins.toString (lib.makeLibraryPath buildInputs); + # LIBCLANG_PATH = "${libclang.lib}/lib"; - RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; - BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${pkgs.glibc.dev}"; + # RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}"; + # BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${pkgs.glibc.dev}"; - # `cargo-llvm-cov` reads these environment variables to find these binaries, - # which are needed to run the tests - LLVM_COV = "${llvm}/bin/llvm-cov"; - LLVM_PROFDATA = "${llvm}/bin/llvm-profdata"; - }; - }; + # # `cargo-llvm-cov` reads these environment variables to find these binaries, + # # which are needed to run the tests + # LLVM_COV = "${llvm}/bin/llvm-cov"; + # LLVM_PROFDATA = "${llvm}/bin/llvm-profdata"; + # }; + # }; } ); };