Adds vero at the package level as well as a nixos module and validator in the dvt clan service module. Adds remote-signer-dirk-interop to the nixos modules which is configurable with vero in the clan service.
80 lines
2.3 KiB
Nix
80 lines
2.3 KiB
Nix
{
|
|
lib,
|
|
callPackage,
|
|
writeShellApplication,
|
|
fetchFromGitHub,
|
|
python312,
|
|
rustPlatform,
|
|
cargo,
|
|
rustc,
|
|
uv2nix,
|
|
pyproject-nix,
|
|
pyproject-build-systems,
|
|
}:
|
|
let
|
|
version = "1.4.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "serenita-org";
|
|
repo = "vero";
|
|
rev = "v${version}";
|
|
hash = "sha256-LAUy79gPJGpU995t5e+2f+puW4GCKGUb4odg0nuu65U=";
|
|
};
|
|
|
|
workspace = uv2nix.lib.workspace.loadWorkspace { workspaceRoot = src; };
|
|
|
|
pythonSet = (callPackage pyproject-nix.build.packages { python = python312; }).overrideScope (
|
|
let
|
|
grandinePyOverlay = final: prev: {
|
|
grandine-py = prev.grandine-py.overrideAttrs (old: {
|
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
|
inherit (old) src;
|
|
hash = "sha256-l5ftG6r9NY15wqFeWpSN6OVUQhZ3JpQ7se+jjMqfetI=";
|
|
};
|
|
nativeBuildInputs =
|
|
(old.nativeBuildInputs or [ ])
|
|
++ [
|
|
final.maturin
|
|
]
|
|
++ [
|
|
# Inject rust dependencies not present in the pyproject-nix overrideScope.
|
|
rustPlatform.cargoSetupHook
|
|
cargo
|
|
rustc
|
|
];
|
|
# cargo tries to track usage in a global cache db under $HOME/.cargo,
|
|
# but the sandbox's $HOME is an unwritable placeholder; give it a
|
|
# real, writable CARGO_HOME instead.
|
|
preBuild = ''
|
|
export CARGO_HOME=$(mktemp -d)
|
|
''
|
|
+ (old.preBuild or "");
|
|
});
|
|
};
|
|
in
|
|
lib.composeManyExtensions [
|
|
pyproject-build-systems.overlays.default
|
|
(workspace.mkPyprojectOverlay { sourcePreference = "wheel"; })
|
|
grandinePyOverlay
|
|
]
|
|
);
|
|
|
|
# vero has no [build-system] of its own (not pip-installable), so there's no
|
|
# pythonSet package for pyproject-nix's util.mkApplication to trim a venv down
|
|
# to; this venv is already a lightweight symlink farm, not a copying one.
|
|
veroEnv = pythonSet.mkVirtualEnv "vero-env" workspace.deps.default;
|
|
in
|
|
writeShellApplication {
|
|
name = "vero";
|
|
text = ''
|
|
exec ${veroEnv}/bin/python ${src}/src/main.py "$@"
|
|
'';
|
|
meta = {
|
|
description = "Vero Ethereum multi-node validator client";
|
|
homepage = "https://github.com/serenita-org/vero";
|
|
license = lib.licenses.mit;
|
|
platforms = lib.platforms.linux;
|
|
mainProgram = "vero";
|
|
};
|
|
}
|