Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(flake.nix): fix site build & add missing inputs for darwin hosts #16153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 22 additions & 10 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
inherit system;
};

nodejs = pkgs.nodejs-18_x;
nodejs = pkgs.nodejs_20;
# Check in https://search.nixos.org/packages to find new packages.
# Use `nix --extra-experimental-features nix-command --extra-experimental-features flakes flake update`
# to update the lock file if packages are out-of-date.
Expand Down Expand Up @@ -88,6 +88,7 @@
less
mockgen
moreutils
nix-prefetch-git
nfpm
nodejs
neovim
Expand Down Expand Up @@ -119,9 +120,17 @@

# buildSite packages the site directory.
buildSite = pnpm2nix.packages.${system}.mkPnpmPackage {
inherit nodejs;

src = ./site/.;
# Required for the `canvas` package!
extraBuildInputs = with pkgs; [ pkgs.cairo pkgs.pango pkgs.pixman ];
extraBuildInputs = with pkgs; [
cairo
pango
pixman
libpng libjpeg giflib librsvg
python312Packages.setuptools
] ++ ( lib.optionals stdenv.targetPlatform.isDarwin [ darwin.apple_sdk.frameworks.Foundation xcbuild ] );
installInPlace = true;
distDir = "out";
};
Expand Down Expand Up @@ -161,15 +170,18 @@
};
in
{
devShell = pkgs.mkShell {
buildInputs = devShellPackages;
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';

LOCALE_ARCHIVE = with pkgs; lib.optionalDrvAttr stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
devShells = {
default = pkgs.mkShell {
buildInputs = devShellPackages;
shellHook = ''
export PLAYWRIGHT_BROWSERS_PATH=${pkgs.playwright-driver.browsers}
export PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS=true
'';

LOCALE_ARCHIVE = with pkgs; lib.optionalDrvAttr stdenv.isLinux "${glibcLocales}/lib/locale/locale-archive";
};
};

packages = {
proto_gen_go = proto_gen_go_1_30;
all = pkgs.buildEnv {
Expand Down
3 changes: 3 additions & 0 deletions site/.npmrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
save-exact=true
engine-strict=true

# Needed for nix builds of the site; see: https://github.com/nzbr/pnpm2nix-nzbr/issues/33#issuecomment-2381628294
lockfile-include-tarball-url=true
Loading
Loading