protocol: spell the system out in regenerate.py's recipe

The docstring told the next reader to use ${builtins.currentSystem}, which a shell
expands before nix ever sees it -- the expression then fails to parse with
'syntax error, unexpected ;'. It also omitted the two environment variables the
script requires (HHSTREAM_WAYLAND_XML and PYTHONPATH), so the recipe as written
could not have worked. Both fixed, with the reason recorded.
This commit is contained in:
Hermenix committed 2026-10-11 22:47:12 +00:00
1 parent a7d9357b43
commit a813e0b4f8
1 file changed
+9 -2
+9 -2
View File
@@ -1,8 +1,15 @@
"""Regenerate the vendored protocol packages for the frame server.
nix shell --impure --expr 'with (builtins.getFlake "nixpkgs").legacyPackages.${builtins.currentSystem}; [ (python3.withPackages (p: [ p.pywayland ])) wayland-scanner pkgs.wayland ]' \\
nix shell --impure --expr 'with (builtins.getFlake "nixpkgs").legacyPackages.x86_64-linux; [ (python3.withPackages (p: [ p.pywayland ])) wayland-scanner ]' \\
--command env HHSTREAM_PROTOCOL_DIR="$(nix eval --raw nixpkgs#hyprland.src)/protocols" \\
python3 -m hhstream._protocol.regenerate
HHSTREAM_WAYLAND_XML="$(nix eval --raw nixpkgs#wayland-scanner)/share/wayland/wayland.xml" \\
PYTHONPATH=src python3 -m hhstream._protocol.regenerate
The system is spelled out rather than written as `${builtins.currentSystem}`: in a
`nix shell --expr` string run from a shell, that interpolation is expanded by the
shell first and evaluates to nothing, and nix then rejects the expression with
`syntax error, unexpected ';'`. Copying the idiom is how two test runs in the
branch that added this file died, so it is not repeated here.
Run by hand after a bump, exactly like ``hhstream_pointer._protocol.regenerate`` —
same reasoning, same two moving parts, and the same warning that pywayland's own