From f6bdc57f1ba08e58192c166132c21262b911a69a Mon Sep 17 00:00:00 2001 From: Yusuf Bera Ertan Date: Sat, 20 Jun 2020 14:11:24 +0300 Subject: [PATCH] nix: Add nixfmt package to shell.nix, update readme --- nix/README.md | 9 ++++++++- nix/default.nix | 2 +- nix/shell.nix | 1 + 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/nix/README.md b/nix/README.md index 53129a2e1e..c0828ac500 100644 --- a/nix/README.md +++ b/nix/README.md @@ -6,7 +6,7 @@ To build Voxygen, run: To build another binary, run: `nix build --arg crateName ""` -To enter the development shell, run: +To enter the development shell (which includes all tools mentioned in this readme), run: `nix-shell shell.nix` ### Managing Cargo.nix @@ -25,3 +25,10 @@ Enter the development shell in repository root: To update the dependencies, run: `niv update` + +### Formatting + +Use [nixfmt](https://github.com/serokell/nixfmt) to format files. + +To format every file: +`nixfmt *.nix` diff --git a/nix/default.nix b/nix/default.nix index e483a883c6..7814f52e37 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -1,6 +1,6 @@ { crateName ? "veloren-voxygen", # `crate2nix` doesn't support profiles in `Cargo.toml`, so default to release. Otherwise bad performance (non-release is built with opt level 0) -release ? true, sources, nixpkgsSrc }: +release ? true, sources ? import ./sources.nix { }, nixpkgsSrc ? }: let # Check if git-lfs is working. diff --git a/nix/shell.nix b/nix/shell.nix index 13f0f52ef6..b2f2b67959 100644 --- a/nix/shell.nix +++ b/nix/shell.nix @@ -9,6 +9,7 @@ in pkgs.mkShell { git git-lfs niv + nixfmt crate2nix rustup ];