Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 1d2e4d2

Browse files
anoadragon453Fizzadar
authored andcommitted
Pin the rust version in flake.nix, and bump to 1.70.0 to fix installing ruff (matrix-org#15940)
1 parent 21df8a3 commit 1d2e4d2

File tree

3 files changed

+87
-43
lines changed

3 files changed

+87
-43
lines changed

changelog.d/15940.misc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Unbreak the nix development environment by pinning the Rust version to 1.70.0.

flake.lock

+63-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+23-10
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@
4646
systems.url = "github:nix-systems/default";
4747
# A development environment manager built on Nix. See https://devenv.sh.
4848
devenv.url = "github:cachix/devenv/main";
49-
# Rust toolchains and rust-analyzer nightly.
50-
fenix = {
51-
url = "github:nix-community/fenix";
52-
inputs.nixpkgs.follows = "nixpkgs";
53-
};
49+
# Rust toolchain.
50+
rust-overlay.url = "github:oxalica/rust-overlay";
5451
};
5552

56-
outputs = { self, nixpkgs, devenv, systems, ... } @ inputs:
53+
outputs = { self, nixpkgs, devenv, systems, rust-overlay, ... } @ inputs:
5754
let
5855
forEachSystem = nixpkgs.lib.genAttrs (import systems);
5956
in {
6057
devShells = forEachSystem (system:
6158
let
62-
pkgs = nixpkgs.legacyPackages.${system};
59+
overlays = [ (import rust-overlay) ];
60+
pkgs = import nixpkgs {
61+
inherit system overlays;
62+
};
6363
in {
6464
# Everything is configured via devenv - a Nix module for creating declarative
6565
# developer environments. See https://devenv.sh/reference/options/ for a list
@@ -76,6 +76,20 @@
7676
# Configure packages to install.
7777
# Search for package names at https://search.nixos.org/packages?channel=unstable
7878
packages = with pkgs; [
79+
# The rust toolchain and related tools.
80+
# This will install the "default" profile of rust components.
81+
# https://rust-lang.github.io/rustup/concepts/profiles.html
82+
#
83+
# NOTE: We currently need to set the Rust version unnecessarily high
84+
# in order to work around https://github.com/matrix-org/synapse/issues/15939
85+
(rust-bin.stable."1.70.0".default.override {
86+
# Additionally install the "rust-src" extension to allow diving into the
87+
# Rust source code in an IDE (rust-analyzer will also make use of it).
88+
extensions = [ "rust-src" ];
89+
})
90+
# The rust-analyzer language server implementation.
91+
rust-analyzer
92+
7993
# Native dependencies for running Synapse.
8094
icu
8195
libffi
@@ -124,12 +138,11 @@
124138
# Install dependencies for the additional programming languages
125139
# involved with Synapse development.
126140
#
127-
# * Rust is used for developing and running Synapse.
128141
# * Golang is needed to run the Complement test suite.
129142
# * Perl is needed to run the SyTest test suite.
143+
# * Rust is used for developing and running Synapse.
144+
# It is installed manually with `packages` above.
130145
languages.go.enable = true;
131-
languages.rust.enable = true;
132-
languages.rust.version = "stable";
133146
languages.perl.enable = true;
134147

135148
# Postgres is needed to run Synapse with postgres support and

0 commit comments

Comments
 (0)