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": {
|
"locked": {
|
||||||
"lastModified": 1730255392,
|
"lastModified": 1731897198,
|
||||||
"narHash": "sha256-9pydem8OVxa0TwjUai1PJe0yHAJw556CWCEwyoAq8Ik=",
|
"narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=",
|
||||||
"owner": "oxalica",
|
"owner": "oxalica",
|
||||||
"repo": "rust-overlay",
|
"repo": "rust-overlay",
|
||||||
"rev": "7509d76ce2b3d22b40bd25368b45c0a9f7f36c89",
|
"rev": "0be641045af6d8666c11c2c40e45ffc9667839b5",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,23 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
type = optFunctionTo types.attrs;
|
type = optFunctionTo types.attrs;
|
||||||
default = {};
|
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 [
|
config = mkMerge [
|
||||||
|
|
@ -106,8 +123,8 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
(import inputs.rust-overlay)
|
(import inputs.rust-overlay)
|
||||||
(final: { inputs, rust-bin, writeShellApplication, stdenvNoCC, ... } @ prev: rec {
|
(final: { inputs, rust-bin, writeShellApplication, stdenvNoCC, ... } @ prev: rec {
|
||||||
crateName = (craneLib.crateNameFromCargoToml { inherit src; }).pname;
|
crateName = (craneLib.crateNameFromCargoToml { inherit src; }).pname;
|
||||||
craneLib = (inputs.crane.mkLib final).overrideToolchain (p: p.latestRustToolchain);
|
craneLib = (inputs.crane.mkLib final).overrideToolchain (p: p.rustToolchain);
|
||||||
craneLibForTargets = targets: (inputs.crane.mkLib final).overrideToolchain (p: p.latestRustToolchain.override { inherit targets; });
|
craneLibForTargets = targets: (inputs.crane.mkLib final).overrideToolchain (p: p.rustToolchain.override { inherit targets; });
|
||||||
craneLibMsrv = (inputs.crane.mkLib final).overrideToolchain (p: p.msrvRustToolchain);
|
craneLibMsrv = (inputs.crane.mkLib final).overrideToolchain (p: p.msrvRustToolchain);
|
||||||
cargoArtifacts = craneLib.buildDepsOnly
|
cargoArtifacts = craneLib.buildDepsOnly
|
||||||
{
|
{
|
||||||
|
|
@ -139,11 +156,9 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
pname = "${crateName}-msrv";
|
pname = "${crateName}-msrv";
|
||||||
inherit ((buildDeps final)) buildInputs nativeBuildInputs;
|
inherit ((buildDeps final)) buildInputs nativeBuildInputs;
|
||||||
};
|
};
|
||||||
latestRustToolchain = rust-bin.stable.latest.default;
|
rustToolchain = config.toolchain prev;
|
||||||
msrvRustToolchain = rust-bin.stable.${msrv}.default;
|
msrvRustToolchain = config.msrvToolchain prev;
|
||||||
miriRustToolchain = rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
|
miriRustToolchain = config.miriToolchain prev;
|
||||||
extensions = [ "miri" "rust-src" ];
|
|
||||||
});
|
|
||||||
cargo-expand = (writeShellApplication {
|
cargo-expand = (writeShellApplication {
|
||||||
name = "cargo-expand";
|
name = "cargo-expand";
|
||||||
runtimeInputs = [ prev.cargo-expand ];
|
runtimeInputs = [ prev.cargo-expand ];
|
||||||
|
|
@ -300,7 +315,7 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
rec {
|
rec {
|
||||||
devShells = rec {
|
devShells = rec {
|
||||||
default = {
|
default = {
|
||||||
packages = pkgs: with pkgs; [ latestRustToolchain ]
|
packages = pkgs: with pkgs; [ rustToolchain ]
|
||||||
++ (config.tools pkgs)
|
++ (config.tools pkgs)
|
||||||
++ (buildDeps pkgs).buildInputs
|
++ (buildDeps pkgs).buildInputs
|
||||||
++ (buildDeps pkgs).nativeBuildInputs;
|
++ (buildDeps pkgs).nativeBuildInputs;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue