Skip to content

Commit cb5e8f7

Browse files
authoredMar 1, 2024
build(nix): Introduce flake.formatter for nix fmt (ggml-org#5687)
* build(nix): Introduce flake.formatter for `nix fmt` * chore: Switch to pkgs.nixfmt-rfc-style
1 parent da3b9ba commit cb5e8f7

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed
 

‎.devops/nix/sif.nix

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}:
88

99
let
10-
optionalInt = cond: x: if cond then x else 0;
10+
optionalInt = cond: x: if cond then x else 0;
1111
in
1212
singularity-tools.buildImage rec {
1313
inherit (llama-cpp) name;

‎flake.nix

+7-3
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,12 @@
107107
# ```
108108
#
109109
# Cf. https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html?highlight=flake#flake-format
110-
flake.overlays.default =
111-
(final: prev: {
110+
flake.overlays.default = (
111+
final: prev: {
112112
llamaPackages = final.callPackage .devops/nix/scope.nix { inherit llamaVersion; };
113113
inherit (final.llamaPackages) llama-cpp;
114-
});
114+
}
115+
);
115116

116117
systems = [
117118
"aarch64-darwin"
@@ -131,6 +132,9 @@
131132
...
132133
}:
133134
{
135+
# For standardised reproducible formatting with `nix fmt`
136+
formatter = pkgs.nixfmt-rfc-style;
137+
134138
# Unlike `.#packages`, legacyPackages may contain values of
135139
# arbitrary types (including nested attrsets) and may even throw
136140
# exceptions. This attribute isn't recursed into by `nix flake

0 commit comments

Comments
 (0)
Please sign in to comment.