feat: your spotify package

This commit is contained in:
Patrick 2024-02-29 20:57:46 +01:00
parent a5b62cd6ce
commit 31cf9afc9d
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
3 changed files with 49 additions and 0 deletions

View file

@ -3,6 +3,7 @@
(_self: super: {
zsh-histdb-skim = super.callPackage ./zsh-histdb-skim.nix {};
zsh-histdb = super.callPackage ./zsh-histdb.nix {};
your_spotify = super.callPackage ./your_spotify.nix {};
deploy = super.callPackage ./deploy.nix {};
minify = super.callPackage ./minify {};
awakened-poe-trade = super.callPackage ./awakened-poe-trade.nix {};

47
pkgs/your_spotify.nix Normal file
View file

@ -0,0 +1,47 @@
{
mkYarnPackage,
fetchFromGitHub,
fetchYarnDeps,
makeWrapper,
nodejs,
lib,
}: let
version = "1.7.3";
src_o = fetchFromGitHub {
owner = "Yooooomi";
repo = "your_spotify";
rev = "refs/tags/${version}";
hash = "sha256-/0xKktywwGcqsuwLytWBJ3O6ADHg1nP6BdMRlkW5ErY=";
};
in
mkYarnPackage rec {
inherit version;
pname = "your_spotify";
src = "${src_o}/server";
offlineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock";
hash = "sha256-3ZK+p3RoHHjPu53MLGSho7lEroZ77vUrZ2CjDwIUQTs=";
};
postPatch = ''
substituteInPlace tsconfig.json --replace '"extends": "../tsconfig.json",' ""
'';
buildPhase = ''
runHook preBuild
pushd ./deps/server
yarn --offline run build
popd
runHook postBuild
'';
nativeBuildInputs = [makeWrapper];
installPhase = ''
mkdir -p $out
cp -r $node_modules $out/node_modules
cp -r ./deps/server/{lib,package.json} $out
mkdir -p $out/bin
makeWrapper ${lib.escapeShellArg (lib.getExe nodejs)} "$out/bin/your_spotify_migrate" \
--add-flags "$out/lib/migrations.js"
makeWrapper ${lib.escapeShellArg (lib.getExe nodejs)} "$out/bin/your_spotify_server" \
--add-flags "$out/lib/bin/www.js"
'';
doDist = false;
}

1
result Symbolic link
View file

@ -0,0 +1 @@
/nix/store/12v2xd99cv1csqdgmjcfmx0k21yynbqc-server-1.7.3