flutter: Add platform artifact derivations to cacheDir passthru

This commit is contained in:
hacker1024
2023-12-21 11:46:14 +01:00
committed by Maciej Krüger
parent ef3625ff56
commit 17a034deaf
@@ -46,7 +46,7 @@
let
supportsLinuxDesktopTarget = builtins.elem "linux" supportedTargetPlatforms;
mkPlatformArtifacts = platform:
platformArtifacts = lib.genAttrs supportedTargetPlatforms (platform:
(callPackage ./artifacts/prepare-artifacts.nix {
src = callPackage ./artifacts/fetch-artifacts.nix {
inherit platform;
@@ -62,15 +62,16 @@ let
if builtins.pathExists ./artifacts/overrides/${platform}.nix
then callPackage ./artifacts/overrides/${platform}.nix { }
else ({ ... }: { })
);
));
cacheDir = symlinkJoin {
cacheDir = symlinkJoin rec {
name = "flutter-cache-dir";
paths = map mkPlatformArtifacts supportedTargetPlatforms;
paths = builtins.attrValues platformArtifacts;
postBuild = ''
mkdir -p "$out/bin/cache"
ln -s '${flutter}/bin/cache/dart-sdk' "$out/bin/cache"
'';
passthru.platform = platformArtifacts;
};
# By default, Flutter stores downloaded files (such as the Pub cache) in the SDK directory.