mcu-contrib: Move to oxalica's rust-overlay

This commit was merged in pull request #104.
This commit is contained in:
2026-02-04 10:33:46 +08:00
committed by sb10q
parent f783a59271
commit d5271c7e1e
3 changed files with 10 additions and 26 deletions

View File

@@ -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 }

View File

@@ -2,7 +2,7 @@
let
jobs = import ./mcu-contrib/default.nix {
mozillaOverlay = import <mozillaOverlay>;
rustOverlay = import <rustOverlay>;
};
in
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs

View File

@@ -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 <nixpkgs> { 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 <nixpkgs> { 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 {