mirror of
https://codeberg.org/icewind/mill-scale.git
synced 2026-06-03 09:54:19 +02:00
This commit is contained in:
parent
9cc1f1c214
commit
9ab4c05bd4
2 changed files with 26 additions and 11 deletions
6
flake.lock
generated
6
flake.lock
generated
|
|
@ -64,11 +64,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1730255392,
|
||||
"narHash": "sha256-9pydem8OVxa0TwjUai1PJe0yHAJw556CWCEwyoAq8Ik=",
|
||||
"lastModified": 1731897198,
|
||||
"narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "7509d76ce2b3d22b40bd25368b45c0a9f7f36c89",
|
||||
"rev": "0be641045af6d8666c11c2c40e45ffc9667839b5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
|||
|
|
@ -98,6 +98,23 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
|||
type = optFunctionTo types.attrs;
|
||||
default = {};
|
||||
};
|
||||
toolchain = mkOption {
|
||||
type = function;
|
||||
default = pkgs: pkgs.rust-bin.stable.latest.default;
|
||||
description = "rust toolchain to use";
|
||||
};
|
||||
msrvToolchain = mkOption {
|
||||
type = function;
|
||||
default = pkgs: pkgs.rust-bin.stable.${msrv}.default;
|
||||
description = "rust toolchain to use";
|
||||
};
|
||||
miriToolchain = mkOption {
|
||||
type = function;
|
||||
default = pkgs: pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
|
||||
extensions = [ "miri" "rust-src" ];
|
||||
});
|
||||
description = "rust toolchain to use";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkMerge [
|
||||
|
|
@ -106,8 +123,8 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
|||
(import inputs.rust-overlay)
|
||||
(final: { inputs, rust-bin, writeShellApplication, stdenvNoCC, ... } @ prev: rec {
|
||||
crateName = (craneLib.crateNameFromCargoToml { inherit src; }).pname;
|
||||
craneLib = (inputs.crane.mkLib final).overrideToolchain (p: p.latestRustToolchain);
|
||||
craneLibForTargets = targets: (inputs.crane.mkLib final).overrideToolchain (p: p.latestRustToolchain.override { inherit targets; });
|
||||
craneLib = (inputs.crane.mkLib final).overrideToolchain (p: p.rustToolchain);
|
||||
craneLibForTargets = targets: (inputs.crane.mkLib final).overrideToolchain (p: p.rustToolchain.override { inherit targets; });
|
||||
craneLibMsrv = (inputs.crane.mkLib final).overrideToolchain (p: p.msrvRustToolchain);
|
||||
cargoArtifacts = craneLib.buildDepsOnly
|
||||
{
|
||||
|
|
@ -139,11 +156,9 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
|||
pname = "${crateName}-msrv";
|
||||
inherit ((buildDeps final)) buildInputs nativeBuildInputs;
|
||||
};
|
||||
latestRustToolchain = rust-bin.stable.latest.default;
|
||||
msrvRustToolchain = rust-bin.stable.${msrv}.default;
|
||||
miriRustToolchain = rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
|
||||
extensions = [ "miri" "rust-src" ];
|
||||
});
|
||||
rustToolchain = config.toolchain prev;
|
||||
msrvRustToolchain = config.msrvToolchain prev;
|
||||
miriRustToolchain = config.miriToolchain prev;
|
||||
cargo-expand = (writeShellApplication {
|
||||
name = "cargo-expand";
|
||||
runtimeInputs = [ prev.cargo-expand ];
|
||||
|
|
@ -300,7 +315,7 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
|||
rec {
|
||||
devShells = rec {
|
||||
default = {
|
||||
packages = pkgs: with pkgs; [ latestRustToolchain ]
|
||||
packages = pkgs: with pkgs; [ rustToolchain ]
|
||||
++ (config.tools pkgs)
|
||||
++ (buildDeps pkgs).buildInputs
|
||||
++ (buildDeps pkgs).nativeBuildInputs;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue