rallly: build from source now + removed podman
thank you for the nerdsnipe @rasmus
This commit is contained in:
parent
c2703447c7
commit
dd5a97ce13
7 changed files with 27175 additions and 53 deletions
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
virtualisation.podman = {
|
||||
enable = true;
|
||||
dockerCompat = true;
|
||||
};
|
||||
}
|
124
shared/pkgs/rallly/default.nix
Normal file
124
shared/pkgs/rallly/default.nix
Normal file
|
@ -0,0 +1,124 @@
|
|||
{
|
||||
lib
|
||||
, buildNpmPackage
|
||||
, fetchFromGitHub
|
||||
, yarn
|
||||
, nodejs_20
|
||||
, inter # icons
|
||||
# , prisma-old ? null
|
||||
, oldpkgs ? (import (builtins.fetchTarball {
|
||||
url = "https://github.com/NixOS/nixpkgs/archive/ab7b6889ae9d484eed2876868209e33eb262511d.tar.gz";
|
||||
}) {})
|
||||
, rallly-prisma ? oldpkgs.prisma
|
||||
, rallly-prisma-engines ? oldpkgs.prisma-engines
|
||||
}:
|
||||
|
||||
|
||||
buildNpmPackage rec {
|
||||
pname = "rallly";
|
||||
version = "3.11.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "lukevella";
|
||||
repo = "rallly";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-ej6Y0ouiheoH6dSBWsSIW6qt9UvsLh9ODDQA5Fqt3zs=";
|
||||
};
|
||||
|
||||
nodejs = nodejs_20;
|
||||
|
||||
npmDepsHash = "sha256-sAs1DhegfI1YbE/Xy2Jzjx1RKYOUgc1Ww7hLL7+f8ZU=";
|
||||
|
||||
patches = [
|
||||
./font.patch
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
cp ${./package-lock.json} package-lock.json
|
||||
'';
|
||||
|
||||
SKIP_ENV_VALIDATION = 1;
|
||||
NEXT_PUBLIC_SELF_HOSTED = "true";
|
||||
NEXT_PUBLIC_APP_VERSION = version;
|
||||
|
||||
preBuild = ''
|
||||
# We have to pass and bake in the Ollama URL into the package
|
||||
|
||||
# Replace the googleapis.com Inter font with a local copy from nixpkgs
|
||||
cp "${inter}/share/fonts/truetype/InterVariable.ttf" apps/web/Inter.ttf
|
||||
|
||||
cp -a packages/database/prisma .
|
||||
${rallly-prisma}/bin/prisma generate
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
# Add a shebang to the server js file, then patch the shebang to use a nixpkgs nodejs binary.
|
||||
sed -i '1s|^|#!/usr/bin/env node\n|' apps/web/.next/standalone/apps/web/server.js
|
||||
patchShebangs ./apps/web/.next/standalone/apps/web/server.js
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
cd apps/web
|
||||
|
||||
mkdir -p $out/{share,bin}
|
||||
|
||||
cp -r .next/standalone $out/share/rallly
|
||||
cp -a public/. $out/share/rallly/apps/web/public
|
||||
|
||||
mkdir -p $out/share/rallly/.next
|
||||
cp -r .next/static $out/share/rallly/apps/web/.next/static
|
||||
|
||||
cp -r ../../prisma $out/share/rallly/apps/web
|
||||
|
||||
chmod +x $out/share/rallly/apps/web/server.js
|
||||
|
||||
# This patch must be applied here, as it's patching the `dist` directory
|
||||
# of NextJS. Without this, homepage-dashboard errors when trying to
|
||||
# write its prerender cache.
|
||||
#
|
||||
# This patch ensures that the cache implementation respects the env
|
||||
# variable `NIXPKGS_HOMEPAGE_CACHE_DIR`, which is set by default in the
|
||||
# wrapper below.
|
||||
(cd "$out" && patch -p1 <${./prerender_cache_path.patch})
|
||||
|
||||
# we set a default port to support "nix run ..."
|
||||
makeWrapper $out/share/rallly/apps/web/server.js $out/bin/rallly \
|
||||
--set-default NIXPKGS_RALLLY_CACHE_DIR /var/cache/rallly
|
||||
|
||||
makeWrapper ${rallly-prisma}/bin/prisma $out/bin/rallly-prisma \
|
||||
--chdir $out/share/rallly/apps/web/prisma \
|
||||
--append-flags --schema=./schema.prisma
|
||||
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [
|
||||
(yarn.override {nodejs = nodejs_20; })
|
||||
rallly-prisma
|
||||
];
|
||||
|
||||
passthru = {
|
||||
inherit rallly-prisma rallly-prisma-engines;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://rallly.co/";
|
||||
changelog = "https://github.com/lukevella/rallly/releases/tag/v${version}";
|
||||
description = "Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier";
|
||||
longDescription = ''
|
||||
Rallly is an open-source scheduling and collaboration tool
|
||||
designed to make organizing events and meetings easier.
|
||||
Schedule group meetings with friends, colleagues and teams.
|
||||
Create meeting polls to find the best date and time to organize an event
|
||||
based on your participants' availability. Save time and avoid back-and-forth emails.
|
||||
'';
|
||||
license = licenses.agpl3Plus;
|
||||
maintainers = with maintainers; [
|
||||
eyjhb
|
||||
];
|
||||
mainProgram = "rallly";
|
||||
};
|
||||
}
|
48
shared/pkgs/rallly/font.patch
Normal file
48
shared/pkgs/rallly/font.patch
Normal file
|
@ -0,0 +1,48 @@
|
|||
diff --git a/apps/web/src/app/[locale]/layout.tsx b/apps/web/src/app/[locale]/layout.tsx
|
||||
index ee7d143c..d70ecdfd 100644
|
||||
--- a/apps/web/src/app/[locale]/layout.tsx
|
||||
+++ b/apps/web/src/app/[locale]/layout.tsx
|
||||
@@ -4,16 +4,13 @@ import "../../style.css";
|
||||
import languages from "@rallly/languages";
|
||||
import { Toaster } from "@rallly/ui/toaster";
|
||||
import { Viewport } from "next";
|
||||
-import { Inter } from "next/font/google";
|
||||
+import localFont from "next/font/local";
|
||||
import React from "react";
|
||||
|
||||
import { TimeZoneChangeDetector } from "@/app/[locale]/timezone-change-detector";
|
||||
import { Providers } from "@/app/providers";
|
||||
|
||||
-const inter = Inter({
|
||||
- subsets: ["latin"],
|
||||
- display: "swap",
|
||||
-});
|
||||
+const inter = localFont({ src: './../../../Inter.ttf' });
|
||||
|
||||
export async function generateStaticParams() {
|
||||
return Object.keys(languages).map((locale) => ({ locale }));
|
||||
diff --git a/apps/web/src/pages/_app.tsx b/apps/web/src/pages/_app.tsx
|
||||
index b3d67d0e..16ee65a1 100644
|
||||
--- a/apps/web/src/pages/_app.tsx
|
||||
+++ b/apps/web/src/pages/_app.tsx
|
||||
@@ -6,7 +6,7 @@ import { TooltipProvider } from "@rallly/ui/tooltip";
|
||||
import { domMax, LazyMotion } from "framer-motion";
|
||||
import { NextPage } from "next";
|
||||
import { AppProps } from "next/app";
|
||||
-import { Inter } from "next/font/google";
|
||||
+import localFont from "next/font/local";
|
||||
import Head from "next/head";
|
||||
import { SessionProvider, signIn, useSession } from "next-auth/react";
|
||||
import React from "react";
|
||||
@@ -19,10 +19,7 @@ import { trpc } from "@/utils/trpc/client";
|
||||
|
||||
import { NextPageWithLayout } from "../types";
|
||||
|
||||
-const inter = Inter({
|
||||
- subsets: ["latin"],
|
||||
- display: "swap",
|
||||
-});
|
||||
+const inter = localFont({ src: './../../Inter.ttf' });
|
||||
|
||||
type AppPropsWithLayout = AppProps & {
|
||||
Component: NextPageWithLayout;
|
26944
shared/pkgs/rallly/package-lock.json
generated
Normal file
26944
shared/pkgs/rallly/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
21
shared/pkgs/rallly/prerender_cache_path.patch
Normal file
21
shared/pkgs/rallly/prerender_cache_path.patch
Normal file
|
@ -0,0 +1,21 @@
|
|||
diff --git a/share/rallly/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js b/share/rallly/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js
|
||||
index f3be830..fdafb45 100755
|
||||
--- a/share/rallly/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js
|
||||
+++ b/share/rallly/node_modules/next/dist/server/lib/incremental-cache/file-system-cache.js
|
||||
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "default", {
|
||||
});
|
||||
const _lrucache = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/lru-cache"));
|
||||
const _path = /*#__PURE__*/ _interop_require_default(require("../../../shared/lib/isomorphic/path"));
|
||||
+var path = require('node:path');
|
||||
const _constants = require("../../../lib/constants");
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
@@ -22,7 +23,7 @@ class FileSystemCache {
|
||||
constructor(ctx){
|
||||
this.fs = ctx.fs;
|
||||
this.flushToDisk = ctx.flushToDisk;
|
||||
- this.serverDistDir = ctx.serverDistDir;
|
||||
+ this.serverDistDir = path.join(process.env.NIXPKGS_RALLLY_CACHE_DIR, "rallly");
|
||||
this.appDir = !!ctx._appDir;
|
||||
this.pagesDir = !!ctx._pagesDir;
|
||||
this.revalidatedTags = ctx.revalidatedTags;
|
Loading…
Add table
Add a link
Reference in a new issue