treefmt.withConfig: define pname & propagate all files using symlinkJoin (#491479)
This commit is contained in:
@@ -15,26 +15,23 @@
|
||||
internal = true;
|
||||
};
|
||||
|
||||
config.result =
|
||||
pkgs.runCommand config.name
|
||||
{
|
||||
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
|
||||
env = {
|
||||
inherit (config) configFile;
|
||||
binPath = lib.makeBinPath config.runtimeInputs;
|
||||
};
|
||||
passthru = {
|
||||
inherit (config) runtimeInputs;
|
||||
inherit config options;
|
||||
};
|
||||
inherit (config.package) meta version;
|
||||
}
|
||||
''
|
||||
mkdir -p $out/bin
|
||||
makeWrapper \
|
||||
${lib.getExe config.package} \
|
||||
$out/bin/treefmt \
|
||||
--prefix PATH : "$binPath" \
|
||||
--add-flags "--config-file $configFile"
|
||||
'';
|
||||
config.result = pkgs.symlinkJoin {
|
||||
pname = config.name;
|
||||
inherit (config.package) meta version;
|
||||
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
|
||||
paths = [ config.package ];
|
||||
env = {
|
||||
inherit (config) configFile;
|
||||
binPath = lib.makeBinPath config.runtimeInputs;
|
||||
};
|
||||
passthru = {
|
||||
inherit (config) runtimeInputs;
|
||||
inherit config options;
|
||||
};
|
||||
postBuild = ''
|
||||
wrapProgram "$out/bin/treefmt" \
|
||||
--prefix PATH : "$binPath" \
|
||||
--add-flags "--config-file $configFile"
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user