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:
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:
- a public nixpkgs branch/PR exposing Swift 6.x for Linux
- a community-maintained Nix overlay/flake that provides a compatible Swift 6 toolchain
- 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:
- add a local Hazkey package under
packages/
- export it from
flake.nix
- replace
fcitx5-mozc with Hazkey in configs/home/desktop/fcitx5.nix
- update
configs/home/desktop/waybar.nix to recognize hazkey instead of mozc
- 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.
Summary
I investigated packaging upstream
7ka-Hiira/hazkeyin this flake as a replacement forfcitx5-mozcon the desktop host.The main blocker is Swift: upstream Hazkey currently requires Swift
6.1for the server component, while the nixpkgs in this repo currently provides Swift5.10.1.Current integration points in this repo
packages/and are wired throughflake.nixviapkgs.callPackage.configs/home/desktop/fcitx5.nix.pkgs.fcitx5-mozc, and the configured engine ismozc.configs/home/desktop/waybar.nixassumes the Japanese engine name ismozcfor itsJPstatus indicator.Upstream Hazkey notes
fcitx5-hazkey,hazkey-server, andhazkey-settings.hazkey, so config changes here would likely need to switch frommozctohazkey.fetchSubmodules = trueis likely required.What I tried
1. Investigated packaging shape
I used Warashi's older
fcitx5-hazkeypackaging 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.1swiftpmandswiftpm2nixare availableBaseline validation of this repo succeeded:
nix flake check3. Probed upstream Hazkey build requirements
Relevant upstream findings:
hazkey-server/Package.swiftdeclares// swift-tools-version: 6.1hazkey-serverdepends on SwiftPM packages includingAzooKeyKanaKanjiConverterandswift-protobufhazkey.confunder both addon and inputmethod paths4. Tested the official Swift 6.1 Linux tarball
I fetched and probed the official Swift 6.1 Ubuntu toolchain tarball.
Good news:
Bad news:
ar,curl,ncurses), SwiftPM still failed on distro ABI expectations likelibxml2.so.2libxml2here exposeslibxml2.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:
Findings:
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:
Once unblocked, the implementation path in this repo should be:
packages/flake.nixfcitx5-mozcwith Hazkey inconfigs/home/desktop/fcitx5.nixconfigs/home/desktop/waybar.nixto recognizehazkeyinstead ofmozcUpstream
Search
Also check for new PRs matching:
swift 6,author:reckenrode swiftinNixOS/nixpkgs.