NixOS / nixos-homepage

Sources for nixos.org

Home Page:https://nixos.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Techstack-beta] Not being built as a Nix build output

samueldr opened this issue · comments

Not being able to handle the build of the website with a correct Nix build output gives mixed messages about Nix and its ecosystem, imo.

I was surprised earlier when testing the site and trying to check something that nix-build (or nix build) won't build the site anymore.


Refs:

Previous implementation (calling nix build):

New implementation (running non-Nix package management outside of a Nix build):

  • - name: "Build"
    run: |
    nix develop --accept-flake-config --command npm install
    nix develop --accept-flake-config --command npm run build
    mkdir build
    cp -RL ./dist/* ./build/

Yes, this was decided for now. It might even stay this way. We'll evaluate this after the migration is complete and after some time of using the website.

Currently there is one dependency which requires network connectivity to fetch icons at build time, but this will be replaced shortly. Then a nix build would be possible.

Unfortunately if we want to fetch resources like APIs etc. in the future, we would need network access during build time which would either mean disableing the sandbox during build time or not building through nix. If there is any solution I don't have in mind, just suggest it here. While downloading thing upfront through a flake would be possible, it circumvents many features modern SSGs have like image fetching and optimization etc.

personally I don't really see a reason why we want to make the website reproducible anyway, since this is not software others rely on and the only deployment target is our own webspace. I think a nix-build without the properties of reproduction would suffice, even if that means we have to include measures like disabling the sandbox. I know it is nice to have reproducability, but I conflicts with the idea of short cycled and quick updates and does not really make any sense in our case either. This is not a fault of nix, it is just a case reproducible builds in that manner were not meant for imo. But yes, having the build go through nix somehow would obviously be a good show off especially since this it is the nixos homepage. But I just wanted to mention some roadblocks here.