fcitx5 on labwc

This commit is contained in:
2026-08-03 11:44:15 +09:00
parent d67d53644e
commit d5e4c90710
3 changed files with 89 additions and 71 deletions
+33 -1
View File
@@ -1,4 +1,9 @@
{ inputs, pkgs, ... }:
{
inputs,
pkgs,
lib,
...
}:
let
unstable = inputs.nixpkgs-unstable.legacyPackages.${pkgs.stdenv.hostPlatform.system};
in
@@ -7,4 +12,31 @@ in
enable = true;
package = unstable.labwc;
};
# NixOS decides whether a graphical session manages graphical-session.target
# itself by checking XDG_CURRENT_DESKTOP against a hard-coded list. Labwc is
# currently absent from that list, so NixOS starts
# nixos-fake-graphical-session.target before Labwc is ready.
#
# This configuration uses Home Manager's Labwc systemd integration, which
# imports the Wayland environment and starts labwc-session.target correctly.
# Mark the Labwc session as systemd-aware before the display-manager wrapper
# performs its hard-coded check. Otherwise services such as Fcitx5 can start
# before WAYLAND_DISPLAY is available.
#
# Despite the services.xserver namespace, this session wrapper is also used
# for Wayland sessions by display managers such as Ly.
services.xserver.displayManager.sessionCommands = lib.mkAfter ''
case ":''${XDG_CURRENT_DESKTOP:-}:" in
*:labwc:*)
case ":$XDG_CURRENT_DESKTOP:" in
*:X-NIXOS-SYSTEMD-AWARE:*)
;;
*)
export XDG_CURRENT_DESKTOP="$XDG_CURRENT_DESKTOP:X-NIXOS-SYSTEMD-AWARE"
;;
esac
;;
esac
'';
}