2024-03-02 12:52:56 +01:00
|
|
|
{
|
2024-03-27 17:05:20 +01:00
|
|
|
apiEndpoint ? "http://localhost:3000",
|
2024-03-02 12:52:56 +01:00
|
|
|
fetchYarnDeps,
|
2024-03-27 17:05:20 +01:00
|
|
|
your_spotify,
|
|
|
|
mkYarnPackage,
|
|
|
|
prefetch-yarn-deps,
|
2024-04-24 01:00:57 +02:00
|
|
|
fixup-yarn-lock,
|
2024-03-04 21:10:01 +01:00
|
|
|
src,
|
2024-03-02 12:52:56 +01:00
|
|
|
version,
|
2024-03-06 13:04:44 +01:00
|
|
|
yarn,
|
2024-03-02 12:52:56 +01:00
|
|
|
}:
|
|
|
|
mkYarnPackage rec {
|
2024-03-04 21:10:01 +01:00
|
|
|
inherit version src;
|
2024-03-02 12:52:56 +01:00
|
|
|
pname = "your_spotify_client";
|
2024-03-27 17:05:20 +01:00
|
|
|
name = "your_spotify_client-${version}";
|
2024-03-02 12:52:56 +01:00
|
|
|
offlineCache = fetchYarnDeps {
|
|
|
|
yarnLock = src + "/yarn.lock";
|
2024-03-27 17:05:20 +01:00
|
|
|
hash = "sha256-5SgknaRVzgO2Dzc8MhAaM8UERWMv+PrItzevoWHbWnA=";
|
2024-03-02 12:52:56 +01:00
|
|
|
};
|
2024-03-06 13:04:44 +01:00
|
|
|
configurePhase = ''
|
|
|
|
runHook preConfigure
|
|
|
|
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
yarn config --offline set yarn-offline-mirror $offlineCache
|
|
|
|
fixup-yarn-lock yarn.lock
|
|
|
|
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
|
|
|
patchShebangs node_modules/
|
|
|
|
|
|
|
|
runHook postConfigure
|
|
|
|
'';
|
2024-03-02 12:52:56 +01:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
2024-03-06 13:04:44 +01:00
|
|
|
pushd ./apps/client/
|
2024-03-02 12:52:56 +01:00
|
|
|
yarn --offline run build
|
2024-03-27 17:05:20 +01:00
|
|
|
export API_ENDPOINT="${apiEndpoint}"
|
|
|
|
substituteInPlace scripts/run/variables.sh --replace-quiet '/app/apps/client/' "./"
|
|
|
|
|
|
|
|
chmod +x ./scripts/run/variables.sh
|
|
|
|
patchShebangs --build ./scripts/run/variables.sh
|
|
|
|
|
|
|
|
./scripts/run/variables.sh
|
|
|
|
|
2024-03-02 12:52:56 +01:00
|
|
|
popd
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
2024-04-24 01:00:57 +02:00
|
|
|
nativeBuildInputs = [fixup-yarn-lock yarn prefetch-yarn-deps];
|
2024-03-06 13:04:44 +01:00
|
|
|
|
2024-03-02 12:52:56 +01:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out
|
2024-03-06 13:04:44 +01:00
|
|
|
cp -r ./apps/client/build/* $out
|
2024-03-02 12:52:56 +01:00
|
|
|
'';
|
|
|
|
doDist = false;
|
2024-03-27 17:05:20 +01:00
|
|
|
meta = {
|
|
|
|
inherit (your_spotify.meta) homepage changelog description license maintainers;
|
|
|
|
};
|
2024-03-02 12:52:56 +01:00
|
|
|
}
|