Rust: Difference between revisions
→Installation via rustup: use bindgenHook and remove now uneccesary attrs |
Add example for how to overrideAttrs rust packages |
||
| Line 163: | Line 163: | ||
== Using overrideAttrs with Rust Packages == | == Using overrideAttrs with Rust Packages == | ||
<syntaxhighlight lang="nix"> | |||
nil = pkgs.nil.overrideAttrs ( | |||
finalAttrs: previousAttrs: { | |||
== | version = "unstable-2024-09-19"; | ||
src = pkgs.fetchFromGitHub { | |||
owner = "oxalica"; | |||
repo = "nil"; | |||
rev = "c8e8ce72442a164d89d3fdeaae0bcc405f8c015a"; | |||
hash = "sha256-mIuOP4I51eFLquRaxMKx67pHmhatZrcVPjfHL98v/M8="; | |||
}; | |||
# Requires IFD | |||
cargoDeps = pkgs.rustPlatform.importCargoLock { | |||
} | lockFile = finalAttrs.src + "/Cargo.lock"; | ||
}) | allowBuiltinFetchGit = true; | ||
}; | |||
</ | cargoHash = null; | ||
# Doesn't require IFD | |||
#cargoDeps = previousAttrs.cargoDeps.overrideAttrs { | |||
# name = "nil-vendor.tar.gz"; | |||
# inherit (finalAttrs) src; | |||
# #outputHash = pkgs.lib.fakeHash; | |||
# outputHash = "sha256-RWgknkeGNfP2wH1X6nc+b10Qg1QX3UeewDdeWG0RIE8="; | |||
#}; | |||
} | |||
); | |||
</syntaxhighlight> | |||
== Packaging Rust projects with nix == | == Packaging Rust projects with nix == | ||