feat: your spotify package
This commit is contained in:
parent
a5b62cd6ce
commit
31cf9afc9d
|
@ -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
47
pkgs/your_spotify.nix
Normal 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;
|
||||
}
|
Loading…
Reference in a new issue