diff options
Diffstat (limited to 'pkgs/by-name/yo/your_spotify/client.nix')
-rw-r--r-- | pkgs/by-name/yo/your_spotify/client.nix | 59 |
1 files changed, 22 insertions, 37 deletions
diff --git a/pkgs/by-name/yo/your_spotify/client.nix b/pkgs/by-name/yo/your_spotify/client.nix index 420498821bf93..4453d39886216 100644 --- a/pkgs/by-name/yo/your_spotify/client.nix +++ b/pkgs/by-name/yo/your_spotify/client.nix @@ -1,49 +1,36 @@ { - apiEndpoint ? "http://localhost:3000", - fetchYarnDeps, - your_spotify, - mkYarnPackage, - fixup-yarn-lock, + stdenv, src, version, - yarn, + meta, + offlineCache, + apiEndpoint ? "http://localhost:3000", + yarnConfigHook, + yarnBuildHook, + nodejs }: -mkYarnPackage rec { - inherit version src; + +stdenv.mkDerivation (finalAttrs: { pname = "your_spotify_client"; - name = "your_spotify_client-${version}"; - packageJSON = ./package.json; - offlineCache = fetchYarnDeps { - yarnLock = src + "/yarn.lock"; - hash = "sha256-5SgknaRVzgO2Dzc8MhAaM8UERWMv+PrItzevoWHbWnA="; - }; - configurePhase = '' - runHook preConfigure + inherit version src offlineCache; - 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/ + nativeBuildInputs = [ + yarnConfigHook + yarnBuildHook + nodejs + ]; - runHook postConfigure - ''; - buildPhase = '' - runHook preBuild + API_ENDPOINT="${apiEndpoint}"; + preBuild = '' pushd ./apps/client/ - yarn --offline run build - export API_ENDPOINT="${apiEndpoint}" + ''; + postBuild = '' 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 - popd - runHook postBuild ''; - nativeBuildInputs = [yarn fixup-yarn-lock]; installPhase = '' runHook preInstall @@ -51,8 +38,6 @@ mkYarnPackage rec { cp -r ./apps/client/build/* $out runHook postInstall ''; - doDist = false; - meta = { - inherit (your_spotify.meta) homepage changelog description license maintainers; - }; -} + + inherit meta; +}) |