From 9f99a530a00b36af0349c07a2194a42683cb2e7d Mon Sep 17 00:00:00 2001 From: Arthur Noel Date: Tue, 26 Nov 2024 10:25:14 +0000 Subject: [PATCH] treefmt config: make global settings global --- module-options.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/module-options.nix b/module-options.nix index 7fa6081..ecbb60f 100644 --- a/module-options.nix +++ b/module-options.nix @@ -188,7 +188,6 @@ in unset PRJ_ROOT exec ${config.package}/bin/treefmt \ --config-file=${config.build.configFile} \ - --tree-root-file=${config.projectRootFile} \ "$@" ''; x = pkgs.writeShellScriptBin "treefmt" code; @@ -275,7 +274,12 @@ in # Config config.build = { - configFile = configFormat.generate "treefmt.toml" config.settings; + configFile = configFormat.generate "treefmt.toml" ( + (lib.removeAttrs config.settings [ "global" ]) + // config.settings.global // { + tree-root-file = config.projectRootFile; + } + ); devShell = pkgs.mkShell { nativeBuildInputs = [ config.build.wrapper ] ++ (lib.attrValues config.build.programs); };