Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/nightly-rust-update-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ jobs:
- name: Update Rust version in Earthfile
run: sed -i -E 's/^(\s*FROM rust):(:?[0-9\.]+)(-.+)?$/\1:${{ steps.check-version.outputs.rust }}\3/g' Earthfile

- name: Update Rust version in rust-toolchain.toml
run: sed -i -E 's/^(channel = ")[0-9\.]+(")$/\1${{ steps.check-version.outputs.rust }}\2/' rust-toolchain.toml

# nix (rust-overlay) can only resolve the pinned stable version once flake.lock points at a
# rust-overlay revision that carries it, so refresh that input in the same PR.
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v21

- name: Update rust-overlay in flake.lock
run: nix flake update rust-overlay

- uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.SERVICE_ACCOUNT_PAT }}
Expand Down
4 changes: 2 additions & 2 deletions nix/modules/checks.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
{
lib,
pkgs,
rustLatest,
rustStable,
...
}:
let
# Source directory for all checks
src = ../..;

# Rust toolchain with rustfmt component
rust = rustLatest.default.override {
rust = rustStable.default.override {
extensions = [ "rustfmt" ];
};

Expand Down
9 changes: 7 additions & 2 deletions nix/modules/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,20 @@
cargoToml = builtins.fromTOML (builtins.readFile ../../Cargo.toml);
msrv = cargoToml.workspace.package.rust-version;

# Pinned stable version, shared with the Earthfile and local dev via rust-toolchain.toml.
# rust-overlay does not read rust-toolchain.toml itself, so parse the channel and pin explicitly.
rustToolchain = builtins.fromTOML (builtins.readFile ../../rust-toolchain.toml);
rustStableVersion = rustToolchain.toolchain.channel;

# Rust toolchains (shared across all modules)
rustLatest = pkgs.rust-bin.stable.latest;
rustStable = pkgs.rust-bin.stable.${rustStableVersion};
rustMsrv = pkgs.rust-bin.stable.${msrv};
rustNightly = pkgs.rust-bin.nightly.latest;
in
{
# Export via _module.args for use in other modules
_module.args = {
inherit rustLatest rustMsrv rustNightly;
inherit rustStable rustMsrv rustNightly;
};
};
}
4 changes: 2 additions & 2 deletions nix/modules/cross.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
pkgs,
pkgsDarwinX64,
system,
rustLatest,
rustStable,
...
}:
let
Expand Down Expand Up @@ -91,7 +91,7 @@
mkCrossToolchain =
targetName: config:
let
rust = (config.rustBin or rustLatest).minimal.override { targets = [ config.rustTarget ]; };
rust = (config.rustBin or rustStable).minimal.override { targets = [ config.rustTarget ]; };
in
{
inherit (config) pkgsCross rustTarget isStatic;
Expand Down
6 changes: 3 additions & 3 deletions nix/modules/devshells.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
config,
lib,
pkgs,
rustLatest,
rustStable,
rustMsrv,
rustNightly,
system,
Expand All @@ -16,7 +16,7 @@
default = config.devShells.stable;

stable = pkgs.callPackage ../shell.nix {
rustc = rustLatest.default;
rustc = rustStable.default;
};
nightly = pkgs.callPackage ../shell.nix {
rustc = rustNightly.default;
Expand Down Expand Up @@ -57,7 +57,7 @@
.${system} or null;
in
pkgsCross.callPackage ../shell.nix ({
rustc = rustLatest.minimal.override {
rustc = rustStable.minimal.override {
targets = [
"aarch64-linux-android"
"armv7-linux-androideabi"
Expand Down
14 changes: 7 additions & 7 deletions nix/modules/native.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
lib,
pkgs,
system,
rustLatest,
rustStable,
rustMsrv,
...
}:
let
# Rust platforms
rustPlatformLatest = pkgs.makeRustPlatform {
cargo = rustLatest.minimal;
rustc = rustLatest.minimal;
rustPlatformStable = pkgs.makeRustPlatform {
cargo = rustStable.minimal;
rustc = rustStable.minimal;
};
rustPlatformMsrv = pkgs.makeRustPlatform {
cargo = rustMsrv.minimal;
Expand Down Expand Up @@ -44,9 +44,9 @@

# Native packages for all platforms
nativePackages = {
# Latest stable builds
"lightway-client-${nativeSuffix}" = mkPackage "lightway-client" pkgs rustPlatformLatest;
"lightway-server-${nativeSuffix}" = mkPackage "lightway-server" pkgs rustPlatformLatest;
# Pinned stable builds
"lightway-client-${nativeSuffix}" = mkPackage "lightway-client" pkgs rustPlatformStable;
"lightway-server-${nativeSuffix}" = mkPackage "lightway-server" pkgs rustPlatformStable;

# MSRV builds
"lightway-client-${nativeSuffix}-msrv" = mkPackage "lightway-client" pkgs rustPlatformMsrv;
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "1.97.1"
Loading