Skip to content

Commit

Permalink
chore(ops): make nix package for mina_txn_hasher
Browse files Browse the repository at this point in the history
nix-env -if ops/mina/mina_txn_hasher.nix
mina_txn_hasher.exe --help
  • Loading branch information
jhult committed Jan 29, 2025
1 parent 131f15e commit edb1f88
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ lint:
# standardrb --no-fix ops/*.rb
shellcheck tests/regression.bash
@echo "--- Linting Nix configs"
alejandra --check flake.nix
alejandra --check flake.nix ops/mina/mina_txn_hasher.nix
@echo "--- Linting Rust code"
cd rust && time cargo {{nightly_if_required}} fmt --all --check
cd rust && time cargo clippy --all-targets --all-features \
Expand All @@ -109,7 +109,7 @@ format:
cd rust && cargo {{nightly_if_required}} fmt --all
# standardrb --fix ops/*.rb
shfmt --write ops/*.sh
alejandra flake.nix
alejandra flake.nix ops/mina/mina_txn_hasher.nix

# Perform a fast verification of whether the source compiles.
check:
Expand Down
24 changes: 24 additions & 0 deletions ops/mina/mina_txn_hasher.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
with import <nixpkgs> {}; let
deps = [
jemalloc
openssl
libffi
gmp
gcc.cc.lib
];
in
stdenv.mkDerivation {
name = "mina_txn_hasher";
src = ./.;

dontConfigure = true;
dontBuild = true;

nativeBuildInputs = [autoPatchelfHook];
buildInputs = deps;

installPhase = ''
mkdir -p $out/bin
install -Dm755 mina_txn_hasher.exe $out/bin/mina_txn_hasher.exe
'';
}

0 comments on commit edb1f88

Please sign in to comment.