upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/grasp-audit/flake.nix
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2025-11-04 06:36:04 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2025-11-04 06:36:04 +0000
commit31ed54dab458cb3c0a6472f3e508ccdc7a9b4d79 (patch)
tree59c4a3058236a14ac639f018b13b405a9fa50d84 /grasp-audit/flake.nix
parent001ca45e385c05b0eaa36d9879e051853aaff107 (diff)
moved to flakes
Diffstat (limited to 'grasp-audit/flake.nix')
-rw-r--r--grasp-audit/flake.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/grasp-audit/flake.nix b/grasp-audit/flake.nix
new file mode 100644
index 0000000..c7a80ef
--- /dev/null
+++ b/grasp-audit/flake.nix
@@ -0,0 +1,66 @@
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4 rust-overlay.url = "github:oxalica/rust-overlay";
5 flake-utils.url = "github:numtide/flake-utils";
6 };
7
8 outputs = { nixpkgs, rust-overlay, flake-utils, ... }:
9 flake-utils.lib.eachDefaultSystem (system:
10 let
11 overlays = [ (import rust-overlay) ];
12 pkgs = import nixpkgs { inherit system overlays; };
13 manifest = pkgs.lib.importTOML ./Cargo.toml;
14 in with pkgs; {
15 devShells.default = mkShell {
16 nativeBuildInputs = [
17 # Rust toolchain
18 rust-bin.stable.latest.default
19
20 # Build tools
21 pkg-config
22
23 # Development tools
24 gitlint
25 ];
26
27 buildInputs = [
28 # Required dependencies
29 openssl
30 ];
31
32 shellHook = ''
33 echo "🦀 GRASP Audit development environment loaded"
34 echo ""
35 echo "Available commands:"
36 echo " cargo build - Build the project"
37 echo " cargo test - Run unit tests"
38 echo " cargo test --ignored - Run integration tests (needs relay)"
39 echo " cargo run --example simple_audit - Run example"
40 echo ""
41 echo "Rust version: $(rustc --version)"
42 echo "Cargo version: $(cargo --version)"
43 echo ""
44 echo "For RUST_SRC_PATH (rust-analyzer):"
45 export RUST_SRC_PATH=${pkgs.rustPlatform.rustLibSrc}
46 '';
47 };
48
49 # Create package for the CLI binary
50 packages.default = pkgs.rustPlatform.buildRustPackage {
51 pname = manifest.package.name;
52 version = manifest.package.version;
53 src = ./.;
54 cargoLock = {
55 lockFile = ./Cargo.lock;
56 };
57 buildInputs = [
58 openssl
59 ];
60 nativeBuildInputs = [
61 pkg-config
62 ];
63 doCheck = false; # Tests require a running Nostr relay
64 };
65 });
66}