This commit is contained in:
2026-08-02 23:53:38 +09:00
parent ac874a849e
commit aceb3d4808
6 changed files with 59 additions and 80 deletions
@@ -1,5 +1,6 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
services.hazkey.enable = true; services.hazkey.enable = true;
i18n.inputMethod = { i18n.inputMethod = {
@@ -8,6 +9,7 @@
fcitx5 = { fcitx5 = {
waylandFrontend = true; waylandFrontend = true;
addons = with pkgs; [ addons = with pkgs; [
fcitx5-gtk fcitx5-gtk
kdePackages.fcitx5-qt kdePackages.fcitx5-qt
@@ -17,14 +19,17 @@
settings = { settings = {
inputMethod = { inputMethod = {
GroupOrder."0" = "Default"; GroupOrder."0" = "Default";
"Groups/0" = { "Groups/0" = {
Name = "Default"; Name = "Default";
"Default Layout" = "jp"; "Default Layout" = "jp";
DefaultIM = "hazkey"; DefaultIM = "hazkey";
}; };
"Groups/0/Items/0" = { "Groups/0/Items/0" = {
Name = "keyboard-jp"; Name = "keyboard-jp";
}; };
"Groups/0/Items/1" = { "Groups/0/Items/1" = {
Name = "hazkey"; Name = "hazkey";
}; };
@@ -38,37 +43,14 @@
ModifierOnlyKeyTimeout = 250; ModifierOnlyKeyTimeout = 250;
}; };
"Hotkey/TriggerKeys" = { "Hotkey/TriggerKeys"."1" = "Zenkaku_Hankaku";
"1" = "Zenkaku_Hankaku"; "Hotkey/ActivateKeys"."0" = "Henkan";
}; "Hotkey/DeactivateKeys"."0" = "Muhenkan";
"Hotkey/PrevPage"."0" = "Up";
"Hotkey/ActivateKeys" = { "Hotkey/NextPage"."0" = "Down";
"0" = "Henkan"; "Hotkey/PrevCandidate"."0" = "Shift+Tab";
}; "Hotkey/NextCandidate"."0" = "Tab";
"Hotkey/TogglePreedit"."0" = "Control+Alt+P";
"Hotkey/DeactivateKeys" = {
"0" = "Muhenkan";
};
"Hotkey/PrevPage" = {
"0" = "Up";
};
"Hotkey/NextPage" = {
"0" = "Down";
};
"Hotkey/PrevCandidate" = {
"0" = "Shift+Tab";
};
"Hotkey/NextCandidate" = {
"0" = "Tab";
};
"Hotkey/TogglePreedit" = {
"0" = "Control+Alt+P";
};
Behavior = { Behavior = {
ActiveByDefault = false; ActiveByDefault = false;
+1 -1
View File
@@ -2,5 +2,5 @@
{ {
description = "Fcitx 5 input method framework with Hazkey Japanese input"; description = "Fcitx 5 input method framework with Hazkey Japanese input";
imports.nixos = [ inputs.nix-hazkey.nixosModules.hazkey ]; imports.home = [ inputs.nix-hazkey.homeModules.hazkey ];
} }
+42 -25
View File
@@ -1,5 +1,6 @@
{ lib, pkgs, ... }: { lib, pkgs, ... }:
let let
systemctl = lib.getExe' pkgs.systemd "systemctl";
action = key: name: { action = key: name: {
"@key" = key; "@key" = key;
action = { action = {
@@ -74,7 +75,7 @@ in
}; };
desktops = { desktops = {
"@number" = 9; "@number" = 1;
"@popupTime" = 500; "@popupTime" = 500;
"@prefix" = "Workspace"; "@prefix" = "Workspace";
}; };
@@ -85,19 +86,43 @@ in
keybind = [ keybind = [
(action "W-q" "Close") (action "W-q" "Close")
(action "W-f" "ToggleMaximize") (action "W-f" "ToggleMaximize")
(action "W-c" "Iconify")
(action "W-Tab" "NextWindow") (action "W-Tab" "NextWindow")
(action "W-S-Tab" "PreviousWindow") (action "W-S-Tab" "PreviousWindow")
(action "W-j" "NextWindow") (action "W-Up" "Lower")
(action "W-k" "PreviousWindow") (action "W-Down" "Raise")
(action "W-Left" "NextWindow")
(action "W-Right" "PreviousWindow")
{ {
"@key" = "W-a"; "@key" = "W-C-Left";
action = { action = {
"@name" = "ShowMenu"; "@name" = "SnapToEdge";
"@menu" = "client-list-combined-menu"; "@direction" = "left";
"@combine" = "yes";
}; };
position = { }
x = "center"; {
y = "center"; "@key" = "W-C-Right";
action = {
"@name" = "SnapToEdge";
"@direction" = "right";
"@combine" = "yes";
};
}
{
"@key" = "W-C-Up";
action = {
"@name" = "SnapToEdge";
"@direction" = "up";
"@combine" = "yes";
};
}
{
"@key" = "W-C-Down";
action = {
"@name" = "SnapToEdge";
"@direction" = "down";
"@combine" = "yes";
}; };
} }
(execute "W-t" "ghostty") (execute "W-t" "ghostty")
@@ -147,21 +172,13 @@ in
"XKB_DEFAULT_LAYOUT=jp" "XKB_DEFAULT_LAYOUT=jp"
"XKB_DEFAULT_OPTIONS=ctrl:nocaps" "XKB_DEFAULT_OPTIONS=ctrl:nocaps"
]; ];
# Pull in graphical-session.target so Home Manager services such as
# portals, Vicinae, and the idle manager follow the labwc session.
systemd.extraCommands = [
# The wlroots portal is conditionally started with WAYLAND_DISPLAY. It
# can otherwise be skipped before labwc imports its session environment,
# leaving the desktop portal without the ScreenCast interface.
"${lib.getExe' pkgs.systemd "systemctl"} --user restart xdg-desktop-portal-wlr.service"
"${lib.getExe' pkgs.systemd "systemctl"} --user restart xdg-desktop-portal.service"
# Clear the previous session's target first. Otherwise services such as
# kanshi that lose their Wayland connection on logout remain in a
# failed/start-limit-hit state and are not started for the next login.
"${lib.getExe' pkgs.systemd "systemctl"} --user stop labwc-session.target"
"${lib.getExe' pkgs.systemd "systemctl"} --user --no-block start labwc-session.target"
];
}; };
xdg.configFile."labwc/autostart".text = lib.mkAfter ''
${systemctl} --user --no-block start labwc-session.target
'';
xdg.configFile."labwc/shutdown".text = lib.mkAfter ''
${systemctl} --user stop graphical-session.target
'';
} }
-10
View File
@@ -7,14 +7,4 @@ in
enable = true; enable = true;
package = unstable.labwc; package = unstable.labwc;
}; };
xdg.portal.config.labwc.default = [
"wlr"
"gtk"
];
environment.systemPackages = [
pkgs.wdisplays
pkgs.wlr-randr
];
} }
+1 -13
View File
@@ -1,20 +1,8 @@
{ config, pkgs, ... }: { config, ... }:
let
wdisplays = pkgs.wdisplays.overrideAttrs (oldAttrs: {
patches = (oldAttrs.patches or [ ]) ++ [ ./wdisplays-canonical-scale.patch ];
});
in
{ {
programs.niri.enable = true; programs.niri.enable = true;
# niri-flake supplies the compositor package but does not register its # niri-flake supplies the compositor package but does not register its
# user units with NixOS. Without this, Ly cannot start niri-session. # user units with NixOS. Without this, Ly cannot start niri-session.
systemd.packages = [ config.programs.niri.package ]; systemd.packages = [ config.programs.niri.package ];
environment.systemPackages = [
# Keep the transient Wayland-native GUI, with fractional scales rounded to
# the same wl_fixed_t value that niri receives on the first Apply.
wdisplays
pkgs.wlr-randr # Wayland output management CLI
];
} }
+2
View File
@@ -32,5 +32,7 @@
environment.systemPackages = [ environment.systemPackages = [
pkgs.xwayland-satellite pkgs.xwayland-satellite
pkgs.uwsm pkgs.uwsm
pkgs.wlr-randr
pkgs.wdisplays
]; ];
} }