Skip to content

Commit

Permalink
build(nix): Introduce flake.formatter for nix fmt (ggerganov#5687)
Browse files Browse the repository at this point in the history
* build(nix): Introduce flake.formatter for `nix fmt`
* chore: Switch to pkgs.nixfmt-rfc-style
  • Loading branch information
ditsuke authored Mar 1, 2024
1 parent da3b9ba commit cb5e8f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .devops/nix/sif.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 7 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,12 @@
# ```
#
# 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"
Expand All @@ -131,6 +132,9 @@
...
}:
{
# 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
Expand Down

0 comments on commit cb5e8f7

Please sign in to comment.