feat(rust): initialised cargo
This commit is contained in:
parent
2df4bdc9ed
commit
900a9b8e42
9 changed files with 121 additions and 0 deletions
22
nix/package.nix
Normal file
22
nix/package.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
stdenvAdapters,
|
||||
llvm,
|
||||
}: let
|
||||
toml = (lib.importTOML ../Cargo.toml).package;
|
||||
pname = toml.name;
|
||||
inherit (toml) version;
|
||||
in
|
||||
rustPlatform.buildRustPackage.override {stdenv = stdenvAdapters.useMoldLinker llvm.stdenv;} {
|
||||
RUSTFLAGS = "-C link-arg=-fuse-ld=mold";
|
||||
|
||||
inherit pname version;
|
||||
|
||||
src = builtins.path {
|
||||
name = "${pname}-${version}";
|
||||
path = lib.sources.cleanSource ../.;
|
||||
};
|
||||
|
||||
cargoLock.lockFile = ../Cargo.lock;
|
||||
}
|
25
nix/shell.nix
Normal file
25
nix/shell.nix
Normal file
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
mkShell,
|
||||
rust-analyzer-unwrapped,
|
||||
rustfmt,
|
||||
clippy,
|
||||
cargo,
|
||||
rustc,
|
||||
gcc,
|
||||
rustPlatform,
|
||||
}:
|
||||
mkShell {
|
||||
strictDeps = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
cargo
|
||||
rustc
|
||||
gcc
|
||||
|
||||
rust-analyzer-unwrapped
|
||||
rustfmt
|
||||
clippy
|
||||
];
|
||||
|
||||
env.RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue