diff options
author | Rebecca Turner <rbt@sent.as> | 2024-04-04 16:11:37 -0700 |
---|---|---|
committer | Rebecca Turner <rbt@sent.as> | 2024-04-08 09:42:34 -0700 |
commit | b3233405381b50c7f7eb87d7962b25a06d16be44 (patch) | |
tree | e720ef2064ce51531d44eedd4b20cb409b83e3f2 /flake.nix | |
parent | e55fc5af715020d79ec91c856447303737bf3015 (diff) |
Add `nixfmt`
Change-Id: I7f21695e3971cfd02b2cce0dd016ff6eb3389905
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -71,6 +71,9 @@ }; overlays = [ (overlayFor (p: p.${stdenv})) + (final: prev: { + nixfmt = final.callPackage ./nix-support/nixfmt.nix {}; + }) ]; config.permittedInsecurePackages = [ "nix-2.13.6" ]; @@ -296,7 +299,11 @@ }; treefmt = { enable = true; - settings.formatters = [ ]; + settings.formatters = + let + pkgs = nixpkgsFor.${system}.native; + in + [ pkgs.nixfmt ]; }; }; }) pre-commit-hooks.lib; @@ -366,7 +373,7 @@ }).overrideAttrs (prev: { # Required for clang-tidy checks buildInputs = prev.buildInputs - ++ [ pkgs.just ] + ++ [ pkgs.just pkgs.nixfmt ] ++ lib.optional (pre-commit ? enabledPackages) pre-commit.enabledPackages ++ lib.optionals (stdenv.cc.isClang) [ pkgs.llvmPackages.llvm pkgs.llvmPackages.clang-unwrapped.dev ]; nativeBuildInputs = prev.nativeBuildInputs |