diff --git a/flake.nix b/flake.nix
index 963058f..1adf6f0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -60,9 +60,10 @@
           inputs.treefmt-nix.flakeModule
           ./effect.nix
           ./shell.nix
-          ./treefmt.nix
         ];
 
+        perSystem.treefmt.imports = [ ./treefmt.nix ];
+
         flake.nixosConfigurations =
           let
             inherit (inputs.nixpkgs.lib) nixosSystem;
diff --git a/treefmt.nix b/treefmt.nix
index bfa4a97..c8bd0be 100644
--- a/treefmt.nix
+++ b/treefmt.nix
@@ -1,54 +1,50 @@
-{
-  perSystem = { pkgs, ... }: {
-    treefmt = {
-      # Used to find the project root
-      projectRootFile = "flake.lock";
+{ pkgs, ... }: {
+  # Used to find the project root
+  projectRootFile = "flake.lock";
 
-      programs.hclfmt.enable = true;
+  programs.hclfmt.enable = true;
 
-      programs.prettier.enable = true;
+  programs.prettier.enable = true;
 
-      settings.formatter = {
-        nix = {
-          command = "sh";
-          options = [
-            "-eucx"
-            ''
-              for i in "$@"; do
-                ${pkgs.lib.getExe pkgs.statix} fix "$i"
-              done
+  settings.formatter = {
+    nix = {
+      command = "sh";
+      options = [
+        "-eucx"
+        ''
+          for i in "$@"; do
+            ${pkgs.lib.getExe pkgs.statix} fix "$i"
+          done
 
-              ${pkgs.lib.getExe pkgs.nixpkgs-fmt} "$@"
-            ''
-            "--"
-          ];
-          includes = [ "*.nix" ];
-          excludes = [
-            "nix/sources.nix"
-            # vendored from external source
-            "build02/packages-with-update-script.nix"
-          ];
-        };
+          ${pkgs.lib.getExe pkgs.nixpkgs-fmt} "$@"
+        ''
+        "--"
+      ];
+      includes = [ "*.nix" ];
+      excludes = [
+        "nix/sources.nix"
+        # vendored from external source
+        "build02/packages-with-update-script.nix"
+      ];
+    };
 
-        prettier = {
-          excludes = [
-            "secrets.yaml"
-          ];
-        };
+    prettier = {
+      excludes = [
+        "secrets.yaml"
+      ];
+    };
 
-        python = {
-          command = "sh";
-          options = [
-            "-eucx"
-            ''
-              ${pkgs.lib.getExe pkgs.ruff} --fix "$@"
-              ${pkgs.lib.getExe pkgs.python3.pkgs.black} "$@"
-            ''
-            "--" # this argument is ignored by bash
-          ];
-          includes = [ "*.py" ];
-        };
-      };
+    python = {
+      command = "sh";
+      options = [
+        "-eucx"
+        ''
+          ${pkgs.lib.getExe pkgs.ruff} --fix "$@"
+          ${pkgs.lib.getExe pkgs.python3.pkgs.black} "$@"
+        ''
+        "--" # this argument is ignored by bash
+      ];
+      includes = [ "*.py" ];
     };
   };
 }