We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ce65379 + b0731a2 commit 3ba936cCopy full SHA for 3ba936c
nix/packages/treefmt/default.nix
@@ -74,7 +74,19 @@ in
74
75
passthru = let
76
inherit (perSystem.self) treefmt;
77
+
78
+ # Inherits an attr from pkgs.treefmt, overriding the `treefmt` arg if possible
79
+ inheritFromNixpkgs = name: let
80
+ error = "Accessing `${name}` requires a nixpkgs revision that has `treefmt.${name}`.";
81
+ attr = pkgs.treefmt.${name} or (throw error);
82
+ in
83
+ if attr.override.__functionArgs.treefmt or null != null
84
+ then attr.override {inherit treefmt;}
85
+ else attr;
86
in {
87
+ withConfig = inheritFromNixpkgs "withConfig";
88
+ buildConfig = inheritFromNixpkgs "buildConfig";
89
90
no-vendor-hash = treefmt.overrideAttrs {
91
vendorHash = "";
92
};
0 commit comments