1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-09 17:44:56 +09:00
ladybird/Toolchain/Nix/package.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

26 lines
837 B
Nix

# Override ladybird from nixpkgs with the source directory as the source
# and latest revision (or "dirty") as the version. Unless new dependencies
# are introduced, this should work just fine. If a new dependency is added
# and builds are broken, simply adding the missing dependencies in buildInputs
# inside of the attribute should do the trick.
{
self,
lib,
ladybird,
...
}:
ladybird.overrideAttrs {
# Reproducible source path
src = builtins.path {
path = ../../.;
name = "ladybird-source";
filter = lib.cleanSourceFilter;
};
# Short rev will be missing in "dirty" source trees. In which case we fall
# back to "dirty" as the version.
version = self.shortRev or "dirty";
# Let's not bother nixpkgs maintainers with issues in the source.
meta.maintainers = with lib.maintainers; [ NotAShelf ];
}