Skip to content

Package Hazkey blocked on Swift 6.1 packaging #3

Description

@hasundue

Summary

I investigated packaging upstream 7ka-Hiira/hazkey in this flake as a replacement for fcitx5-mozc on the desktop host.

The main blocker is Swift: upstream Hazkey currently requires Swift 6.1 for the server component, while the nixpkgs in this repo currently provides Swift 5.10.1.

Current integration points in this repo

  • Package exports live under packages/ and are wired through flake.nix via pkgs.callPackage.
  • Desktop fcitx5 config is in configs/home/desktop/fcitx5.nix.
  • The current IM addon is pkgs.fcitx5-mozc, and the configured engine is mozc.
  • configs/home/desktop/waybar.nix assumes the Japanese engine name is mozc for its JP status indicator.

Upstream Hazkey notes

  • Repository: https://github.com/7ka-Hiira/hazkey
  • The current repo bundles fcitx5-hazkey, hazkey-server, and hazkey-settings.
  • Upstream installs the fcitx5 addon/input method as hazkey, so config changes here would likely need to switch from mozc to hazkey.
  • Upstream uses git submodules for at least dictionary storage and llama.cpp, so fetchSubmodules = true is likely required.
  • AI/Zenzai support is a real requirement for this effort, so a non-AI fallback is not the target.

What I tried

1. Investigated packaging shape

I used Warashi's older fcitx5-hazkey packaging as prior art:

That package is useful for dependency/layout ideas, but it targets the older split repository and is not a drop-in solution for current upstream hazkey.

2. Verified local nixpkgs state

Observed locally:

  • swift = 5.10.1
  • swiftpm and swiftpm2nix are available

Baseline validation of this repo succeeded:

  • nix flake check

3. Probed upstream Hazkey build requirements

Relevant upstream findings:

  • hazkey-server/Package.swift declares // swift-tools-version: 6.1
  • hazkey-server depends on SwiftPM packages including AzooKeyKanaKanjiConverter and swift-protobuf
  • The fcitx5 input method metadata installs hazkey.conf under both addon and inputmethod paths

4. Tested the official Swift 6.1 Linux tarball

I fetched and probed the official Swift 6.1 Ubuntu toolchain tarball.

Good news:

  • the compiler binary itself can start under Nix once given the expected runtime libraries

Bad news:

  • the toolchain is not a clean drop-in fit for nixpkgs here
  • after fixing earlier runtime issues (ar, curl, ncurses), SwiftPM still failed on distro ABI expectations like libxml2.so.2
  • current nixpkgs provides different ABI/library layouts (for example, current libxml2 here exposes libxml2.so.16)

So the official Ubuntu Swift 6.1 tarball is not a robust solution for this flake.

5. Looked for a Nix-native Swift 6 source

I checked:

  • public GitHub code/repo search for community flakes/overlays
  • current nixpkgs issue/PR trail
  • the Swift 6 tracking discussion on NixOS Discourse

Findings:

  • there is active Swift 6 packaging work in the Nix community
  • I could not find a public, consumable Linux Swift 6 flake/overlay/branch/PR that can be dropped into this repo today

Blocker

Hazkey packaging is currently blocked on a public Nix-native Swift 6 toolchain source that is usable on Linux.

Without that, we cannot package current upstream Hazkey with AI/Zenzai support in a way that is consistent with this repo's Nix packaging approach.

Recommended next step

Resume this work when one of these is available:

  1. a public nixpkgs branch/PR exposing Swift 6.x for Linux
  2. a community-maintained Nix overlay/flake that provides a compatible Swift 6 toolchain
  3. a Nix-native local packaging effort for Swift 6 that avoids Ubuntu tarball ABI mismatches

Once unblocked, the implementation path in this repo should be:

  1. add a local Hazkey package under packages/
  2. export it from flake.nix
  3. replace fcitx5-mozc with Hazkey in configs/home/desktop/fcitx5.nix
  4. update configs/home/desktop/waybar.nix to recognize hazkey instead of mozc
  5. validate the package and Home Manager evaluation

Upstream

  • Issue #343210 — nixpkgs Swift 6 packaging tracker
  • Issue #405893 — nixpkgs Swift 6 packaging tracker

Search

Also check for new PRs matching: swift 6, author:reckenrode swift in NixOS/nixpkgs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions