diff --git a/hydra/mcu.json b/hydra/mcu.json index a17d9c4..4cbc60e 100644 --- a/hydra/mcu.json +++ b/hydra/mcu.json @@ -12,7 +12,7 @@ "keepnr": 10, "inputs": { "nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-25.11", "emailresponsible": false }, - "mozillaOverlay": { "type": "git", "value": "https://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false }, + "rustOverlay": { "type": "git", "value": "https://https://github.com/oxalica/rust-overlay.git", "emailresponsible": false }, "nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }, "stabilizerSrc": { "type": "git", "value": "https://github.com/quartiq/stabilizer.git main", "emailresponsible": false }, "thermostatEemSrc": { "type": "git", "value": "https://github.com/quartiq/thermostat-eem.git main", "emailresponsible": false } diff --git a/mcu-contrib.nix b/mcu-contrib.nix index 6a85447..57809ce 100644 --- a/mcu-contrib.nix +++ b/mcu-contrib.nix @@ -2,7 +2,7 @@ let jobs = import ./mcu-contrib/default.nix { - mozillaOverlay = import ; + rustOverlay = import ; }; in builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs diff --git a/mcu-contrib/default.nix b/mcu-contrib/default.nix index 5d089c1..364c679 100644 --- a/mcu-contrib/default.nix +++ b/mcu-contrib/default.nix @@ -1,33 +1,17 @@ { # Use master branch of the overlay by default - mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz), + rustOverlay ? import (builtins.fetchTarball https://github.com/oxalica/rust-overlay/archive/master.tar.gz), }: let - pkgs = import { overlays = [ mozillaOverlay ]; }; - targets = [ - "thumbv7em-none-eabihf" - ]; - rustManifest = pkgs.fetchurl { - url = "https://static.rust-lang.org/dist/2025-05-15/channel-rust-stable.toml"; - sha256 = "sha256-KUm16pHj+cRedf8vxs/Hd2YWxpOrWZ7UOrwhILdSJBU="; + pkgs = import { overlays = [ rustOverlay ]; }; + rust = pkgs.rust-bin.stable."1.87.0".default.override { + extensions = [ "rust-src" ]; + targets = [ "thumbv7em-none-eabihf" ]; }; - rustChannelOfTargets = _channel: _date: targets: - (pkgs.lib.rustLib.fromManifestFile rustManifest { - inherit (pkgs) stdenv lib fetchurl patchelf; - }).rust.override { - inherit targets; - extensions = ["rust-src"]; - }; - rust = rustChannelOfTargets "nightly" null targets; - rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform { - rustc = rust // { - # https://github.com/oxalica/rust-overlay/commit/c48c2d76b68dd9ede0815fec53479375c61af857 - targetPlatforms = pkgs.lib.platforms.all; - tier1TargetPlatforms = pkgs.lib.platforms.all; - badTargetPlatforms = [ ]; - }; + rustPlatform = pkgs.makeRustPlatform { + rustc = rust; cargo = rust; - }); + }; buildStm32Firmware = { name, src, cargoDepsName ? name, patchPhase ? "", extraNativeBuildInputs ? [], checkPhase ? "", doCheck ? true, binaryName ? name, extraCargoBuildArgs ? "", outputHashes ? {} }: rustPlatform.buildRustPackage rec {