Skip to content

2. How BioNix Works

aaaaaaarya edited this page Jan 26, 2024 · 22 revisions

Why Nix?

There are several reasons of why Nix is preferred for virus breakend instead of Bash.

  1. Library and Tools: BioNix is a layer of library and tools and common steps ordered in a way that every steps is functions.
  2. Functional aspect: The workflow and functioning composition is very nice to work with and very clean
  3. Determinism and Reproducibility: BioNix by its design put all things in nix store so that the side effects are managed carefully.
  4. Nix Store: Because once we built it, it will be stored in nix store. Nix could easily built it so that we do not need to build over and over again.
  5. Different Versions Compatibility: Easier to call different versions so it avoids mistake of choosing wrong kraken2 version.
  6. Handling Bitrot: NixOS and Nix packages offer features that help handle or mitigate bitrot, ensuring the integrity of your data over time.

How Nix Builds

Below is a high-level overview of how Nix build and several important definition listed below.

  • Build input: Necessary software, dependencies, etc. that is needed to build a desired output (e.g. kraken2)
  • Build plan: Processes build input to a desired output
  • Language evaluator: Translates Nix expressions to language the computer can understand

image

Nix build in recursive manner as illustrated in below diagram. Nix will recursively find dependencies in Nix Store. Once cache is found in Nix Store then it will stop finding dependencies. Or, if dependencies is not found in caches, then it will be build from scratch to be added into Nix Store. image

Resources

A further deatails on syntax on how Nix builds can be found in the following resources.

Clone this wiki locally