Browse Source

feat(format): add nixfmt formatter for Nix files (#6380)

ja 3 months ago
parent
commit
67ebe68160
1 changed files with 9 additions and 0 deletions
  1. 9 0
      packages/opencode/src/format/formatter.ts

+ 9 - 0
packages/opencode/src/format/formatter.ts

@@ -322,3 +322,12 @@ export const shfmt: Info = {
     return Bun.which("shfmt") !== null
   },
 }
+
+export const nixfmt: Info = {
+  name: "nixfmt",
+  command: ["nixfmt", "$FILE"],
+  extensions: [".nix"],
+  async enabled() {
+    return Bun.which("nixfmt") !== null
+  },
+}