nix: init tooling

This commit is contained in:
raf 2025-05-01 05:04:43 +03:00
commit e4d397ac9c
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 115 additions and 0 deletions

37
nix/package.nix Normal file
View file

@ -0,0 +1,37 @@
{
lib,
rustPlatform,
}: let
fs = lib.fileset;
lockfile = ../Cargo.lock;
cargoToml = ../Cargo.toml;
in
rustPlatform.buildRustPackage {
pname = "eris";
version = "0.0.1";
src = let
s = ../.;
in
fs.toSource {
root = s;
fileset = fs.unions [
(fs.fileFilter (file: builtins.any file.hasExt ["rs"]) s + /src)
lockfile
cargoToml
];
};
postInstall = ''
mkdir -p $out/share
install -Dm755 ${../contrib} $out/share/contrib
'';
cargoLock.lockFile = lockfile;
meta = {
description = "Sophisticated HTTP tarpit and honeypot stream";
mainProgram = "eris";
};
}

28
nix/shell.nix Normal file
View file

@ -0,0 +1,28 @@
{
mkShell,
rust-analyzer,
rustfmt,
clippy,
cargo,
gcc,
openssl,
pkg-config,
rustc,
}:
mkShell {
name = "eris";
packages = [
rust-analyzer
rustfmt
clippy
cargo
gcc
clippy
rustfmt
rustc
# For TLS and friends
openssl
pkg-config
];
}