wayland_nix_py313: keeping up with modern DEs and nix(os) #53

Merged
goodboy merged 12 commits from wayland_nix_py313 into main 2026-01-02 21:47:41 +00:00

Bumping us to python3.13, adding support for Qt6 on wayland (particularly the sway twm) and redoing our flake.nix to use pyproject.nix’s impure template (after already trying but realizing we don’t yet need it’s downstream lib uv2nix).

A major note is that the rewritten flake.nix should only be used on wayland DEs for the moment, we already have the default.nix (now also updated for py313) for those still using X11 on nix.


Usage instructions

To use the wayland overlay via flake.nix use,

nix develop

or

nix develop uv run xonsh

if using a custom shell like @goodboy B)

If still on X, continue with the old instructions from our readme.

Some thanks goes out to @ntorres for the original default.nix which helped me resolve a few problems with lib linking for Qt and various other extension-lang python libs.


Summary of required adjustments

For uv on nixos using a re-written flake.nix,

  • rip out all the old poetry2nix; we’re using uvnow.
  • base off the impure template from pyproject.nix.
  • include interactive bash pkgs for tab completion.
  • include ruff for in-devsh/overlay linting (@goodboy uses it via nvim plugin).
  • obvi flip to <nixpkgs>.python313, set using a new cypthon var.
  • use <nixpkgs>.qt6.qtwayland for wayland extension/plugins.
    • add /plugins path linking to make things just work on wayland.
    • include masked osenv flag for debugging plugin load sequence.
    • for now, set QT_QPA_PLATFORM="wayland".
  • always run our full uv sync --dev --all-extras --no-group lint cmd, the lint group is not included on nix since we want the nixpkgs.ruff NOT the wheel uv will pull in.
    • also see comments on re-orged pyproject.toml below.

Update and modularize the pyproject.toml with more dep-groups,

  • allow py 3.13+
  • updates to various primary deps.
  • rework the [dependency-groups] to include,
    • uis for all graphical libs.
    • repl for optional extended console tooling used for both tractor’s debugger and xonsh.
    • testing which should be obvious.
    • de for desktop-env specific client libs required for some special use cases (only in the ib backend rn).
    • lint which now includes just ruff so that it can be optionally un-included per nix-overlay comment above.
    • dbs for (hopefully soon to be dropped) external clients still optionally used in legacy parts of the code base.
    • make dev now use nested includes of these other ^ groups as needed.
  • add tool.pytest.ini_options] config with a special note to not load the xonsh builtin pytest plugin it ships.
  • re [tool.uv] tweaks,
    • always prefer the sys cpython over astral distis
    • ensure we’re always prompted about interpreter downloads when the sys doesn’t contain a needed version.
    • set the default-groups = ['uis', 'dev'] such that a normal install includes charting GUIs.
  • bring in new use of the pyvnc lib from GH; replaces an older asyncvnc which is un-maintained and had impeding bugs.
  • flip tractor to use the piker_pin branch from GH.

Update the default.nix to python 3.13,

  • add a pypkgs var to avoid hardcoding pythonXXXPackages everywhere.
  • adjust various pkg keys (attrs) to new names where required.
  • use uv sync --dev --all-extras over uv lock in shellHook.

Oh right and mask the dummy-variable-rgx in our ruff.toml which was causing my ALE plugin to fail..

Bumping us to python3.13, adding support for Qt6 on wayland (particularly the `sway` twm) and redoing our `flake.nix` to use `pyproject.nix`'s impure template (after already trying but realizing we don't yet need it's downstream lib `uv2nix`). A major note is that the rewritten `flake.nix` should **only be used on wayland** DEs for the moment, we already have the `default.nix` (now also updated for `py313`) for those still using X11 on nix. --- #### Usage instructions To use the wayland overlay via `flake.nix` use, `nix develop` or `nix develop uv run xonsh` if using a custom shell like @goodboy B) If still on X, continue with the old instructions from our readme. Some thanks goes out to @ntorres for the original `default.nix` which helped me resolve a few problems with lib linking for Qt and various other extension-lang python libs. --- #### Summary of required adjustments For `uv` on nixos using a re-written [`flake.nix`](https://www.pikers.dev/pikers/piker/pulls/53/files#diff-58cb4f58166586c1ed7f076c568d41682df3661c), - rip out all the old `poetry2nix`; we're using `uv `now. - base off the [impure template](https://pyproject-nix.github.io/pyproject.nix/templates.html#impure) from `pyproject.nix`. - include interactive bash pkgs for tab completion. - include `ruff` for in-devsh/overlay linting (@goodboy uses it via `nvim` plugin). - obvi flip to `<nixpkgs>.python313`, set using a new `cypthon` var. - use `<nixpkgs>.qt6.qtwayland` for wayland extension/plugins. * add `/plugins` path linking to make things *just work* on wayland. * include masked osenv flag for debugging plugin load sequence. * for now, `set QT_QPA_PLATFORM="wayland"`. - always run our full `uv sync --dev --all-extras --no-group lint` cmd, the `lint` group is not included on nix since we want the `nixpkgs.ruff` NOT the wheel `uv` will pull in. * also see comments on re-orged `pyproject.toml` below. --- Update and modularize the `pyproject.toml` with more dep-groups, - allow py 3.13+ - updates to various primary deps. - rework the `[dependency-groups]` to include, * `uis` for all graphical libs. * `repl` for optional extended console tooling used for both `tractor`'s debugger and `xonsh`. * `testing` which should be obvious. * `de` for desktop-env specific client libs required for some special use cases (only in the `ib` backend rn). * `lint` which now includes just `ruff` so that it can be optionally un-included per nix-overlay comment above. * `dbs` for (hopefully soon to be dropped) external clients still optionally used in legacy parts of the code base. * make `dev` now use nested includes of these other ^ groups as needed. - add `tool.pytest.ini_options]` config with a special note to not load the `xonsh` builtin `pytest` plugin it ships. - re `[tool.uv]` tweaks, * always prefer the sys cpython over astral distis * ensure we're always prompted about interpreter downloads when the sys doesn't contain a needed version. * set the `default-groups = ['uis', 'dev']` such that a normal install includes charting GUIs. - bring in new use of the `pyvnc` lib from GH; replaces an older `asyncvnc` which is un-maintained and had impeding bugs. - flip `tractor` to use the `piker_pin` branch from GH. --- Update the `default.nix` to python 3.13, - add a `pypkgs` var to avoid hardcoding `pythonXXXPackages` everywhere. - adjust various pkg keys (attrs) to new names where required. - use `uv sync --dev --all-extras` over `uv lock` in `shellHook`. --- Oh right and mask the `dummy-variable-rgx` in our `ruff.toml` which was causing my `ALE` plugin to fail..
goodboy added 10 commits 2026-01-02 18:15:33 +00:00
6d6ca1a908 Don't pin `pendulum` version so we can use wheel
Bump version in lock file to match.
ff045f699f Redo `flake.nix` using `pyproject.nix` recos
Particularly using their recommended "impure template",
- https://pyproject-nix.github.io/pyproject.nix/templates.html#impure
- code: https://github.com/pyproject-nix/pyproject.nix/blob/master/templates/impure/flake.nix

Note the `shellHook` now contains various `uv`-specific osenv settings
and cmds to get a dev-env setup the way i would do it by default, that
includes all dev and extra (group) deps. For now i've hard coded the
"virt-env subdir" used by `uv` to match the cpython version. We can
obviously parameterize this much better in the future.

For those who want to spawn a diff shell then bash see the commented
line, for ex. i personally use `nix develop -c uv run xonsh`.
5337f8abee nix: make Qt6 work on wayland
Taking many tips from our `default.nix` (thanks @nt!) this seems to be
the minimal overlay required for a flake to get up and running with
`piker chart` B)

Notes,
- for now, we're pinning to a major `cpython` version (3.13)
- ensure we (can) build with `nixpkgs.qt6.qtwayland`
- add the minimal Qt ld-lib-path linkings including those for plugin
  use (required for wayland mode).
- for now, hardcode "wayland" platform-mode and the linux standard
  "xdg-shell" integration.
- leave some TODOs to better parameterize around py versions.
ffd6438b88 Add bash-completion pkgs to flake overlay
Mks completions work inside custom embedded shells (like `xonsh`!).
51fb871f57 Skip `ruff` dev-dep on nix(os) overlays
Since the linking will be borked if we pull the wheel using `uv`; we
need to instead delegate to the `nixpkgs` version in the dev-shell.

`pyrpoject` deats,
- add a new deps-group: 'lint' which contains `ruff`.
- drop `ruff` from std deps (not sure how it got there anyway).
- mv `elasticsearch` to a new `dbs` deps group (we don't really even
  want to be using it in the near furure).
- mv `uis` group into dep-groups section from `project.optionals-deps`.
- add a `tool.uv.default-groups = ['uis', 'dev']` setting which then
  will avoid install of any non-explicit extras.
- put `rapidfuzz` only in `uis` group.

`flake.nix` tweaks,
- include `ruff` and `pypkgs.ruff` in the overlay.
- pass `--no-group ruff` to the `uv sync` line of shell init.
1e6fa8675d A better dep-groups specificity breakdown
Trying to start organizing non-hard deps into groups with sensible
"domain names" as it were. I coulda sworn we originally had at least UI
libs setup this way.. musta got lost in prior nix(os) porting.

Specifics,
- move all Qt and `rapidfuzz` deps into the `uis` group.
- add a new `repl` group for all the `pdbp` (debugging utils) and
  `xonsh` (@goodboy's shell pref) related console related extensions.
- add a `testing` group for the harness' needs.
- add a `de` for (as of rn) TWM specific libs.
- nest all the new ^ groups in the `dev` group as needed.
64828d2fe1 Bump `uv.lock` on nixos
Namely from `pyproject.toml` re-org of dep-groups.
7498c221a8 Drop variable regex from `ruff.toml`
Same as in other projects, seems to be not parsing and causing `ruff` to
crash?!?
goodboy requested review from guille 2026-01-02 18:15:47 +00:00
goodboy requested review from ntorres 2026-01-02 18:15:47 +00:00
goodboy changed title from wayland_nix_py313: keeping up with the DE trendz to wayland_nix_py313: keeping up with modern DEs and nix(os) 2026-01-02 18:22:17 +00:00
goodboy added 1 commit 2026-01-02 19:01:58 +00:00
goodboy added 1 commit 2026-01-02 19:08:04 +00:00
goodboy merged commit ff49ff0376 into main 2026-01-02 21:47:41 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: pikers/piker#53
There is no content yet.