From 778cb00a1fc9ef313613ec729454d8437d175162 Mon Sep 17 00:00:00 2001 From: Fabian Hauser Date: Thu, 20 Mar 2025 13:40:57 +0200 Subject: [PATCH] Switch formatting to nixfmt-tree --- checks/default.nix | 7 +------ dev-shells/default.nix | 2 +- flake.nix | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/checks/default.nix b/checks/default.nix index ae33fc0..85cce5e 100644 --- a/checks/default.nix +++ b/checks/default.nix @@ -9,12 +9,7 @@ ${system} = { # Check project formatting - format = pkgs.runCommand "nixfmt-check" { } '' - set -euo pipefail - cd ${self} - ${self.formatter.${system}}/bin/formatter . --check - mkdir $out - ''; + formatter = self.formatter.${system}; #TODO(#29): Integration/System tests diff --git a/dev-shells/default.nix b/dev-shells/default.nix index 0b238d5..19f3518 100644 --- a/dev-shells/default.nix +++ b/dev-shells/default.nix @@ -26,7 +26,7 @@ deploy-rs nixVersions.git nixd - nixfmt-rfc-style + nixfmt-tree nixos-anywhere ssh-to-age pssh diff --git a/flake.nix b/flake.nix index d9dae25..dbb924f 100644 --- a/flake.nix +++ b/flake.nix @@ -50,9 +50,7 @@ checks = import ./checks/default.nix importParams; deploy = import ./deploy/default.nix importParams; devShells = import ./dev-shells/default.nix importParams; - formatter.${system} = pkgs.writeShellScriptBin "formatter" '' - ${pkgs.findutils}/bin/find $1 -type f -name '*.nix' -exec ${pkgs.nixfmt-rfc-style}/bin/nixfmt ''${@:2} {} + - ''; + formatter.${system} = pkgs.nixfmt-tree; nixosConfigurations = import ./nixos-configurations/default.nix importParams; nixosModules = import ./nixos-modules/default.nix importParams; packages = import ./packages/default.nix importParams;