From 87d250df07b0dec52e00ba4bdb90bfbfc5c0305c Mon Sep 17 00:00:00 2001 From: Marten Wijnja Date: Fri, 6 Feb 2026 11:13:09 +0100 Subject: [PATCH] Makes passing the 'rustToolchain' optional when using pkgs.callPackage to build opsqueue.nix or opsqueue_python.nix They can still be overridden by specifying a different Rust version in the overlay. But if kept at its default, will use the version from the `rust-toolchain.toml` in the opsqueue repo itself. --- libs/opsqueue_python/opsqueue_python.nix | 10 ++++++++-- opsqueue/opsqueue.nix | 10 +++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/libs/opsqueue_python/opsqueue_python.nix b/libs/opsqueue_python/opsqueue_python.nix index 748cdad..58f6c62 100644 --- a/libs/opsqueue_python/opsqueue_python.nix +++ b/libs/opsqueue_python/opsqueue_python.nix @@ -3,8 +3,14 @@ pkgs, lib, - # Rust version. (Override this with an overlay if you like) - rustToolchain, + # Downstream users can override which Rust version is used. + # But this is opt-in. By default we'll use the same version + # that we use in this repo for development. + rustToolchain ? ( + (lib.fix (final: pkgs // (import (import ../../nix/sources.nix).rust-overlay) final pkgs)) + .rust-bin.fromRustupToolchainFile + ../../rust-toolchain.toml + ), # Native build dependencies: maturin, diff --git a/opsqueue/opsqueue.nix b/opsqueue/opsqueue.nix index 6abf55c..d9cf77b 100644 --- a/opsqueue/opsqueue.nix +++ b/opsqueue/opsqueue.nix @@ -1,8 +1,16 @@ { pkgs, lib, - rustToolchain, git, + + # Downstream users can override which Rust version is used. + # But this is opt-in. By default we'll use the same version + # that we use in this repo for development. + rustToolchain ? ( + (lib.fix (final: pkgs // (import (import ./nix/sources.nix).rust-overlay) final pkgs)) + .rust-bin.fromRustupToolchainFile + ./rust-toolchain.toml + ), }: let sources = import ../nix/sources.nix;