nix/pkgs/nyxt-lisp.nix

122 lines
3 KiB
Nix

{
lib,
stdenv,
clwrapper,
pkgs,
sbcl,
coreutils,
nix,
asdf,
}: {
nyxt = pkgs.lispPackages.buildLispPackage rec {
:winherit lib pkgs clwrapper stdenv;
nixLib = pkgs.lib;
callPackage = nixLib.callPackageWith lispPackages;
baseName = "nyxt";
version = "3-pre-release-2";
description = "Nyxt Browser";
overrides = x: {
postInstall = ''
echo "Building nyxt binary"
(
source "$out/lib/common-lisp-settings"/*-shell-config.sh
cd "$out/lib/common-lisp"/*/
makeFlags="''${makeFlags:-}"
make LISP=common-lisp.sh NYXT_INTERNAL_QUICKLISP=false PREFIX="$out" $makeFlags all
make LISP=common-lisp.sh NYXT_INTERNAL_QUICKLISP=false PREFIX="$out" $makeFlags install
cp nyxt "$out/bin/nyxt"
)
NIX_LISP_PRELAUNCH_HOOK='
nix_lisp_build_system nyxt/gtk-application \
"(asdf/system:component-entry-point (asdf:find-system :nyxt/gtk-application))" \
"" "(format *error-output* \"Alien objects:~%~s~%\" sb-alien::*shared-objects*)"
' "$out/bin/nyxt-lisp-launcher.sh"
cp "$out/lib/common-lisp/nyxt/nyxt" "$out/bin/"
'';
# Prevent nyxt from trying to obtain dependencies as submodules
makeFlags = ["NYXT_SUBMODULES=false"] ++ x.buildFlags or [];
patches =
x.patches
or []
++ [
# Work around crash when opening _any_ URL
# https://github.com/atlas-engineer/nyxt/issues/1781
# https://github.com/NixOS/nixpkgs/issues/158005
(pkgs.fetchpatch {
name = "nyxt-webkit-disable-sandbox.patch";
url = "https://github.com/atlas-engineer/nyxt/commit/48ac0d8727f1ca1428188a1ab2c05b7be5f6cc51.patch";
sha256 = "0570mcfn5wmjha6jmfdgglp0w5b7rpfnv3flzn77clgbknwbxi0m";
})
];
};
deps = with pkgs.lispPackages; [
alexandria
bordeaux-threads
calispel
cl-css
cl-json
cl-markup
cl-ppcre
cl-ppcre-unicode
cl-prevalence
closer-mop
cl-containers
cl-qrencode
clss
cluffer
moptilities
dexador
enchant
file-attributes
iolib
local-time
log4cl
lparallel
mk-string-metrics
osicat
parenscript
quri
serapeum
spinneret
str
plump
swank
trivia
trivial-clipboard
trivial-features
trivial-garbage
trivial-package-local-nicknames
trivial-types
unix-opts
cl-html-diff
hu_dot_dwim_dot_defclass-star
cl-custom-hash-table
fset
cl-cffi-gtk
cl-webkit2
cl-gobject-introspection
];
src = pkgs.fetchFromGitHub {
owner = "atlas-engineer";
repo = "nyxt";
rev = "${version}";
sha256 = "12l7ir3q29v06jx0zng5cvlbmap7p709ka3ik6x29lw334qshm9b";
};
packageName = "nyxt";
propagatedBuildInputs = [
pkgs.libressl.out
pkgs.webkitgtk
pkgs.sbcl
];
meta = {
description = "Nyxt Browser";
};
};
}