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.
This commit is contained in:
Attila Oláh
2026-07-19 10:14:24 +02:00
parent ac39be6b62
commit 73aef4d010
+14 -5
View File
@@ -6,20 +6,27 @@
flake-utils.url = "github:numtide/flake-utils"; flake-utils.url = "github:numtide/flake-utils";
}; };
outputs = { self, nixpkgs, flake-utils }: outputs = {
flake-utils.lib.eachDefaultSystem (system: self,
let nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = import nixpkgs {inherit system;}; pkgs = import nixpkgs {inherit system;};
# Python with the packages needed by the offline converter tools # Python with the packages needed by the offline converter tools
pythonEnv = pkgs.python3.withPackages (ps: with ps; [ pythonEnv = pkgs.python3.withPackages (
ps:
with ps; [
torch torch
safetensors safetensors
huggingface-hub huggingface-hub
numpy numpy
tokenizers tokenizers
datasets datasets
]); ]
);
colibri = pkgs.stdenv.mkDerivation { colibri = pkgs.stdenv.mkDerivation {
pname = "colibri"; pname = "colibri";
@@ -107,6 +114,8 @@
}; };
}; };
formatter = (import nixpkgs {inherit system;}).alejandra;
devShells.default = pkgs.mkShell { devShells.default = pkgs.mkShell {
inputsFrom = [colibri]; inputsFrom = [colibri];