1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 09:34:57 +09:00
ladybird/Toolchain/Nix/shell.nix
NotAShelf c276cc43f0 Nix: Expose ladybird package in flake; reuse in shell
Add and expose a `ladybird` package in the Nix flake. Allows building
Ladybird only using Nix, and without relying on the dev shell. Other
users will be able to build Ladybird from source using nix3 CLI via
`nix build github:LadybirdBrowser/ladybird` or add it as a flake input
to consume the package.

We also re-use the package in the devshell, to keep dependencies in-sync
between the bleeding-edge source package, and the dev shell. This is an
upgrade to how we previously inferred dependencies to Nixpkgs package
for Ladybird, which had a chance to lack dependencies required to build
the latest commit.
2025-03-04 08:19:54 -07:00

33 lines
717 B
Nix

{
mkShell,
kdePackages,
ccache,
clang-tools,
pre-commit,
prettier,
ladybird,
...
}:
mkShell {
inputsFrom = [
ladybird
];
packages = [
ccache
clang-tools
pre-commit
prettier
];
# Fix for: https://github.com/LadybirdBrowser/ladybird/issues/371#issuecomment-2616415434
# https://github.com/NixOS/nixpkgs/commit/049a854b4be087eaa3a09012b9c452fbc838dd41
NIX_LDFLAGS = "-lGL";
shellHook = ''
# NOTE: This is required to make it find the wayland platform plugin installed
# above, but should probably be fixed upstream.
export QT_PLUGIN_PATH="$QT_PLUGIN_PATH:${kdePackages.qtwayland}/lib/qt-6/plugins"
export QT_QPA_PLATFORM="wayland;xcb"
'';
}