From f21038a0a1fb4a81e0d7528cb975e1b4030c5e8c Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Sun, 13 Apr 2025 20:42:13 +0100 Subject: [PATCH] treefmt.buildConfig: fix accidental shadowing of `type` By inheriting `type` from the settings-configuration, we are shadowing `type = "derivation"`. This means you cannot directly build the derivation using `:b` in the repl, `nix-build`, or `nix build`. This didn't affect `treefmt.withConfig`, because the derivation is built transitively in that scenario, so `type` isn't checked. --- pkgs/by-name/tr/treefmt/build-config.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/tr/treefmt/build-config.nix b/pkgs/by-name/tr/treefmt/build-config.nix index 65fe7ca8f089..c4eb298a051c 100644 --- a/pkgs/by-name/tr/treefmt/build-config.nix +++ b/pkgs/by-name/tr/treefmt/build-config.nix @@ -24,6 +24,7 @@ settingsFile.overrideAttrs { passthru = { format = settingsFormat; settings = configuration.config; - inherit (configuration) _module options type; + inherit (configuration) _module options; + optionType = configuration.type; }; }