nix: initial tooling setup
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ia510d6575a3796118a14dbc834af1ba16a6a6964
This commit is contained in:
parent
ef28bdaeb4
commit
563ff2b187
5 changed files with 125 additions and 0 deletions
29
nix/package.nix
Normal file
29
nix/package.nix
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "sample-rust";
|
||||
version = "0.1.0";
|
||||
|
||||
src = let
|
||||
fs = lib.fileset;
|
||||
s = ../.;
|
||||
in
|
||||
fs.toSource {
|
||||
root = s;
|
||||
fileset = fs.unions [
|
||||
(fs.fileFilter (file: builtins.any file.hasExt ["rs"]) (s + /src))
|
||||
(s + /Cargo.lock)
|
||||
(s + /Cargo.toml)
|
||||
];
|
||||
};
|
||||
|
||||
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Sample Rust project";
|
||||
maintainers = with lib.maintainers; [NotAShelf];
|
||||
};
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue