move out some common host settings to hosts/common.nix

This commit is contained in:
2025-01-08 22:14:14 -08:00
parent f30ff9962c
commit 79a0495760
8 changed files with 51 additions and 123 deletions

5
modules/mods/default.nix Normal file
View File

@@ -0,0 +1,5 @@
{ ... }: {
imports = [
./kb-input.nix
];
}

42
modules/mods/kb-input.nix Normal file
View File

@@ -0,0 +1,42 @@
{
pkgs,
config,
lib,
...
}: let
cfg = config.mods.kb-input;
in {
options = {
mods.kb-input = {
enable = lib.mkEnableOption "input method and custom keyboard layout";
};
};
config = lib.mkIf cfg.enable {
services.xserver.xkb.extraLayouts = {
minimak-4 = {
description = "English (US, Minimak-4)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
minimak-8 = {
description = "English (US, Minimak-8)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
minimak-12 = {
description = "English (US, Minimak-12)";
languages = [ "eng" ];
symbolsFile = ./minimak;
};
};
i18n.inputMethod = {
type = "fcitx5";
enable = true;
fcitx5.waylandFrontend = true;
fcitx5.plasma6Support = true;
fcitx5.addons = [ pkgs.fcitx5-mozc ];
};
};
}

70
modules/mods/minimak Normal file
View File

@@ -0,0 +1,70 @@
partial default alphanumeric_keys
xkb_symbols "minimak-4" {
// Describes the differences between a basic US keyboard layout and
// Minimak-4
include "us(basic)"
name[Group1]="English (US, Minimak-4)";
key <AD03> { [ d, D ] };
key <AD05> { [ k, K ] };
key <AC03> { [ t, T ] };
key <AC08> { [ e, E ] };
include "level3(ralt_switch_multikey)"
};
partial default alphanumeric_keys
xkb_symbols "minimak-8" {
// Describes the differences between a basic US keyboard layout and
// Minimak-8
include "us(basic)"
name[Group1]="English (US, Minimak-8)";
key <AD03> { [ d, D ] };
key <AD05> { [ k, K ] };
key <AD09> { [ l, L ] };
key <AC03> { [ t, T ] };
key <AC07> { [ n, N ] };
key <AC08> { [ e, E ] };
key <AC09> { [ o, O ] };
key <AB06> { [ j, J ] };
include "level3(ralt_switch_multikey)"
};
partial default alphanumeric_keys
xkb_symbols "minimak-12" {
// Describes the differences between a basic US keyboard layout and
// Minimak-12
include "us(basic)"
name[Group1]="English (US, Minimak-12)";
key <AD03> { [ d, D ] };
key <AD04> { [ f, F ] };
key <AD05> { [ k, K ] };
key <AD09> { [ l, L ] };
key <AD10> { [ semicolon, colon ] };
key <AC03> { [ t, T ] };
key <AC04> { [ r, R ] };
key <AC07> { [ n, N ] };
key <AC08> { [ e, E ] };
key <AC09> { [ o, O ] };
key <AC10> { [ p, P ] };
key <AB06> { [ j, J ] };
include "level3(ralt_switch_multikey)"
};