diff --git a/flake.lock b/flake.lock index 2bbd4329..b432fce6 100644 --- a/flake.lock +++ b/flake.lock @@ -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": [ diff --git a/flake.nix b/flake.nix index 38e74d52..dfddced7 100644 --- a/flake.nix +++ b/flake.nix @@ -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: diff --git a/local/pkgs/default.nix b/local/pkgs/default.nix index 00be03f8..254c38e6 100644 --- a/local/pkgs/default.nix +++ b/local/pkgs/default.nix @@ -6,6 +6,5 @@ vesta = callPackage ./vesta {}; oneapi = callPackage ./oneapi {}; send = callPackage ./send {}; - misskey = callPackage ./misskey {}; rsshub = callPackage ./rsshub {}; } diff --git a/local/pkgs/misskey/default.nix b/local/pkgs/misskey/default.nix deleted file mode 100644 index 8c850606..00000000 --- a/local/pkgs/misskey/default.nix +++ /dev/null @@ -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; - }; -} \ No newline at end of file diff --git a/local/pkgs/misskey/default.nix.bak b/local/pkgs/misskey/default.nix.bak deleted file mode 100644 index 71521598..00000000 --- a/local/pkgs/misskey/default.nix.bak +++ /dev/null @@ -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 - ''; -} diff --git a/modules/default.nix b/modules/default.nix index 02fa9e5d..e78289b9 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -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}";