nix: init tooling
This commit is contained in:
parent
f4cb9fe9a1
commit
b865832523
5 changed files with 100 additions and 0 deletions
28
nix/package.nix
Normal file
28
nix/package.nix
Normal file
|
@ -0,0 +1,28 @@
|
|||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
}: let
|
||||
fs = lib.fileset;
|
||||
in
|
||||
rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "nff";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fs.toSource {
|
||||
root = ../.;
|
||||
fileset = fs.unions [
|
||||
(fs.fileFilter (file: builtins.any file.hasExt ["rs"]) ../src)
|
||||
../Cargo.lock
|
||||
../Cargo.toml
|
||||
];
|
||||
};
|
||||
|
||||
cargoLock.lockFile = "${finalAttrs.src}/Cargo.lock";
|
||||
useFetchCargoVendor = true;
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = {
|
||||
description = "Experimental nftables ruleset formatter and prettier";
|
||||
mainProgram = "nff";
|
||||
};
|
||||
})
|
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