放弃misskey打包

This commit is contained in:
陈浩南 2023-08-21 21:23:02 +08:00
parent 52682a88c8
commit 74790adf51
6 changed files with 57 additions and 119 deletions

View File

@ -280,6 +280,24 @@
"type": "github"
}
},
"flake-utils_6": {
"inputs": {
"systems": "systems_7"
},
"locked": {
"lastModified": 1685518550,
"narHash": "sha256-o2d0KcvaXzTrPRIo0kOLV0/QXHhDQ5DTi+OxcjO8xqY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "a1720a10a6cfe8234c0e93907ffe81be440f4cef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"haskell-flake": {
"locked": {
"lastModified": 1684780604,
@ -660,6 +678,27 @@
"type": "github"
}
},
"pnpm2nix-nzbr": {
"inputs": {
"flake-utils": "flake-utils_6",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1692020623,
"narHash": "sha256-BYaSUmi/5LWcXQLXrhHbufO2rSVBKSoK1MLcHjuFpl8=",
"owner": "nzbr",
"repo": "pnpm2nix-nzbr",
"rev": "00e3722ebb689a9f18b90f27306f798e98ef9e5b",
"type": "github"
},
"original": {
"owner": "nzbr",
"repo": "pnpm2nix-nzbr",
"type": "github"
}
},
"qchem": {
"inputs": {
"nixpkgs": [
@ -697,6 +736,7 @@
"nixpkgs-stable": "nixpkgs-stable",
"nur": "nur",
"nur-xddxdd": "nur-xddxdd",
"pnpm2nix-nzbr": "pnpm2nix-nzbr",
"qchem": "qchem",
"sops-nix": "sops-nix",
"touchix": "touchix"
@ -815,6 +855,21 @@
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"touchix": {
"inputs": {
"nixpkgs": [

View File

@ -25,6 +25,7 @@
napalm = { url = "github:nix-community/napalm"; inputs.nixpkgs.follows = "nixpkgs"; };
nixpak = { url = "github:nixpak/nixpak"; inputs.nixpkgs.follows = "nixpkgs"; };
deploy-rs = { url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; };
pnpm2nix-nzbr = { url = "github:nzbr/pnpm2nix-nzbr"; inputs.nixpkgs.follows = "nixpkgs"; };
};
outputs = inputs:

View File

@ -6,6 +6,5 @@
vesta = callPackage ./vesta {};
oneapi = callPackage ./oneapi {};
send = callPackage ./send {};
misskey = callPackage ./misskey {};
rsshub = callPackage ./rsshub {};
}

View File

@ -1,93 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchYarnDeps
, fixup_yarn_lock
, yarn
, nodejs
, python3
, pkg-config
, glib
, vips
}:
let
version = "12.108.1";
src = fetchFromGitHub {
owner = "misskey-dev";
repo = "misskey";
rev = version;
sha256 = "sha256-NTspyTNy3cqc43+YLeCKRR46D7BvtIWoNCmwgqykHgs=";
};
deps = fetchYarnDeps {
yarnLock = "${src}/yarn.lock";
sha256 = "sha256-1NEeuBVp5e7RtFzYeT4nTGxGs2oeTxqiz20pEZXmcbo=";
};
backendDeps = fetchYarnDeps {
yarnLock = "${src}/packages/backend/yarn.lock";
sha256 = "sha256-G01hkYthBCZnsvPNaTIXSgTN9/1inJXhh34umxfxUsc=";
};
clientDeps = fetchYarnDeps {
yarnLock = "${src}/packages/client/yarn.lock";
sha256 = "sha256-LwGjqHN59KditL3igVP1/TZ7cZSbrZopOl9A0c1nlW8=";
};
in stdenv.mkDerivation {
pname = "misskey";
inherit version src;
nativeBuildInputs = [ fixup_yarn_lock yarn nodejs python3 pkg-config ];
buildInputs = [ glib vips ];
buildPhase = ''
export HOME=$PWD
export NODE_ENV=production
# Build node modules
fixup_yarn_lock yarn.lock
fixup_yarn_lock packages/backend/yarn.lock
fixup_yarn_lock packages/client/yarn.lock
yarn config --offline set yarn-offline-mirror ${deps}
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
(
cd packages/backend
yarn config --offline set yarn-offline-mirror ${backendDeps}
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
)
(
cd packages/client
yarn config --offline set yarn-offline-mirror ${clientDeps}
yarn install --offline --frozen-lockfile --ignore-engines --ignore-scripts --no-progress
)
patchShebangs node_modules
patchShebangs packages/backend/node_modules
patchShebangs packages/client/node_modules
(
cd packages/backend/node_modules/re2
npm_config_nodedir=${nodejs} npm run rebuild
)
(
cd packages/backend/node_modules/sharp
npm_config_nodedir=${nodejs} ../.bin/node-gyp rebuild
)
yarn build
'';
installPhase = ''
mkdir -p $out/packages/client
ln -s /var/lib/misskey $out/files
ln -s /run/misskey $out/.config
cp -r locales node_modules built $out
cp -r packages/backend $out/packages/backend
cp -r packages/client/assets $out/packages/client/assets
'';
meta = with lib; {
description = "Interplanetary microblogging platform. 🚀";
homepage = "https://misskey-hub.net/";
license = licenses.agpl3;
maintainers = with maintainers; [ yuka kloenk ];
platforms = platforms.unix;
};
}

View File

@ -1,25 +0,0 @@
{ lib, mkYarnPackage, fetchFromGitHub }:
mkYarnPackage
{
pname = "misskey";
version = "13.14.2";
src = fetchFromGitHub
{
owner = "CHN-beta";
repo = "misskey";
rev = "8b3920502fd8060e498276c985cd58a0ed86b5df";
hash = "sha256-P67D2WAcm44CfeSoeD6/kcQP27C59Hm/htD+gmyn8FE=";
fetchSubmodules = true;
};
configurePhase =
''
cp -r $node_modules node_modules
'';
buildPhase =
''
runHook preBuild
# yarn install --frozen-lockfile --offline
NODE_ENV=production yarn build --offline
runHook postBuild
'';
}

View File

@ -19,6 +19,7 @@ inputs:
topInputs.nixd.overlays.default
topInputs.nix-alien.overlays.default
topInputs.napalm.overlays.default
topInputs.pnpm2nix-nzbr.overlays.default
(final: prev:
{
touchix = topInputs.touchix.packages."${prev.system}";