This is a fork of VERICA with added Nix/Flake support for reproducible builds and easy integration into other Nix-based projects.
For full documentation on VERICA itself (features, configuration, usage), see README_upstream.md.
Merged from upstream PR #5 (still open upstream):
- Fixed shift overflow checks and changed integer literal types to
ull - Relocated size validation check to execute after virtual probes are incorporated
- Adapted variable type for loops over
extended_probes.size()to allow probe sizes up to 63
default.nix: Nix derivation that builds verica and installs runtime data files (model/,cell/) to$out/share/verica/flake.nix: Flake interface exposing the package and development shellshell.nix: Development shell (works with bothnix-shellandnix develop)
# Build the package
nix build
# Enter development shell
nix develop
# or with legacy nix-shell
nix-shell
# In dev shell, build manually
make releaseAdd this repository as a flake input in your project:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
verica.url = "github:FelixUhle/VERICA";
};
outputs = { self, nixpkgs, verica, ... }:
let
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
vericaPkg = verica.packages.${system}.default;
in {
devShells.${system}.default = pkgs.mkShell {
packages = [ vericaPkg ];
# Create symlinks to verica data files for config compatibility
shellHook = ''
mkdir -p verica
ln -sfn ${vericaPkg.modelDir} verica/model
ln -sfn ${vericaPkg.cellDir} verica/cell
'';
};
};
}VERICA requires model and cell library files at runtime. These are installed to the Nix store and exposed via passthru:
| Attribute | Path |
|---|---|
vericaPkg.dataDir |
/nix/store/...-verica/share/verica |
vericaPkg.modelDir |
/nix/store/...-verica/share/verica/model |
vericaPkg.cellDir |
/nix/store/...-verica/share/verica/cell |
The shellHook above creates symlinks in your project directory, so you can use simple relative paths in your verica.json:
{
"general": {
"library": { "file": "verica/cell/nang45.txt", "name": "NANG45" },
"filtering": {
"sca": { "whitelist": "verica/model/sca-whitelist" }
}
},
"fault-injection": {
"model": { "mapping": "verica/model/setreset.txt" }
}
}Add the symlink directory to your .gitignore:
verica/
- The build preserves
-march=nativefor performance (breaks Nix reproducibility but gives better runtime performance) - The hardcoded CI boost path is patched out; Nix provides boost via
buildInputs