Closed KaiserKarel closed 1 year ago
@gkze can you take a look since you introduced it in https://github.com/numtide/treefmt-nix/pull/73?
Something like this should fix it, but I don't have the environment to test it.
diff --git a/programs/dprint.nix b/programs/dprint.nix
index 0c64eec..54453b2 100644
--- a/programs/dprint.nix
+++ b/programs/dprint.nix
@@ -93,7 +93,7 @@ in
configFile = mkConfigFile { config = cfg.config; };
x = pkgs.writeShellScriptBin "dprint" ''
set -euo pipefail
- exec dprint --config=${configFile} "$@"
+ exec ${lib.getExe config.package} --config=${configFile} "$@"
'';
in
(x // { meta = config.package.meta // x.meta; });
I got it working on my target repo with cfg.package
(config.package
is treefmt
), not sure how else I could test it
Describe the bug
I added dprint to my flake.nix:
Calling
nix fmt
then fails with/nix/store/r4r6inyjds6ac9s3jjg398hi52v8i7ip-dprint/bin/dprint: line 3: exec: dprint: not found
System information
This is on aarch64-darwin, but also occurs on other architectures.
my flake.lock entry is:
And my input is: