sync cargo2nix on cargo update
All checks were successful
Hydra x86_64-linux.rust-template Hydra build #2349 of procyos:rust-template:x86_64-linux.rust-template
All checks were successful
Hydra x86_64-linux.rust-template Hydra build #2349 of procyos:rust-template:x86_64-linux.rust-template
This commit is contained in:
parent
68ed7b8bc4
commit
b5ee7a7bc8
2 changed files with 56 additions and 34 deletions
48
Cargo.nix
48
Cargo.nix
|
@ -1,7 +1,6 @@
|
||||||
# This file was @generated by cargo2nix 0.11.0.
|
# This file was @generated by cargo2nix 0.11.0.
|
||||||
# It is not intended to be manually edited.
|
# It is not intended to be manually edited.
|
||||||
|
args @ {
|
||||||
args@{
|
|
||||||
release ? true,
|
release ? true,
|
||||||
rootFeatures ? [
|
rootFeatures ? [
|
||||||
"rust-template/default"
|
"rust-template/default"
|
||||||
|
@ -22,28 +21,42 @@ args@{
|
||||||
lib,
|
lib,
|
||||||
workspaceSrc,
|
workspaceSrc,
|
||||||
ignoreLockHash,
|
ignoreLockHash,
|
||||||
}:
|
}: let
|
||||||
let
|
|
||||||
nixifiedLockHash = "4598ab22b158163d169b6aea289131643ca58806898bb56966fba495f4660c02";
|
nixifiedLockHash = "4598ab22b158163d169b6aea289131643ca58806898bb56966fba495f4660c02";
|
||||||
workspaceSrc = if args.workspaceSrc == null then ./. else args.workspaceSrc;
|
workspaceSrc =
|
||||||
|
if args.workspaceSrc == null
|
||||||
|
then ./.
|
||||||
|
else args.workspaceSrc;
|
||||||
currentLockHash = builtins.hashFile "sha256" (workspaceSrc + /Cargo.lock);
|
currentLockHash = builtins.hashFile "sha256" (workspaceSrc + /Cargo.lock);
|
||||||
lockHashIgnored = if ignoreLockHash
|
lockHashIgnored =
|
||||||
|
if ignoreLockHash
|
||||||
then builtins.trace "Ignoring lock hash" ignoreLockHash
|
then builtins.trace "Ignoring lock hash" ignoreLockHash
|
||||||
else ignoreLockHash;
|
else ignoreLockHash;
|
||||||
in if !lockHashIgnored && (nixifiedLockHash != currentLockHash) then
|
in
|
||||||
throw ("Cargo.nix ${nixifiedLockHash} is out of sync with Cargo.lock ${currentLockHash}")
|
if !lockHashIgnored && (nixifiedLockHash != currentLockHash)
|
||||||
else let
|
then throw "Cargo.nix ${nixifiedLockHash} is out of sync with Cargo.lock ${currentLockHash}"
|
||||||
|
else let
|
||||||
inherit (rustLib) fetchCratesIo fetchCrateLocal fetchCrateGit fetchCrateAlternativeRegistry expandFeatures decideProfile genDrvsByProfile;
|
inherit (rustLib) fetchCratesIo fetchCrateLocal fetchCrateGit fetchCrateAlternativeRegistry expandFeatures decideProfile genDrvsByProfile;
|
||||||
profilesByName = {
|
profilesByName = {
|
||||||
};
|
};
|
||||||
rootFeatures' = expandFeatures rootFeatures;
|
rootFeatures' = expandFeatures rootFeatures;
|
||||||
overridableMkRustCrate = f:
|
overridableMkRustCrate = f: let
|
||||||
let
|
drvs = genDrvsByProfile profilesByName ({
|
||||||
drvs = genDrvsByProfile profilesByName ({ profile, profileName }: mkRustCrate ({ inherit release profile hostPlatformCpu hostPlatformFeatures target profileOpts codegenOpts cargoUnstableFlags rustcLinkFlags rustcBuildFlags; } // (f profileName)));
|
profile,
|
||||||
in { compileMode ? null, profileName ? decideProfile compileMode release }:
|
profileName,
|
||||||
let drv = drvs.${profileName}; in if compileMode == null then drv else drv.override { inherit compileMode; };
|
}:
|
||||||
in
|
mkRustCrate ({inherit release profile hostPlatformCpu hostPlatformFeatures target profileOpts codegenOpts cargoUnstableFlags rustcLinkFlags rustcBuildFlags;} // (f profileName)));
|
||||||
{
|
in
|
||||||
|
{
|
||||||
|
compileMode ? null,
|
||||||
|
profileName ? decideProfile compileMode release,
|
||||||
|
}: let
|
||||||
|
drv = drvs.${profileName};
|
||||||
|
in
|
||||||
|
if compileMode == null
|
||||||
|
then drv
|
||||||
|
else drv.override {inherit compileMode;};
|
||||||
|
in {
|
||||||
cargo2nixVersion = "0.11.0";
|
cargo2nixVersion = "0.11.0";
|
||||||
workspace = {
|
workspace = {
|
||||||
rust-template = rustPackages.unknown.rust-template."0.1.0";
|
rust-template = rustPackages.unknown.rust-template."0.1.0";
|
||||||
|
@ -54,5 +67,4 @@ in
|
||||||
registry = "unknown";
|
registry = "unknown";
|
||||||
src = fetchCrateLocal workspaceSrc;
|
src = fetchCrateLocal workspaceSrc;
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,15 @@
|
||||||
{
|
{
|
||||||
"extends": [
|
"extends": [
|
||||||
"config:best-practices"
|
"config:best-practices"
|
||||||
|
],
|
||||||
|
"postUpgradeTasks": {
|
||||||
|
"commands": [
|
||||||
|
"cargo2nix -o",
|
||||||
|
"alejandra ."
|
||||||
|
],
|
||||||
|
"fileFilters": [
|
||||||
|
"Cargo.toml",
|
||||||
|
"Cargo.lock"
|
||||||
]
|
]
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue