Skip to content

Commit

Permalink
Use Rust from fenix in flake (#25)
Browse files Browse the repository at this point in the history
* switch to fenix

* pin rust version to 1.81.0 in ci

* use Rust 1.80.1 due to deprecation

* use toolchain version in rs-cargo

* backout of commit 72bbfdb

* backout of commit 3501a32

* backout of commit d2d9ace

* Rust 1.82.0

---------

Co-authored-by: GearsDatapacks <surya@seriousinfinitude.com>
  • Loading branch information
PgBiel and GearsDatapacks authored Nov 4, 2024
1 parent 1cee913 commit 891d4d5
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
6 changes: 3 additions & 3 deletions compiler-cli/src/panic.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#![allow(clippy::unwrap_used)]
use std::panic::PanicInfo;
use std::panic::PanicHookInfo;

pub fn add_handler() {
std::panic::set_hook(Box::new(move |info: &PanicInfo<'_>| {
std::panic::set_hook(Box::new(move |info: &PanicHookInfo<'_>| {
print_compiler_bug_message(info)
}));
}

fn print_compiler_bug_message(info: &PanicInfo<'_>) {
fn print_compiler_bug_message(info: &PanicHookInfo<'_>) {
let message = match (
info.payload().downcast_ref::<&str>(),
info.payload().downcast_ref::<String>(),
Expand Down
52 changes: 52 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 18 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
systems.url = "github:nix-systems/default";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
rust-manifest = {
url = "https://static.rust-lang.org/dist/channel-rust-1.81.0.toml";
flake = false;
};
};

outputs = inputs@{ nixpkgs, flake-parts, systems, ... }:
outputs = inputs@{ nixpkgs, flake-parts, systems, fenix, rust-manifest, ... }:
let
expressions = import ./nix;
in
Expand All @@ -20,9 +28,16 @@
./nix/flake-builders.nix
];

perSystem = { self', pkgs, lib, ... }:
perSystem = { self', pkgs, lib, system, ... }:
let
glistix = pkgs.callPackage expressions.glistix { };
rust-toolchain = (fenix.packages.${system}.fromManifestFile rust-manifest).defaultToolchain;

rustPlatform = pkgs.makeRustPlatform {
cargo = rust-toolchain;
rustc = rust-toolchain;
};

glistix = pkgs.callPackage expressions.glistix { inherit rustPlatform; };
in
{
formatter = pkgs.nixpkgs-fmt;
Expand Down

0 comments on commit 891d4d5

Please sign in to comment.