]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
build(nix): Introduce flake.formatter for `nix fmt` (#5687)
authorTushar <redacted>
Fri, 1 Mar 2024 23:18:26 +0000 (04:48 +0530)
committerGitHub <redacted>
Fri, 1 Mar 2024 23:18:26 +0000 (15:18 -0800)
* build(nix): Introduce flake.formatter for `nix fmt`
* chore: Switch to pkgs.nixfmt-rfc-style

.devops/nix/sif.nix
flake.nix

index 7535ca0f3088e318e49c08f5c954b25acddc5213..7a5e1dd0ffc4c61e9b88b25d14a10afbd4f8cda9 100644 (file)
@@ -7,7 +7,7 @@
 }:
 
 let
-    optionalInt = cond: x: if cond then x else 0;
+  optionalInt = cond: x: if cond then x else 0;
 in
 singularity-tools.buildImage rec {
   inherit (llama-cpp) name;
index dc4e503c330618f20a8f60316409b65e31a8795f..45f9deda0beec073f3c440eb3bd702d68611d284 100644 (file)
--- a/flake.nix
+++ b/flake.nix
         # ```
         #
         # Cf. https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html?highlight=flake#flake-format
-        flake.overlays.default =
-          (final: prev: {
+        flake.overlays.default = (
+          final: prev: {
             llamaPackages = final.callPackage .devops/nix/scope.nix { inherit llamaVersion; };
             inherit (final.llamaPackages) llama-cpp;
-          });
+          }
+        );
 
         systems = [
           "aarch64-darwin"
             ...
           }:
           {
+            # For standardised reproducible formatting with `nix fmt`
+            formatter = pkgs.nixfmt-rfc-style;
+
             # Unlike `.#packages`, legacyPackages may contain values of
             # arbitrary types (including nested attrsets) and may even throw
             # exceptions. This attribute isn't recursed into by `nix flake