From 40afee3dbf507c5789b7ce2cfca460f6a4cd37a7 Mon Sep 17 00:00:00 2001 From: death916 Date: Wed, 14 May 2025 08:56:25 -0700 Subject: [PATCH] hash --- overlays/halloy-overlay.nix | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/overlays/halloy-overlay.nix b/overlays/halloy-overlay.nix index ff816f8..24f9e27 100644 --- a/overlays/halloy-overlay.nix +++ b/overlays/halloy-overlay.nix @@ -16,21 +16,32 @@ in { sha256 = "sha256-cG/B6oiRkyoC5fK7bLdCDQYZymfMZspWXvOkqpwHRPk="; }; + # Enable unstable features RUSTC_BOOTSTRAP = 1; - # Add doc_cfg to the allowed features + # Allow both edition2024 and doc_cfg features RUSTFLAGS = "-Z allow-features=edition2024,doc_cfg"; + # Patch Cargo.toml and source files postPatch = '' - # Add cargo-features for both edition2024 and doc_cfg + # Add cargo-features for edition2024 only (not doc_cfg) if ! grep -q 'cargo-features = \["edition2024"\]' Cargo.toml; then - sed -i '1i cargo-features = ["edition2024", "doc_cfg"]' Cargo.toml + sed -i '1i cargo-features = ["edition2024"]' Cargo.toml fi - # Patch async_executors to enable doc_cfg feature + # Find and patch all Cargo.toml files + find . -name Cargo.toml -exec sed -i '1i cargo-features = ["edition2024"]' {} \; + + # Add #![feature(doc_cfg)] to async_executors source + mkdir -p .cargo + echo '[build]' > .cargo/config.toml + echo 'rustflags = ["-Z", "allow-features=edition2024,doc_cfg"]' >> .cargo/config.toml + + # Try to find and patch async_executors find . -path "*async_executors*" -name "lib.rs" -exec sed -i '1i #![feature(doc_cfg)]' {} \; ''; + # Dependency hashes cargoLock = { lockFile = src + "/Cargo.lock"; outputHashes = { @@ -42,6 +53,7 @@ in { }; }; + # System dependencies nativeBuildInputs = with super; [ pkg-config ]; buildInputs = with super; [