Change-Id: I3116d3f397ba309be2418e188327143c7187b789 Reviewed-on: https://cl.snix.dev/c/snix/+/30235 Reviewed-by: Florian Klink <flokli@flokli.de> Tested-by: besadii Reviewed-by: Paul Meyer <katexochen0@gmail.com> Autosubmit: Paul Meyer <katexochen0@gmail.com>
1.9 KiB
| title | slug | description | summary | date | lastmod | draft | weight | toc |
|---|---|---|---|---|---|---|---|---|
| Building Snix | building | 2025-03-14T14:14:35+01:00 | 2025-03-14T14:14:35+01:00 | false | 11 | true |
This document describes how to build the project locally, both for interactive development as well as referring to it from Nix code (for example, to run one of its binaries on your machine).
{{}} Please check the [Contribution Guide]({{< relref "contributing" >}}) on how to contribute after following this guide. {{}}
Requirements
- Ensure you have Direnv installed and hooked into your shell.
- Ensure you have Nix installed.
Getting the sources
Snix is hosted in its own Forgejo instance, hosted on git.snix.dev, and a (read-only) mirror on GitHub.
Check out the source code as follows:
$ git clone https://git.snix.dev/snix/snix.git
Interactive development
$ direnv allow
$ mg shell //snix:shell
This provides all the necessary tools and dependencies to interactively build
the source code, using cargo build etc.
Building only
It is also possible to build the different Snix crates with Nix, in which you don't need to enter the shell. From the root of the repository, you can build as follows:
$ nix-build -A snix.cli
Alternatively, you can use the mg wrapper from anywhere in the repository (requires the direnv setup from above):
$ mg build //snix:cli
This uses crate2nix to build each crate dependency individually.
Checkout the [Component Overview]({{< ref "/docs/components/overview" >}}) to learn more about the project structure.