Skip to content

Commit

Permalink
steam: Add support for Steam IM input methods
Browse files Browse the repository at this point in the history
Signed-off-by: bigsaltyfishes <[email protected]>
  • Loading branch information
bigsaltyfishes committed Oct 31, 2024
1 parent c11bab1 commit 7f254c1
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/steam/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ in
./steam.nix
./autostart.nix
./environment.nix
./inputmethod.nix
];
options = {
jovian = {
Expand Down
60 changes: 60 additions & 0 deletions modules/steam/inputmethod.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{ config, lib, pkgs, ... }:

let
inherit (lib)
mkOption
types
elem
mkIf
optionals
;

cfg = config.jovian.steam.inputMethod;
in
{
options = {
jovian = {
steam = {
inputMethod = {
enable = mkOption {
type = types.bool;
default = false;
description = ''
Whether to enable the Steam IM support.
Enable this if you want to enable Steam IM support.
This will also set system wide input method to `ibus`.
'';
};
methods = mkOption {
type = types.listOf types.str;
default = [ ];
example = [ "pinyin" "japanese" "korean" ];
description = ''
List of input methods to enable.
This option is only used when `enable` is set to `true`.
'';
};
};
};
};
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [
steam-im-modules
];

i18n.inputMethod = {
enable = true;
type = "ibus";
ibus = {
engines = with pkgs.ibus-engines;
optionals (elem "pinyin" cfg.methods) [ pinyin ]
++ optionals (elem "japanese" cfg.methods) [ anthy ]
++ optionals (elem "korean" cfg.methods) [ hangul ];
};
};
};
}
1 change: 1 addition & 0 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ rec {
steam = final.callPackage ./pkgs/steam-jupiter/fhsenv.nix {
steam = prev.steam;
};
steam-im-modules = final.callPackage ./pkgs/steam-im-modules { };

sdgyrodsu = final.callPackage ./pkgs/sdgyrodsu { };

Expand Down
41 changes: 41 additions & 0 deletions pkgs/steam-im-modules/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{ stdenv
, fetchFromGitHub
, extra-cmake-modules
, libsForQt5
, gtk3
, gtk4
, lib
}:
stdenv.mkDerivation {
pname = "steam-im-modules";
version = "jupiter-20240131";

src = fetchFromGitHub {
owner = "valve-project";
repo = "steam-qt-keyboard-plugin";
rev = "eab7d4c13bbe1372b7b28731b8209c12037e91af";
sha256 = "L9rKEUxDT0fYrvnPIMJS5/wSq1W2KowreaxeXmcCq60=";
};

nativeBuildInputs = [
extra-cmake-modules
libsForQt5.wrapQtAppsHook
];

dontWrapQtApps = true;

buildInputs = [
libsForQt5.qtbase
gtk3
gtk4
];

cmakeBuildType = "RelWithDebInfo";

meta = with lib; {
description = "Steam Qt Keyboard Plug-in";
homepage = "https://github.com/valve-project/steam-qt-keyboard-plugin";
license = licenses.gpl3;
platforms = platforms.linux;
};
}

0 comments on commit 7f254c1

Please sign in to comment.