1
0
Fork 0

Compare commits

...

3 commits

5 changed files with 150 additions and 105 deletions

133
flake.lock generated
View file

@ -8,11 +8,11 @@
}, },
"locked": { "locked": {
"dir": "pkgs/firefox-addons", "dir": "pkgs/firefox-addons",
"lastModified": 1751429002, "lastModified": 1753329806,
"narHash": "sha256-ihzv16jv0mx4yW64wXuJBnTKigRVsR+aY9i/5WvS+tA=", "narHash": "sha256-PxQVUrK1rJEQoUSp6vO7OUfvkoZZUtY98HoWUIYW69M=",
"owner": "rycee", "owner": "rycee",
"repo": "nur-expressions", "repo": "nur-expressions",
"rev": "08812a6d58b96f717f9d4a8c3e5aa9db0554eb6f", "rev": "87fd18a0002b8d63a8520dd569a99de509fc43c5",
"type": "gitlab" "type": "gitlab"
}, },
"original": { "original": {
@ -23,6 +23,22 @@
} }
}, },
"flake-compat": { "flake-compat": {
"flake": false,
"locked": {
"lastModified": 1751685974,
"narHash": "sha256-NKw96t+BgHIYzHUjkTK95FqYRVKB8DHpVhefWSz/kTw=",
"ref": "refs/heads/main",
"rev": "549f2762aebeff29a2e5ece7a7dc0f955281a1d1",
"revCount": 92,
"type": "git",
"url": "https://git.lix.systems/lix-project/flake-compat.git"
},
"original": {
"type": "git",
"url": "https://git.lix.systems/lix-project/flake-compat.git"
}
},
"flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1650374568, "lastModified": 1650374568,
@ -40,14 +56,17 @@
}, },
"flake-parts": { "flake-parts": {
"inputs": { "inputs": {
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": [
"nvf",
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1749398372, "lastModified": 1753121425,
"narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", "narHash": "sha256-TVcTNvOeWWk1DXljFxVRp+E0tzG1LhrVjOGGoMHuXio=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", "rev": "644e0fc48951a860279da645ba77fe4a6e814c5e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -58,7 +77,10 @@
}, },
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems" "systems": [
"nvf",
"systems"
]
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@ -95,7 +117,7 @@
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1694529238,
@ -118,11 +140,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1751429452, "lastModified": 1753294394,
"narHash": "sha256-4s5vRtaqdNhVBnbOWOzBNKrRa0ShQTLoEPjJp3joeNI=", "narHash": "sha256-1Dfgq09lHZ8AdYB2Deu/mYP1pMNpob8CgqT5Mzo44eI=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "df12269039dcf752600b1bcc176bacf2786ec384", "rev": "1fde6fb1be6cd5dc513dc1c287d69e4eb2de973e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -146,34 +168,13 @@
"type": "github" "type": "github"
} }
}, },
"nil": {
"inputs": {
"nixpkgs": [
"nvf",
"nixpkgs"
]
},
"locked": {
"lastModified": 1750047244,
"narHash": "sha256-vluLARrk4485npdyHOj8XKr0yk6H22pNf+KVRNL+i/Y=",
"owner": "oxalica",
"repo": "nil",
"rev": "870a4b1b5f12004832206703ac15aa85c42c247b",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "nil",
"type": "github"
}
},
"nixos-hardware": { "nixos-hardware": {
"locked": { "locked": {
"lastModified": 1751432711, "lastModified": 1753122741,
"narHash": "sha256-136MeWtckSHTN9Z2WRNRdZ8oRP3vyx3L8UxeBYE+J9w=", "narHash": "sha256-nFxE8lk9JvGelxClCmwuJYftbHqwnc01dRN4DVLUroM=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "497ae1357f1ac97f1aea31a4cb74ad0d534ef41f", "rev": "cc66fddc6cb04ab479a1bb062f4d4da27c936a22",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -184,11 +185,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1751271578, "lastModified": 1753250450,
"narHash": "sha256-P/SQmKDu06x8yv7i0s8bvnnuJYkxVGBWLWHaU+tt4YY=", "narHash": "sha256-i+CQV2rPmP8wHxj0aq4siYyohHwVlsh40kV89f3nw1s=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "3016b4b15d13f3089db8a41ef937b13a9e33a8df", "rev": "fc02ee70efb805d3b2865908a13ddd4474557ecf",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -198,28 +199,13 @@
"type": "github" "type": "github"
} }
}, },
"nixpkgs-lib": {
"locked": {
"lastModified": 1748740939,
"narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "656a64127e9d791a334452c6b6606d17539476e2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixpkgs.lib",
"type": "github"
}
},
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1750215678, "lastModified": 1752997324,
"narHash": "sha256-Rc/ytpamXRf6z8UA2SGa4aaWxUXRbX2MAWIu2C8M+ok=", "narHash": "sha256-vtTM4oDke3SeDj+1ey6DjmzXdq8ZZSCLWSaApADDvIE=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "5395fb3ab3f97b9b7abca147249fa2e8ed27b192", "rev": "7c688a0875df5a8c28a53fb55ae45e94eae0dddb",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -247,19 +233,19 @@
}, },
"nvf": { "nvf": {
"inputs": { "inputs": {
"flake-compat": "flake-compat",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"flake-utils": "flake-utils", "flake-utils": "flake-utils",
"mnw": "mnw", "mnw": "mnw",
"nil": "nil",
"nixpkgs": "nixpkgs_2", "nixpkgs": "nixpkgs_2",
"systems": "systems_2" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1751186226, "lastModified": 1753181140,
"narHash": "sha256-Bt7jtmCW72JUPxOIrV73qBTAUOy4qvJXsls2ERDUcGo=", "narHash": "sha256-daKfPQnipcRnKnXknDzv+fzNKeEY3r/10y8YMVQ10vU=",
"owner": "notashelf", "owner": "notashelf",
"repo": "nvf", "repo": "nvf",
"rev": "5bad5dd94ce5ea3b40b08d9e6802e69d02198d21", "rev": "8fbecab446afe3454ecce6a4b817ec4f123a4a34",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -306,7 +292,7 @@
}, },
"snowfall-lib": { "snowfall-lib": {
"inputs": { "inputs": {
"flake-compat": "flake-compat", "flake-compat": "flake-compat_2",
"flake-utils-plus": "flake-utils-plus", "flake-utils-plus": "flake-utils-plus",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
@ -331,11 +317,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1750119275, "lastModified": 1752544651,
"narHash": "sha256-Rr7Pooz9zQbhdVxux16h7URa6mA80Pb/G07T4lHvh0M=", "narHash": "sha256-GllP7cmQu7zLZTs9z0J2gIL42IZHa9CBEXwBY9szT0U=",
"owner": "Mic92", "owner": "Mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "77c423a03b9b2b79709ea2cb63336312e78b72e2", "rev": "2c8def626f54708a9c38a5861866660395bb3461",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -389,21 +375,6 @@
"repo": "default", "repo": "default",
"type": "github" "type": "github"
} }
},
"systems_3": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
} }
}, },
"root": "root", "root": "root",

