Update firebase-tools.nix

This commit is contained in:
Melvin Ragusa
2026-02-06 23:03:41 +01:00
parent 951e135bce
commit 27c2e82311

View File

@@ -2,16 +2,18 @@
# This file exports a single overlay function that forces `firebase-tools`
# to use `nodejs_22` when available, falling back to `nodejs` otherwise.
#
# It's intended to be imported directly in a host's `nixpkgs.overlays`,
# e.g. in `hosts/server/configuration.nix`.
# firebase-tools uses buildNpmPackage which accepts nodejs as a parameter.
# We override buildNpmPackage to use the desired nodejs version.
final: prev:
let
# Prefer nodejs_22 if present in the previous package set; otherwise use nodejs.
nodejsChoice = if builtins.hasAttr "nodejs_22" prev then prev.nodejs_22 else prev.nodejs;
in
{
# Override firebase-tools to use the chosen Node.js package.
# Override firebase-tools by providing a custom buildNpmPackage with our nodejs choice
firebase-tools = prev.firebase-tools.override {
nodejs = nodejsChoice;
buildNpmPackage = prev.buildNpmPackage.override {
nodejs = nodejsChoice;
};
};
}