From 73aef4d010366418c74a5b5c2f737c0c530bf7bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Ol=C3=A1h?= Date: Sun, 19 Jul 2026 10:14:24 +0200 Subject: [PATCH] nix: configure and apply a formatter This sets the formatter to alejandra. I was trying to stay as close as the original as I could; otherwise we could set it to `nixfmt` which would keep list spacing more similar, but would introduce additional indentation in a few places. --- flake.nix | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/flake.nix b/flake.nix index 04d3133..a63839a 100644 --- a/flake.nix +++ b/flake.nix @@ -6,20 +6,27 @@ flake-utils.url = "github:numtide/flake-utils"; }; - outputs = { self, nixpkgs, flake-utils }: - flake-utils.lib.eachDefaultSystem (system: - let - pkgs = import nixpkgs { inherit system; }; + outputs = { + self, + nixpkgs, + flake-utils, + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs {inherit system;}; # Python with the packages needed by the offline converter tools - pythonEnv = pkgs.python3.withPackages (ps: with ps; [ - torch - safetensors - huggingface-hub - numpy - tokenizers - datasets - ]); + pythonEnv = pkgs.python3.withPackages ( + ps: + with ps; [ + torch + safetensors + huggingface-hub + numpy + tokenizers + datasets + ] + ); colibri = pkgs.stdenv.mkDerivation { pname = "colibri"; @@ -28,7 +35,7 @@ # python3 is needed by checkPhase: `make test-c` shells out to # `python3 tools/run_tests.py` (see c/Makefile, PYTHON ?= python3). - nativeBuildInputs = [ pkgs.makeWrapper pkgs.python3 ]; + nativeBuildInputs = [pkgs.makeWrapper pkgs.python3]; buildInputs = [ pkgs.gcc @@ -107,14 +114,16 @@ }; }; + formatter = (import nixpkgs {inherit system;}).alejandra; + devShells.default = pkgs.mkShell { - inputsFrom = [ colibri ]; + inputsFrom = [colibri]; packages = [ pythonEnv pkgs.gcc pkgs.gnumake - pkgs.clang-tools # clangd / clang-tidy for IDE support + pkgs.clang-tools # clangd / clang-tidy for IDE support pkgs.pkg-config ];