From 8f62558424e37da8f3a5d519e868396754cb25d4 Mon Sep 17 00:00:00 2001 From: moons Date: Fri, 10 Jul 2026 17:52:45 +0900 Subject: [PATCH] hazkey --- flake.lock | 43 ++++++++++++++++++++++++++ flake.nix | 6 ++++ modules/applications/fcitx5/system.nix | 20 ++++++++++++ 3 files changed, 69 insertions(+) diff --git a/flake.lock b/flake.lock index 5cba7a0..e68c353 100644 --- a/flake.lock +++ b/flake.lock @@ -477,6 +477,27 @@ "type": "github" } }, + "home-manager_3": { + "inputs": { + "nixpkgs": [ + "nix-hazkey", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1778444552, + "narHash": "sha256-f18pIiR9q/p1vHY93gmAum7aHhQOG49oGvAB9+lptRo=", + "owner": "nix-community", + "repo": "home-manager", + "rev": "dcebe66f958673729896eec2de4abfd86ef22d21", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "home-manager", + "type": "github" + } + }, "lanzaboote": { "inputs": { "crane": "crane", @@ -581,6 +602,27 @@ "type": "github" } }, + "nix-hazkey": { + "inputs": { + "home-manager": "home-manager_3", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1779529080, + "narHash": "sha256-CHa5L3I71NbPUNJp1gmmwbh91tKsZPyuRK50mLHjAVY=", + "owner": "aster-void", + "repo": "nix-hazkey", + "rev": "24cb2926666836988e78ceebeb67ad6c5a387ac3", + "type": "github" + }, + "original": { + "owner": "aster-void", + "repo": "nix-hazkey", + "type": "github" + } + }, "nix-index-database": { "inputs": { "nixpkgs": [ @@ -909,6 +951,7 @@ "lanzaboote": "lanzaboote", "llm-agents": "llm-agents", "niri-flake": "niri-flake", + "nix-hazkey": "nix-hazkey", "nix-index-database": "nix-index-database", "nixos-hardware": "nixos-hardware", "nixos-wsl": "nixos-wsl", diff --git a/flake.nix b/flake.nix index ec39d72..a8723c8 100644 --- a/flake.nix +++ b/flake.nix @@ -89,6 +89,12 @@ # Systems systems.url = "github:nix-systems/default-linux"; + + # Japanese Input Method + nix-hazkey = { + url = "github:aster-void/nix-hazkey"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = diff --git a/modules/applications/fcitx5/system.nix b/modules/applications/fcitx5/system.nix index 03ef957..79212d1 100644 --- a/modules/applications/fcitx5/system.nix +++ b/modules/applications/fcitx5/system.nix @@ -2,9 +2,12 @@ pkgs, lib, config, + inputs, ... }: let + system = pkgs.stdenv.hostPlatform.system; + cfg = config.my.applications.fcitx5.system; in { @@ -12,13 +15,30 @@ in enable = lib.mkEnableOption "fcitx5 system configuration"; }; + imports = [ + inputs.nix-hazkey.nixosModules.hazkey + ]; + config = lib.mkIf cfg.enable { + + services.hazkey = { + enable = true; + server.package = inputs.nix-hazkey.packages.${system}.hazkey-server.override { + enableVulkan = true; + }; + installHazkeySettings = false; + installFcitx5Addon = false; + }; + + environment.systemPackages = [ inputs.nix-hazkey.packages.${system}.hazkey-settings ]; + i18n.inputMethod = { enable = true; type = "fcitx5"; fcitx5 = { waylandFrontend = true; addons = with pkgs; [ + inputs.nix-hazkey.packages.${system}.fcitx5-hazkey fcitx5-mozc-ut fcitx5-gtk kdePackages.fcitx5-qt