drop rust-overlay, use rustc from nixpkgs

nixpkgs has a recent enough rustc version, no need for the
extra complexity of rust-overlay and rust-toolchain.toml.
This commit is contained in:
Jörg Thalheim 2026-01-16 15:27:06 +01:00
parent 1315858592
commit d145ee2b5c
3 changed files with 10 additions and 48 deletions

23
flake.lock generated
View file

@ -39,28 +39,7 @@
"root": {
"inputs": {
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1763087910,
"narHash": "sha256-eB9Z1mWd1U6N61+F8qwDggX0ihM55s4E0CluwNukJRU=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "cf4a68749733d45c0420726596367acd708eb2e8",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
"nixpkgs": "nixpkgs"
}
}
},

View file

@ -3,10 +3,6 @@
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
@ -18,35 +14,20 @@
];
perSystem =
{
pkgs,
system,
...
}:
{ pkgs, ... }:
let
overlays = [ (import inputs.rust-overlay) ];
pkgs' = import inputs.nixpkgs {
inherit system overlays;
};
buildEnvVars = {
BIN_XDG_PERMISSION_STORE = "${pkgs.xdg-desktop-portal}/libexec/xdg-permission-store";
BIN_XDG_DOCUMENT_PORTAL = "${pkgs.xdg-desktop-portal}/libexec/xdg-document-portal";
BIN_VIRTIOFSD = "${pkgs.virtiofsd}/bin/virtiofsd";
};
rustToolchain = pkgs'.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rustPlatform = pkgs'.makeRustPlatform {
cargo = rustToolchain;
rustc = rustToolchain;
};
rustPackage =
crate:
let
cargoToml = builtins.fromTOML (builtins.readFile ./${crate}/Cargo.toml);
in
rustPlatform.buildRustPackage {
pkgs.rustPlatform.buildRustPackage {
inherit (cargoToml.package) name version;
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
@ -59,8 +40,13 @@
};
in
{
devShells.default = pkgs'.mkShell {
buildInputs = [ rustToolchain ];
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
cargo
rustc
rust-analyzer
clippy
];
env = buildEnvVars;
};

View file

@ -1,3 +0,0 @@
[toolchain]
channel = "1.88.0"
components = ["rust-analyzer", "rust-src", "clippy"]