veloren/nix
2020-11-29 16:59:13 +03:00
..
Cargo.nix fix and improve nix build: actually output a proper veloren voxygen package now 2020-11-25 02:00:50 +03:00
common.nix nix: auto setup cachix cache, do git-lfs check in Nix, link assets dir directly (no assets package) and other minor improvements 2020-11-29 02:02:46 +03:00
crate-hashes.json fix and improve nix build: actually output a proper veloren voxygen package now 2020-11-25 02:00:50 +03:00
default.nix nix: auto setup cachix cache, do git-lfs check in Nix, link assets dir directly (no assets package) and other minor improvements 2020-11-29 02:02:46 +03:00
README.md nix: auto setup cachix cache, do git-lfs check in Nix, link assets dir directly (no assets package) and other minor improvements 2020-11-29 02:02:46 +03:00
shell.nix nix: add git-lfs setup to shell hook for dev shell 2020-11-29 16:59:13 +03:00
sources.json fix and improve nix build: actually output a proper veloren voxygen package now 2020-11-25 02:00:50 +03:00
sources.nix fix and improve nix build: actually output a proper veloren voxygen package now 2020-11-25 02:00:50 +03:00

How to use

To enter the development shell (which includes all tools mentioned in this readme + tools you'll need to develop Veloren), run:

nix-shell nix/shell.nix

It is recommended that you enter the dev shell before starting to build using nix-build or nix-env (anything which build stuff), since it will setup a Cachix cache for you. (you can configure this for your user's nix.conf by running cachix use veloren-nix once in the dev shell, which will make the cache available when you run commands outside of the dev shell).

To build and install Voxygen and the server CLI into user profile, run:

nix-env -f nix/default.nix -i

You can configure what to install by changing the cratesToBuild argument:

nix-env -f nix/default.nix --arg cratesToBuild '["veloren-voxygen"]'

For example, this will install Voxygen only.

You can configure the crates to be built with debug mode (not recommended, equals to opt-level = 0):

nix-env -f nix/default.nix --arg release false

Managing Cargo.nix

Enter the development shell.

To update Cargo.nix (and crate-hashes.json) using latest Cargo.lock, run:

crate2nix generate -f ../Cargo.toml

Managing dependencies

We use niv to manage dependencies.

To update the dependencies, run (from repository root):

niv update

Formatting

Use nixfmt to format files.

To format every Nix file in current working directory:

nixfmt *.nix