Skip to content

fix(standards): allow google-chrome in the flake's package set, for darwin - #87

Merged
batonac merged 1 commit into
mainfrom
fix/pdfkiln-darwin-unfree
Nov 23, 2026
Merged

batonac merged 1 commit into
mainfrom
fix/pdfkiln-darwin-unfree

Conversation

@batonac

@batonac batonac commented Nov 23, 2026

Copy link
Copy Markdown
Member

Summary

Allow exactly one unfree package, google-chrome, in this flake's package set. This lets packages.aarch64-darwin.pdfkiln evaluate without NIXPKGS_ALLOW_UNFREE=1. The darwin pdfkiln wrapper runs nixpkgs' google-chrome-stable.

Why

On main (ae29cfe, after #85), the darwin package refuses to evaluate:

Refusing to evaluate package 'google-chrome-157.0.8103.51' ... because it has an unfree license ('unfree')

The perSystem package set allowed no unfree package. #85 merged at branch head fb9710f, before this fix.

Changes

  • flake.nix: an imports module sets perSystem's _module.args.pkgs to import nixpkgs { inherit system; config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "google-chrome" ]; }. The locked flake-parts has no nixpkgs config option. Its nixpkgs module only supplies a default pkgs, which this replaces. allowUnfree is not set. Packages, checks, devShells and the formatter are unchanged.
  • checks/pdfkiln.nix: the Linux script is unchanged, and its derivation is the same as on main. A darwin branch greps the wrapper for PDFKILN_CHROMIUM and for the google-chrome-stable path, and skips the render.

Validation

Every command ran in the worktree on the pushed commit 375a40c.

  • env -u NIXPKGS_ALLOW_UNFREE nix eval --raw .#packages.aarch64-darwin.pdfkiln.drvPath: pass (/nix/store/1pqr42jhim78r72ys1kqsmldv7q0z3zn-pdfkiln-1.3.0.drv).
  • nix eval --raw .#packages.aarch64-darwin.pdfkiln.installPhase: each makeWrapper sets --set PDFKILN_CHROMIUM /nix/store/…-google-chrome-157.0.8103.51/bin/google-chrome-stable, and no chromium path appears. The three wrappers come from one for loop.
  • env -u NIXPKGS_ALLOW_UNFREE nix eval --raw .#checks.aarch64-darwin.pdfkiln.drvPath: pass (/nix/store/la0dayv2z9dniyr08nhcn9i7h616h26l-python-devops-nix-pdfkiln-check.drv).
  • nix eval --raw .#packages.x86_64-linux.pdfkiln.drvPath and .#checks.x86_64-linux.pdfkiln.drvPath: identical to main (0cqbg3iycwj3k1zjkf174blqz5cgzww5-pdfkiln-1.3.0.drv and h69zw1jyqjym3v1azqwqypj066qw59mj-python-devops-nix-pdfkiln-check.drv).
  • nix build .#checks.x86_64-linux.pdfkiln -L --no-link: pass. The check log shows the Chromium render.
  • nix flake check --no-build --system x86_64-linux: pass.
  • nix fmt, then git diff --exit-code: no change. A second nix fmt is also a no-op.
  • prek run --all-files: all hooks pass.
  • statix check on flake.nix and checks/pdfkiln.nix, and deadnix --fail on both: pass.

Not verified

  • Darwin is not built or run. The darwin package and check are evaluated only. Nothing is fetched or run for google-chrome on darwin.
  • docs/library.md (the packages.<system>.pdfkiln row) still says the darwin output does not evaluate yet. That file is outside this change's scope and needs a follow-up.

🤖 Generated with Claude Code

…arwin

The darwin pdfkiln wrapper runs nixpkgs' google-chrome, which is unfree.
The flake's nixpkgs allowed no unfree package, so
packages.aarch64-darwin.pdfkiln refused to evaluate without
NIXPKGS_ALLOW_UNFREE=1.

The flake's perSystem package set now allows exactly one unfree package,
google-chrome, through config.allowUnfreePredicate. allowUnfree stays
unset, so nothing else is allowed. It is set as _module.args.pkgs, which
is how flake-parts supplies perSystem's pkgs.

checks/pdfkiln.nix gets a darwin branch that asserts PDFKILN_CHROMIUM
names google-chrome-stable and skips the render, which stays Linux-only.
The Linux check's derivation is unchanged.

Verified: the darwin package and check evaluate with NIXPKGS_ALLOW_UNFREE
unset, and the darwin installPhase sets PDFKILN_CHROMIUM to
google-chrome-stable with no chromium path. The Linux package and check
drvPaths match main, and the Linux check builds. nix flake check
--no-build (x86_64-linux), nix fmt, statix, deadnix and prek pass.
Darwin is not built or run.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AAw4Sw2knFZL7NYgFroq1Y
@batonac
batonac merged commit 13d0b49 into main Nov 23, 2026
8 checks passed
@batonac
batonac deleted the fix/pdfkiln-darwin-unfree branch November 23, 2026 14:48
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.

1 participant