summaryrefslogtreecommitdiff
path: root/hosts/local/master
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/local/master')
-rw-r--r--hosts/local/master/configuration.nix12
-rw-r--r--hosts/local/master/default.nix1
-rw-r--r--hosts/local/master/keyboard.nix58
-rw-r--r--hosts/local/master/thinkpad.kbd105
4 files changed, 137 insertions, 39 deletions
diff --git a/hosts/local/master/configuration.nix b/hosts/local/master/configuration.nix
index 4888f30..aa12e1c 100644
--- a/hosts/local/master/configuration.nix
+++ b/hosts/local/master/configuration.nix
@@ -6,13 +6,13 @@
# Include the results of the hardware scan.
../../base.nix
../../linux.nix
- # ../../unfree.nix
+ ../../unfree.nix
#../../android.nix
- # ../i3.nix
+ ../i3.nix
# ../gnome.nix
- # ../wayland.nix
+ #../wayland.nix
../nvidia.nix
- ./keyboard.nix
+ ./keyboard.nix
];
# Use the systemd-boot EFI boot loader.
@@ -32,8 +32,8 @@
time.timeZone = "Asia/Bangkok";
# Enable the OpenSSH daemon.
- services.openssh.enable = true;
- services.openssh.ports = [5555];
+ # services.openssh.enable = true;
+ # services.openssh.ports = [5555];
# This value determines the NixOS release from which the default
# settings for stateful data, like file locations and database versions
diff --git a/hosts/local/master/default.nix b/hosts/local/master/default.nix
index 91e5016..e2ee3e0 100644
--- a/hosts/local/master/default.nix
+++ b/hosts/local/master/default.nix
@@ -1,4 +1,5 @@
inputs: [
+ {nixpkgs.config.allowUnfree = true;}
inputs.kmonad.nixosModules.default
./hardware-configuration.nix
./configuration.nix
diff --git a/hosts/local/master/keyboard.nix b/hosts/local/master/keyboard.nix
index 215d05f..d9f6d84 100644
--- a/hosts/local/master/keyboard.nix
+++ b/hosts/local/master/keyboard.nix
@@ -1,46 +1,38 @@
-{ config, lib, pkgs, ... }:
-
-{
- services.logind.extraConfig = ''
+{pkgs, ...}: {
+ services.logind.extraConfig = ''
# don’t shutdown when power button is short-pressed
HandlePowerKey=ignore
'';
-# config file keeps getting rewritten but I don't know by who
- # i18n.inputMethod = {
- # enabled = "fcitx5";
- # fcitx5.addons = with pkgs; [
- # fcitx5-mozc
- # # mozc-ut is better, wat do
- # fcitx5-gtk
- # libsForQt5.fcitx5-qt
- # fcitx5-lua
- # fcitx5-configtool
- # fcitx5-rime
- # ];
- # };
+ # config file keeps getting rewritten but I don't know by who
+ i18n.inputMethod = {
+ enable = true;
+ type = "fcitx5";
+ fcitx5.addons = with pkgs; [
+ fcitx5-mozc
+ # mozc-ut is better, wat do
+ fcitx5-gtk
+ libsForQt5.fcitx5-qt
+ fcitx5-lua
+ fcitx5-configtool
+ fcitx5-rime
+ ];
+ };
environment.variables = {
GTK_IM_MODULE = "fcitx";
- QT_IM_MODULE = "fcitx";
+ QT_IM_MODULE = "fcitx";
XMODIFIERS = "@im=fcitx";
FCITX_SOCKET = "default";
};
-
- #kmonad
- services.kmonad ={
- enable = true;
-
- keyboards.internal = {
- device = "/dev/input/by-id/usb-Compx_2.4G_Receiver-event-kbd";
- config = builtins.readFile ./compx.kbd;
- # device = "/dev/input/by-id/usb-RAPOO_Rapoo_2.4G_Wireless_Device-if02-event-kbd";
- # config = builtins.readFile ./rapoo.kbd;
-
- # defcfg = {
- # enable = true;
- # fallthrough = true;
- # };
+ #kmonad
+ services.kmonad = {
+ enable = true;
+ keyboards = {
+ usbThinkpad = {
+ device = "/dev/input/by-id/usb-Lenovo_TrackPoint_Keyboard_II-event-kbd";
+ config = builtins.readFile ./thinkpad.kbd;
};
};
+ };
}
diff --git a/hosts/local/master/thinkpad.kbd b/hosts/local/master/thinkpad.kbd
new file mode 100644
index 0000000..6f9c253
--- /dev/null
+++ b/hosts/local/master/thinkpad.kbd
@@ -0,0 +1,105 @@
+;; one liner comments ';;'
+#| Multiline
+ comments |#
+
+(defcfg ;; For linux & by-id lists pluggable devices
+;; If a key is not bound/left_empty(_) then it will fall back to the previous
+;; layer's binding if not then default.
+fallthrough true
+;; To run system commands. You MIGHT face issues with tiling window managers due to command helpers.
+;; allow-cmd true
+;; use 'ls /dev/input/by-id/' for detachable keyboards and
+;; 'ls /dev/input/by-path/' for builtin keyboards location'
+input (device-file "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_USB_Keyboard_with_TrackPoint-event-kbd")
+;; Not sure what this does. Please check the docs.
+output (uinput-sink "My KMonad output")
+)
+
+;; This is the real representation of your actual keyboard. We haven't started
+;; customizing layouts yet.
+(defsrc
+ esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
+ ` 1 2 3 4 5 6 7 8 9 0 - = bspc
+ tab q w e r t y u i o p [ ] \
+ caps a s d f g h j k l ; ' ret
+ lsft z x c v b n m , . / rsft
+ lctl lmet lalt spc ralt rctl pgup up pgdn
+ left down right
+)
+;; Aliases
+
+(defalias
+;; Layer toggles
+sym (layer-toggle syms)
+sym2 (layer-toggle syms2)
+cords (sticky-key 1000 (layer-toggle mods))
+;;
+hrt (layer-switch homerowmods)
+back (layer-switch qwerty)
+
+;; Homerow keys
+a (tap-hold-next-release 280 a lctl)
+s (tap-hold-next-release 280 s lalt)
+d (tap-hold-next-release 280 d lmet)
+f (tap-hold-next-release 280 f lsft)
+;;
+j (tap-hold-next-release 280 j rsft)
+k (tap-hold-next-release 280 k lmet)
+l (tap-hold-next-release 280 l lalt)
+semi (tap-hold-next-release 280 ; rctl)
+
+;; button to launch brave browser
+;; veeb (cmd-button "brave")
+;; ssf (sticky-key 500 (layer-toggle rshift))
+;; rsf (layer-toggle rshift)
+)
+
+;; The first custom layer is the one that gets activated when kmonad is started
+(deflayer qwerty ;; The default layer that'd be read when you launch kmonad
+ esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
+ ` 1 2 3 4 5 6 7 8 9 0 - = bspc
+ tab q w e r t y u i o p [ ] \
+ esc a s d f g h j k l ; ' ret
+ @sym z x c v b n m , . / rsft
+ lctl lmet @sym spc @cords @hrt left up right
+ left down right
+)
+(deflayer homerowmods
+ esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
+ ` 1 2 3 4 5 6 7 8 9 0 - = bspc
+ tab q w e r t y u i o p [ ] \
+ esc @a @s @d @f g h @j @k @l @semi ' ret
+ @sym z x c v b n m , . / rsft
+ lctl lmet @sym spc lalt @back left up right
+ left down right
+)
+(deflayer mods
+ esc f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 del
+ ` 1 2 3 4 5 6 7 8 9 0 - = bspc
+ tab q w e r t y u i o p [ ] h
+ esc lctl lalt lmet lsft g h rsft rmet ralt rctl ' ret
+ @sym z x c v b n m , . / rsft
+ lctl lmet @sym spc lalt @back left up right
+ left down right
+)
+
+;; A layer dedicated to symbols
+(deflayer syms
+ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ _ _ _ up _ _ ! @ # $ % _ _ _
+ _ _ left down right @sym2 ' ^ & - = _ ret
+ _ _ _ _ _ _ \( [ { < \ _ _
+ _ _ _ _ _ _ _ _ _ _ _
+)
+
+
+;; More symbols
+(deflayer syms2
+ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ _ _ _ _ _ _ _ _ _ _ _ _ _ _
+ _ _ _ _ _ _ ` ~ * \_ + _ ret
+ _ _ _ _ _ _ \) ] } > | _ _
+ _ _ _ _ _ _ _ _ _ _ _
+)