Skip to content

Load Fira Code from the npm package again, so builds work offline - #1303

Merged
philiptaron merged 1 commit into
NixOS:masterfrom
nixos-test-org:fira-code-from-package
Oct 23, 2026
Merged

philiptaron merged 1 commit into
NixOS:masterfrom
nixos-test-org:fira-code-from-package

Conversation

@philiptaron

Copy link
Copy Markdown
Collaborator

The fontsource provider downloads the font files from api.fontsource.org at build time, so the site couldn't be built without network access, for example in the Nix sandbox. It "works" today only because the Astro site is built with npm on the runner and on Netlify, not in a Nix derivation. When built with no network, it fails with "Could not fetch from https://api.fontsource.org/v1/fonts".

Thanks to @trespaul for the warning about this.

The fontsource provider downloads the font files from api.fontsource.org
at build time, so the site couldn't be built without network access, for
example in the Nix sandbox. Built with no network, it fails with "Could
not fetch from `https://api.fontsource.org/v1/fonts`".

The local provider now takes the files from @fontsource-variable/fira-code,
as it does for Inter from inter-ui, and Dependabot keeps them updated
again. Each subset's unicode-range comes from the package's unicode.json
rather than being copied into the config, so the ranges stay in step with
the files when the package is updated. The same three subsets (latin,
latin-ext and symbols2) are served, and the generated files are
byte-identical to the package's.
@philiptaron
philiptaron requested a review from a team as a code owner October 23, 2026 09:13
@philiptaron philiptaron changed the title site: load Fira Code from the npm package again, so builds work offline Load Fira Code from the npm package again, so builds work offline Oct 23, 2026
@philiptaron
philiptaron requested a review from trespaul October 23, 2026 09:14

@trespaul trespaul left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Glad to have been helpful :)

@philiptaron
philiptaron merged commit 126f55a into NixOS:master Oct 23, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants