Compare commits
1 Commits
0d1a37eef3
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
60448993c5
|
+16
-8
@@ -29,7 +29,7 @@
|
||||
manifest = (lib.importTOML "${src}/Cargo.toml").package;
|
||||
|
||||
craneLib =
|
||||
if builtins.pathExists cfg.srcToolchain
|
||||
if cfg.srcToolchain != null && builtins.pathExists cfg.srcToolchain
|
||||
then
|
||||
(inputs.crane.mkLib (pkgs.extend inputs.rust-overlay.overlays.default)).overrideToolchain (
|
||||
p: p.rust-bin.fromRustupToolchainFile cfg.srcToolchain
|
||||
@@ -61,18 +61,26 @@
|
||||
description = "A path to the filtered directory of the root of the crate.";
|
||||
type = lib.types.path;
|
||||
default = craneLib.cleanCargoSource cfg.src;
|
||||
defaultText = lib.literalExpression "config.krantz.rust.craneLib cfg.src";
|
||||
defaultText = lib.literalExpression "config.krantz.rust.craneLib.cleanCargoSource cfg.src";
|
||||
example = lib.literalExpression "./.";
|
||||
};
|
||||
srcToolchain = lib.mkOption {
|
||||
description = "A path to the rust-toolchain(.toml) file for the repo. Will use the toolchain from nixpkgs if the file does not exist.";
|
||||
type = lib.types.path;
|
||||
default = "${
|
||||
type = lib.types.nullOr lib.types.path;
|
||||
default =
|
||||
if cfg.src != null
|
||||
then cfg.src
|
||||
else "/dev/null"
|
||||
}/rust-toolchain.toml";
|
||||
defaultText = lib.literalExpression "cfg.src + \"/rust-toolchain.toml\"";
|
||||
then cfg.src + "/rust-toolchain.toml"
|
||||
else null;
|
||||
defaultText =
|
||||
lib.literalExpression
|
||||
/*
|
||||
nix
|
||||
*/
|
||||
''
|
||||
if cfg.src != null
|
||||
then cfg.src + "/rust-toolchain.toml"
|
||||
else null;
|
||||
'';
|
||||
example = lib.literalExpression "./rust-toolchain";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user