diff options
Diffstat (limited to 'pkgs/applications/audio/youtube-music/default.nix')
-rw-r--r-- | pkgs/applications/audio/youtube-music/default.nix | 52 |
1 files changed, 6 insertions, 46 deletions
diff --git a/pkgs/applications/audio/youtube-music/default.nix b/pkgs/applications/audio/youtube-music/default.nix index 642ba8e3fc0ff..32a94f4eb7ce4 100644 --- a/pkgs/applications/audio/youtube-music/default.nix +++ b/pkgs/applications/audio/youtube-music/default.nix @@ -4,12 +4,9 @@ , electron , python3 , stdenv -, stdenvNoCC , copyDesktopItems -, moreutils -, cacert -, jq -, nodePackages +, nodejs +, pnpm , makeDesktopItem }: @@ -24,54 +21,17 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-nxpctEG4XoxW6jOAxGdgTEYr6YnhFRR8+5HUQLxRJB0="; }; - pnpmDeps = stdenvNoCC.mkDerivation { - pname = "${finalAttrs.pname}-pnpm-deps"; - inherit (finalAttrs) src version ELECTRON_SKIP_BINARY_DOWNLOAD; - - nativeBuildInputs = [ jq moreutils nodePackages.pnpm cacert ]; - - installPhase = '' - export HOME=$(mktemp -d) - - pnpm config set store-dir $out - pnpm install --frozen-lockfile --ignore-script - - rm -rf $out/v3/tmp - for f in $(find $out -name "*.json"); do - sed -i -E -e 's/"checkedAt":[0-9]+,//g' $f - jq --sort-keys . $f | sponge $f - done - ''; - - dontBuild = true; - dontFixup = true; - outputHashMode = "recursive"; - outputHash = { - x86_64-linux = "sha256-bujlQxP6Lr3qPUDxYXKyb702ZJY/xbuCsu3wVDhcb+8="; - aarch64-linux = "sha256-0kyjjttpXpFVhdza5NAjGrRn++qc/N5/u2dQl7VufLE="; - x86_64-darwin = "sha256-Q37QJt/mhfpSguOlkJGKFTCrIOrpbG3OBwaD/Bg09Us="; - aarch64-darwin = "sha256-wbfjzoGa/6vIlOOVX3bKNQ2uxzph3WSofo3MGXqA6yQ="; - }.${stdenv.system} or (throw "Unsupported system: ${stdenv.system}"); + pnpmDeps = pnpm.fetchDeps { + inherit (finalAttrs) pname version src; + hash = "sha256-8oeloQYiwUy+GDG4R+XtiynT+8Fad4WYFWTO1KANZKQ="; }; - nativeBuildInputs = [ makeWrapper python3 nodePackages.pnpm nodePackages.nodejs ] + nativeBuildInputs = [ makeWrapper python3 nodejs pnpm.configHook ] ++ lib.optionals (!stdenv.isDarwin) [ copyDesktopItems ]; ELECTRON_SKIP_BINARY_DOWNLOAD = 1; - preBuild = '' - export HOME=$(mktemp -d) - export STORE_PATH=$(mktemp -d) - - cp -Tr "$pnpmDeps" "$STORE_PATH" - chmod -R +w "$STORE_PATH" - - pnpm config set store-dir "$STORE_PATH" - pnpm install --offline --frozen-lockfile --ignore-script - patchShebangs node_modules/{*,.*} - ''; - postBuild = lib.optionalString stdenv.isDarwin '' cp -R ${electron}/Applications/Electron.app Electron.app chmod -R u+w Electron.app |