From bff8e24e56072dfba29820c6d2258b5987dcba0b Mon Sep 17 00:00:00 2001 From: atagen Date: Sun, 24 May 2026 19:58:17 +1000 Subject: [PATCH] nix: don't drag rust toolchain into system closures --- PLAN.md | 8 +++----- flake.lock | 23 +---------------------- flake.nix | 20 +++++--------------- 3 files changed, 9 insertions(+), 42 deletions(-) diff --git a/PLAN.md b/PLAN.md index efe60e2..9a314fc 100644 --- a/PLAN.md +++ b/PLAN.md @@ -955,11 +955,9 @@ No `tokio`, no `zbus`, no `dbus-*`. `flake.nix` ships: -- A **devshell** with rust toolchain (via `rust-overlay` for pinned - channel; default to a stable release pinned in - `rust-toolchain.toml`), `pkg-config`, `pipewire`'s dev outputs, - `clang` (for bindgen if invoked by deps), `socat` (handy for poking - the IPC), `jq`. +- A **devshell** with the Rust toolchain from nixpkgs, `pkg-config`, + `pipewire`'s dev outputs, `clang` (for bindgen if invoked by deps), + `socat` (handy for poking the IPC), `jq`. - A **package** output (`packages..default`) that builds the daemon + CLI with `rustPlatform.buildRustPackage`. v0 uses `cargoLock.lockFile`. Crane can come later if incremental builds in diff --git a/flake.lock b/flake.lock index 33982ec..94e0bfb 100644 --- a/flake.lock +++ b/flake.lock @@ -18,28 +18,7 @@ }, "root": { "inputs": { - "nixpkgs": "nixpkgs", - "rust-overlay": "rust-overlay" - } - }, - "rust-overlay": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1779074409, - "narHash": "sha256-6aXy8Ga41iLVM8ibddFU1O5+wYWcBGNEfZzZuL91eIc=", - "owner": "oxalica", - "repo": "rust-overlay", - "rev": "2a77b5b1dc952f214e8102acdef1622b68515560", - "type": "github" - }, - "original": { - "owner": "oxalica", - "repo": "rust-overlay", - "type": "github" + "nixpkgs": "nixpkgs" } } }, diff --git a/flake.nix b/flake.nix index 88f9557..89cf210 100644 --- a/flake.nix +++ b/flake.nix @@ -3,17 +3,12 @@ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; - rust-overlay = { - url = "github:oxalica/rust-overlay"; - inputs.nixpkgs.follows = "nixpkgs"; - }; }; outputs = { self, nixpkgs, - rust-overlay, }: let systems = [ @@ -26,7 +21,6 @@ system: import nixpkgs { inherit system; - overlays = [ rust-overlay.overlays.default ]; }; perSystem = @@ -34,13 +28,6 @@ let pkgs = pkgsFor system; - rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; - - rustPlatform = pkgs.makeRustPlatform { - cargo = rustToolchain; - rustc = rustToolchain; - }; - # Native libs the audio crates link against. nativeAudioBuildInputs = with pkgs; [ pipewire @@ -64,8 +51,11 @@ name = "headroom-dev"; nativeBuildInputs = nativeBuildTools ++ [ - rustToolchain + pkgs.cargo + pkgs.clippy pkgs.rust-analyzer + pkgs.rustc + pkgs.rustfmt ]; buildInputs = @@ -89,7 +79,7 @@ ); # `nix build` — the final packaged daemon + CLI. - headroom = rustPlatform.buildRustPackage ( + headroom = pkgs.rustPlatform.buildRustPackage ( { pname = "headroom"; # Pull from the workspace Cargo.toml — the per-crate