View file

@ -8,16 +8,16 @@ final: prev: {
awesome-flake = (prev.awesome-flake or { }) // { awesome-flake = (prev.awesome-flake or { }) // {
cinny = prev.cinny-unwrapped.overrideAttrs (_old: rec { cinny = prev.cinny-unwrapped.overrideAttrs (_old: rec {
pname = "cinny-unwrapped"; pname = "cinny-unwrapped";
version = "325144d8b2ca53c32fc6e1eace0603968a5ddc40"; version = "65475050d76d6e8da8c3402528215b1425e8ed4e";
src = final.fetchFromGitHub { src = final.fetchFromGitHub {
owner = "GigiaJ"; owner = "GigiaJ";
repo = "cinny"; repo = "cinny";
rev = version; rev = version;
hash = "sha256-822P12rzSLzje7KuBF2RB70SPdfCaHZaPV/1Nr4CCnY="; hash = "sha256-kJZDc53mcJrGIw3Dl4ANq+1O5O2p0tcO2btQGNGRg4A=";
}; };
npmDepsHash = "sha256-pP7JH/K9QSqyUVg0UFTDzZvRoL5CeP5pudv83eHVoTo="; npmDepsHash = "sha256-GkD+CrblXBv7yPVrTBVIGkz7Wu5llWzlluNq7rmm3CE=";
npmDeps = final.fetchNpmDeps { npmDeps = final.fetchNpmDeps {
inherit src; inherit src;
name = "${pname}-${version}-npm-deps"; name = "${pname}-${version}-npm-deps";

View file

@ -5,9 +5,5 @@
}: }:
final: prev: { final: prev: {
prisma = prev.prisma.overrideAttrs (_old: rec { inherit (channels.stable) prisma;
pname = "prisma";
meta.mainProgram = "prisma";
});
} }

View file

@ -0,0 +1,42 @@
diff --git i/apps/web/components/Preservation/ReadableView.tsx w/apps/web/components/Preservation/ReadableView.tsx
index 64f14186..daff3636 100644
--- i/apps/web/components/Preservation/ReadableView.tsx
+++ w/apps/web/components/Preservation/ReadableView.tsx
@@ -20,13 +20,13 @@ import {
} from "@linkwarden/router/highlights";
import { Highlight } from "@linkwarden/prisma/client";
import { useUser } from "@linkwarden/router/user";
-import { Caveat } from "next/font/google";
-import { Bentham } from "next/font/google";
+import localFont from "next/font/local";
import { Separator } from "../ui/separator";
import { Button } from "../ui/button";
-const caveat = Caveat({ subsets: ["latin"] });
-const bentham = Bentham({ subsets: ["latin"], weight: "400" });
+
+const caveat = localFont({ src: "../../public/caveat.ttf" });
+const bentham = localFont({ src: "../../public/bentham.ttf" });
type Props = {
link: LinkIncludingShortenedCollectionAndTags;
diff --git i/apps/web/components/TextStyleDropdown.tsx w/apps/web/components/TextStyleDropdown.tsx
index a84587d9..59a291e4 100644
--- i/apps/web/components/TextStyleDropdown.tsx
+++ w/apps/web/components/TextStyleDropdown.tsx
@@ -13,12 +13,11 @@ import {
import { Button } from "@/components/ui/button";
import { FitWidth, FormatLineSpacing, FormatSize } from "@/components/ui/icons";
import { useUpdateUserPreference, useUser } from "@linkwarden/router/user";
-import { Caveat } from "next/font/google";
-import { Bentham } from "next/font/google";
+import localFont from "next/font/local";
import { useTranslation } from "next-i18next";
-const caveat = Caveat({ subsets: ["latin"] });
-const bentham = Bentham({ subsets: ["latin"], weight: "400" });
+const caveat = localFont({ src: "../public/caveat.ttf" });
+const bentham = localFont({ src: "../public/bentham.ttf" });
const fontSizes = [
"12px",

View file

@ -6,13 +6,14 @@
fetchYarnDeps, fetchYarnDeps,
makeWrapper, makeWrapper,
nixosTests, nixosTests,
yarnBuildHook,
yarnConfigHook, yarnConfigHook,
fetchpatch,
# dependencies # dependencies
bash, bash,
monolith, monolith,
nodejs, nodejs,
openssl, openssl,
google-fonts,
playwright-driver, playwright-driver,
prisma, prisma,
prisma-engines, prisma-engines,
@ -38,28 +39,42 @@ let
cp -r lib $out/lib/node_modules/bcrypt/ cp -r lib $out/lib/node_modules/bcrypt/
''; '';
}; };
google-fonts' = google-fonts.override {
fonts = [
"Caveat"
"Bentham"
];
};
in in
stdenvNoCC.mkDerivation rec { stdenvNoCC.mkDerivation rec {
pname = "linkwarden"; pname = "linkwarden";
version = "2.10.0"; version = "2.11.3";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "linkwarden"; owner = "linkwarden";
repo = "linkwarden"; repo = "linkwarden";
tag = "v${version}"; tag = "v${version}";
hash = "sha256-mtygHx09VqrVq5eiCm8UbVM+bjA6n4MbRRT1HcWnUAo="; hash = "sha256-/ktAfloJBmXKAn7/Er7rloF5bWuKl/DnofRqHcIrHkg=";
}; };
patches = [
./01-localfont.patch
(fetchpatch {
url = "https://github.com/linkwarden/linkwarden/pull/1290.patch";
hash = "sha256-kq1GIEW0chnPmzvg4eDSS/5WtRyWlrHlk41h4pSCMzg=";
})
];
yarnOfflineCache = fetchYarnDeps { yarnOfflineCache = fetchYarnDeps {
yarnLock = src + "/yarn.lock"; yarnLock = src + "/yarn.lock";
hash = "sha256-D6iZp7O90ZwxyiwRZ1H67eUphh3kRplu3ucOEJIRR/w="; hash = "sha256-dqkaTMQYufUjENteOeS82B+/vZxbvCMOcmaP6IODm1w=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
makeWrapper makeWrapper
nodejs nodejs
prisma prisma
yarnBuildHook
yarnConfigHook yarnConfigHook
]; ];
@ -70,12 +85,10 @@ stdenvNoCC.mkDerivation rec {
NODE_ENV = "production"; NODE_ENV = "production";
postPatch = '' postPatch = ''
substituteInPlace package.json \ for f in packages/filesystem/*Folder.ts packages/filesystem/*File.ts; do
--replace-fail "yarn worker:prod" "ts-node --transpile-only --skip-project scripts/worker.ts"
for f in lib/api/storage/*Folder.ts lib/api/storage/*File.ts; do
substituteInPlace $f \ substituteInPlace $f \
--replace-fail 'path.join(process.cwd(), storagePath + "/" + file' 'path.join(storagePath, file' --replace-fail 'process.cwd(),' "" \
--replace-fail '"../..",' ""
done done
''; '';
@ -84,7 +97,18 @@ stdenvNoCC.mkDerivation rec {
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node" export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine" export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
export PRISMA_SCHEMA_ENGINE_BINARY="${prisma-engines}/bin/schema-engine" export PRISMA_SCHEMA_ENGINE_BINARY="${prisma-engines}/bin/schema-engine"
prisma generate '';
buildPhase = ''
runHook preBuild
cp ${google-fonts'}/share/fonts/truetype/Bentham-* ./apps/web/public/bentham.ttf
cp ${google-fonts'}/share/fonts/truetype/Caveat* ./apps/web/public/caveat.ttf
yarn prisma:generate
yarn web:build
runHook postBuild
''; '';
postBuild = '' postBuild = ''
@ -97,14 +121,25 @@ stdenvNoCC.mkDerivation rec {
rm -r node_modules/bcrypt node_modules/@next/swc-* rm -r node_modules/bcrypt node_modules/@next/swc-*
ln -s ${bcrypt}/lib/node_modules/bcrypt node_modules/ ln -s ${bcrypt}/lib/node_modules/bcrypt node_modules/
mkdir -p $out/share/linkwarden/.next $out/bin mkdir -p $out/share/linkwarden/apps/web/.next $out/bin
cp -r * .next $out/share/linkwarden/ cp -r apps/web/.next apps/web/* $out/share/linkwarden/apps/web
cp -r apps/worker $out/share/linkwarden/apps/worker
cp -r packages $out/share/linkwarden/
cp -r node_modules $out/share/linkwarden/
rm -r $out/share/linkwarden/node_modules/mobile-app
echo "#!${lib.getExe bash} -e echo "#!${lib.getExe bash} -e
export DATABASE_URL=\''${DATABASE_URL-"postgresql://\$DATABASE_USER:\$POSTGRES_PASSWORD@\$DATABASE_HOST:\$DATABASE_PORT/\$DATABASE_NAME"} export DATABASE_URL=\''${DATABASE_URL-"postgresql://\$DATABASE_USER:\$POSTGRES_PASSWORD@\$DATABASE_HOST:\$DATABASE_PORT/\$DATABASE_NAME"}
export npm_config_cache="\$LINKWARDEN_CACHE_DIR/npm" export npm_config_cache="\$LINKWARDEN_CACHE_DIR/npm"
${lib.getExe prisma} migrate deploy --schema $out/share/linkwarden/prisma/schema.prisma \
&& ${lib.getExe' nodejs "npm"} start --prefix $out/share/linkwarden -- -H \$LINKWARDEN_HOST -p \$LINKWARDEN_PORT if [ \"\$1\" == \"worker\" ]; then
echo "Starting worker"
${lib.getExe' nodejs "npm"} start --prefix $out/share/linkwarden/apps/worker
else
echo "Starting server"
${lib.getExe prisma} migrate deploy --schema $out/share/linkwarden/packages/prisma/schema.prisma \
&& ${lib.getExe' nodejs "npm"} start --prefix $out/share/linkwarden/apps/web -- -H \$LINKWARDEN_HOST -p \$LINKWARDEN_PORT
fi
" > $out/bin/start.sh " > $out/bin/start.sh
chmod +x $out/bin/start.sh chmod +x $out/bin/start.sh
@ -124,7 +159,8 @@ stdenvNoCC.mkDerivation rec {
--set-default LINKWARDEN_CACHE_DIR /var/cache/linkwarden \ --set-default LINKWARDEN_CACHE_DIR /var/cache/linkwarden \
--set-default LINKWARDEN_HOST localhost \ --set-default LINKWARDEN_HOST localhost \
--set-default LINKWARDEN_PORT 3000 \ --set-default LINKWARDEN_PORT 3000 \
--set-default STORAGE_FOLDER /var/lib/linkwarden --set-default STORAGE_FOLDER /var/lib/linkwarden \
--set-default NEXT_TELEMETRY_DISABLED 1
runHook postInstall runHook postInstall
''; '';