Add lightpanda and default package to flake.nix#1976
Add lightpanda and default package to flake.nix#1976lukasl-dev wants to merge 10 commits intolightpanda-io:mainfrom
lightpanda and default package to flake.nix#1976Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
Hi! Tried this today and it fails for me. error: Cannot build '/nix/store/hvma90wfwyxf8wqkybb079l8nn6aiv50-source.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/xy9bhpxljg97p4qhhhs65gmrws16sy2y-source
Last 7 log lines:
>
> trying https://codeload.github.com/lightpanda-io/zig-v8-fork/tar.gz/refs/tags/v0.3.4
> % Total % Received % Xferd Average Speed Time Time Time Current
> Dload Upload Total Spent Left Speed
> 100 57993 0 57993 0 0 159k 0 --:--:-- --:--:-- --:--:-- 159k
> unpacking source archive /build/v0.3.4
> do not know how to unpack source archive /build/v0.3.4
For full logs, run:
nix log /nix/store/hvma90wfwyxf8wqkybb079l8nn6aiv50-source.drv
error: Cannot build '/nix/store/jm19kbiqd865a789ynnr2j3cf6yiigyn-zig-packages.drv'.
Reason: 1 dependency failed.
Output paths:
/nix/store/9xv22gf5cql3hy9mka23hv6x1h4az1dp-zig-packages |
|
That's interesting as I'm already using it in my own config. It seems like Nix couldn't figure out how to extract the archive for codeload urls. I think I found a fix, however, could you share your |
|
My VPS and my Raspberry PI had a similar issue. Not fully identical, but similar: Apparently, zon2nix struggles with redirected urls and with archives that have no root directory. I created a And I renamed I've tested it on all three of my Nix devices and two of them build successfuly now. There's one issue left w.r.t. FHS for packaging. |
|
FHS-related issues are now also fixed. 3/3 Nix devices build successfully now. |
|
Hello, This does build for me now and it seems to work fine so I appreciate all of the fixes. I'm not entirely sure of the maintenance burden here considering most of the team doesn't use Nix and this seems to require regeneration of the |
|
Hi! I understand your concern, but we as Nix users are pretty much used to pulling foreign Nix flakes that break every now and then (opencode, fff, etc.). That's why I included the |
mookums
left a comment
There was a problem hiding this comment.
Fair enough with regards to maintenance. I'm willing to get this pushed through if you can just make some of these changes + make sure the flake and build.zig.zon.nix is up to date.
|
|
||
| flake-utils.url = "github:numtide/flake-utils"; | ||
|
|
||
| zon2nix.url = "github:nix-community/zon2nix"; |
There was a problem hiding this comment.
| zon2nix.url = "github:nix-community/zon2nix"; | |
| zon2nix.url = "github:nix-community/zon2nix"; | |
| zon2nix.inputs.nixpkgs.follows = "nixpkgs"; |
| ++ [ zon2nix.packages.${system}.default ]; | ||
| text = # bash | ||
| '' | ||
| exec bash "$PWD/zon2nix.sh" |
There was a problem hiding this comment.
Tried this today and i don't think you even need this wrapper script.
You can just do zon2nix > build.zig.zon.nix and it seems to generate a valid file that still builds.
There was a problem hiding this comment.
Something like this seems to work fine:
zon2nixScript = pkgs.writeShellApplication {
name = "zon2nix";
runtimeInputs = [ zon2nix.packages.${system}.default ];
text = ''
zon2nix > build.zig.zon.nix
'';
};| { | ||
| packages = rec { | ||
| default = lightpanda; | ||
| lightpanda = pkgs.stdenv.mkDerivation { |
There was a problem hiding this comment.
Would prefer if this was up in the let and then you just had something like:
...
lightpanda = pkgs.stdenv.mkDerivation {
...
}
in
{
packages = {
default = lightpanda;
lightpanda = lightpanda;
}
}just makes the final part less noisy.
| @@ -0,0 +1,132 @@ | |||
| #!/usr/bin/env bash | |||
There was a problem hiding this comment.
We don't need this file at all. See above comment about zon2nix
|
This PR also does not build for me if we do not provide a prebuilt v8. |
|
Going to say this is not planned for now. I'm willing to revisit adding Nix build support to Lightpanda at a later date (especially in the future when we have stable builds). |
This PR adds the
lightpandaanddefaultpackages to flake.nix, such that lightpanda can be build via.This allows Nixians to include lightpanda directly into their system config as a flake input:
It can also be run via
nix run:nix run github:lightpanda-io/browser # or `nix run .`The package build reuses the existing FHS environment already defined in flake.nix, and adds the necessary Zig and Cargo dependency handling so the build works in the Nix sandbox.