nix: initial tooling
This commit is contained in:
parent
a4d6b9e203
commit
8547710b62
5 changed files with 103 additions and 0 deletions
31
nix/package.nix
Normal file
31
nix/package.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "eh";
|
||||
version = (builtins.fromTOML (builtins.readFile ../Cargo.toml)).workspace.package.version;
|
||||
|
||||
src = let
|
||||
fs = lib.fileset;
|
||||
s = ../.;
|
||||
in
|
||||
fs.toSource {
|
||||
root = s;
|
||||
fileset = fs.unions (map (dir: (s + /${dir})) [
|
||||
".cargo"
|
||||
"eh"
|
||||
"xtask"
|
||||
"Cargo.toml"
|
||||
"Cargo.lock"
|
||||
]);
|
||||
};
|
||||
|
||||
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Ergonomic Nix CLI helper";
|
||||
maintainers = with lib.licenses; [NotAShelf];
|
||||
};
|
||||
})
|
19
nix/shell.nix
Normal file
19
nix/shell.nix
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
mkShell,
|
||||
rust-analyzer,
|
||||
rustfmt,
|
||||
clippy,
|
||||
cargo,
|
||||
rustPlatform,
|
||||
}:
|
||||
mkShell {
|
||||
name = "rust";
|
||||
packages = [
|
||||
rust-analyzer
|
||||
rustfmt
|
||||
clippy
|
||||
cargo
|
||||
];
|
||||
|
||||
RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue