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:
parent
1315858592
commit
d145ee2b5c
3 changed files with 10 additions and 48 deletions
23
flake.lock
generated
23
flake.lock
generated
|
|
@ -39,28 +39,7 @@
|
||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-parts": "flake-parts",
|
"flake-parts": "flake-parts",
|
||||||
"nixpkgs": "nixpkgs",
|
"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"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
32
flake.nix
32
flake.nix
|
|
@ -3,10 +3,6 @@
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||||
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||||
rust-overlay = {
|
|
||||||
url = "github:oxalica/rust-overlay";
|
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs =
|
outputs =
|
||||||
|
|
@ -18,35 +14,20 @@
|
||||||
];
|
];
|
||||||
|
|
||||||
perSystem =
|
perSystem =
|
||||||
{
|
{ pkgs, ... }:
|
||||||
pkgs,
|
|
||||||
system,
|
|
||||||
...
|
|
||||||
}:
|
|
||||||
let
|
let
|
||||||
overlays = [ (import inputs.rust-overlay) ];
|
|
||||||
pkgs' = import inputs.nixpkgs {
|
|
||||||
inherit system overlays;
|
|
||||||
};
|
|
||||||
|
|
||||||
buildEnvVars = {
|
buildEnvVars = {
|
||||||
BIN_XDG_PERMISSION_STORE = "${pkgs.xdg-desktop-portal}/libexec/xdg-permission-store";
|
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_XDG_DOCUMENT_PORTAL = "${pkgs.xdg-desktop-portal}/libexec/xdg-document-portal";
|
||||||
BIN_VIRTIOFSD = "${pkgs.virtiofsd}/bin/virtiofsd";
|
BIN_VIRTIOFSD = "${pkgs.virtiofsd}/bin/virtiofsd";
|
||||||
};
|
};
|
||||||
|
|
||||||
rustToolchain = pkgs'.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
|
||||||
rustPlatform = pkgs'.makeRustPlatform {
|
|
||||||
cargo = rustToolchain;
|
|
||||||
rustc = rustToolchain;
|
|
||||||
};
|
|
||||||
|
|
||||||
rustPackage =
|
rustPackage =
|
||||||
crate:
|
crate:
|
||||||
let
|
let
|
||||||
cargoToml = builtins.fromTOML (builtins.readFile ./${crate}/Cargo.toml);
|
cargoToml = builtins.fromTOML (builtins.readFile ./${crate}/Cargo.toml);
|
||||||
in
|
in
|
||||||
rustPlatform.buildRustPackage {
|
pkgs.rustPlatform.buildRustPackage {
|
||||||
inherit (cargoToml.package) name version;
|
inherit (cargoToml.package) name version;
|
||||||
src = ./.;
|
src = ./.;
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
|
@ -59,8 +40,13 @@
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
devShells.default = pkgs'.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = [ rustToolchain ];
|
buildInputs = with pkgs; [
|
||||||
|
cargo
|
||||||
|
rustc
|
||||||
|
rust-analyzer
|
||||||
|
clippy
|
||||||
|
];
|
||||||
env = buildEnvVars;
|
env = buildEnvVars;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
[toolchain]
|
|
||||||
channel = "1.88.0"
|
|
||||||
components = ["rust-analyzer", "rust-src", "clippy"]
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue