summaryrefslogtreecommitdiff
path: root/hosts/local/master
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/local/master')
-rw-r--r--hosts/local/master/configuration.nix3
-rw-r--r--hosts/local/master/keyboard.nix2
-rw-r--r--hosts/local/master/rgb.nix30
-rw-r--r--hosts/local/master/thinkpad2.kbd105
-rw-r--r--hosts/local/master/xorg.conf63
5 files changed, 202 insertions, 1 deletions
diff --git a/hosts/local/master/configuration.nix b/hosts/local/master/configuration.nix
index e228246..375c10b 100644
--- a/hosts/local/master/configuration.nix
+++ b/hosts/local/master/configuration.nix
@@ -8,11 +8,13 @@
../../linux.nix
../../unfree.nix
#../../android.nix
+ ../gui.nix
../i3.nix
# ../gnome.nix
# ../wayland.nix
../nvidia.nix
./keyboard.nix
+ ./rgb.nix
];
# Use the systemd-boot EFI boot loader.
@@ -46,6 +48,7 @@
environment.systemPackages = [
pkgs.nodejs
pkgs.python312
+ # pkgs.openrgb-with-all-plugins
];
system.stateVersion = "23.11"; # Did you read the comment?
diff --git a/hosts/local/master/keyboard.nix b/hosts/local/master/keyboard.nix
index 852f084..d6ba135 100644
--- a/hosts/local/master/keyboard.nix
+++ b/hosts/local/master/keyboard.nix
@@ -31,7 +31,7 @@
keyboards = {
wirelessThinkpad = {
device = "/dev/input/by-id/usb-Lenovo_TrackPoint_Keyboard_II-event-kbd";
- config = builtins.readFile ./thinkpad.kbd;
+ config = builtins.readFile ./thinkpad2.kbd;
};
wiredThinkpad = {
device = "/dev/input/by-id/usb-Lenovo_ThinkPad_Compact_USB_Keyboard_with_TrackPoint-event-kbd";
diff --git a/hosts/local/master/rgb.nix b/hosts/local/master/rgb.nix
new file mode 100644
index 0000000..66dbbfb
--- /dev/null
+++ b/hosts/local/master/rgb.nix
@@ -0,0 +1,30 @@
+{
+ pkgs,
+ lib,
+ ...
+}: let
+ no-rgb = pkgs.writeScriptBin "no-rgb" ''
+ #!/bin/sh
+ NUM_DEVICES=$(${pkgs.openrgb}/bin/openrgb --noautoconnect --list-devices | grep -E '^[0-9]+: ' | wc -l)
+
+ for i in $(seq 0 $(($NUM_DEVICES - 1))); do
+ ${pkgs.openrgb}/bin/openrgb --noautoconnect --device $i --mode static --color 000000
+ done
+ '';
+in {
+ # config = {
+ # services.udev.packages = [pkgs.openrgb];
+ services.hardware.openrgb.enable = true;
+ # boot.kernelModules = ["i2c-dev"];
+ # hardware.i2c.enable = true;
+
+ # systemd.services.no-rgb = {
+ # description = "no-rgb";
+ # serviceConfig = {
+ # ExecStart = "${no-rgb}/bin/no-rgb";
+ # Type = "oneshot";
+ # };
+ # wantedBy = ["multi-user.target"];
+ # };
+ # };
+}
diff --git a/hosts/local/master/thinkpad2.kbd b/hosts/local/master/thinkpad2.kbd
new file mode 100644
index 0000000..c407475
--- /dev/null
+++ b/hosts/local/master/thinkpad2.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_TrackPoint_Keyboard_II-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
+ _ _ _ _ _ _ \) ] } > | _ _
+ _ _ _ _ _ _ _ _ _ _ _
+)
diff --git a/hosts/local/master/xorg.conf b/hosts/local/master/xorg.conf
new file mode 100644
index 0000000..cc521a6
--- /dev/null
+++ b/hosts/local/master/xorg.conf
@@ -0,0 +1,63 @@
+# nvidia-settings: X configuration file generated by nvidia-settings
+# nvidia-settings: version 570.86.16
+
+Section "ServerLayout"
+ Identifier "Layout0"
+ Screen 0 "Screen0" 0 0
+ InputDevice "Keyboard0" "CoreKeyboard"
+ InputDevice "Mouse0" "CorePointer"
+ Option "Xinerama" "0"
+EndSection
+
+Section "Files"
+EndSection
+
+Section "InputDevice"
+ # generated from default
+ Identifier "Mouse0"
+ Driver "mouse"
+ Option "Protocol" "auto"
+ Option "Device" "/dev/input/mice"
+ Option "Emulate3Buttons" "no"
+ Option "ZAxisMapping" "4 5"
+EndSection
+
+Section "InputDevice"
+ # generated from default
+ Identifier "Keyboard0"
+ Driver "kbd"
+EndSection
+
+Section "Monitor"
+ # HorizSync source: edid, VertRefresh source: edid
+ Identifier "Monitor0"
+ VendorName "Unknown"
+ ModelName "Microstep MSI MP2412"
+ HorizSync 93.0 - 93.0
+ VertRefresh 48.0 - 100.0
+ Option "DPMS"
+EndSection
+
+Section "Device"
+ Identifier "Device0"
+ Driver "nvidia"
+ VendorName "NVIDIA Corporation"
+ BoardName "NVIDIA GeForce RTX 4090"
+EndSection
+
+Section "Screen"
+ Identifier "Screen0"
+ Device "Device0"
+ Monitor "Monitor0"
+ DefaultDepth 24
+ Option "Stereo" "0"
+ Option "nvidiaXineramaInfoOrder" "HDMI-0"
+ Option "metamodes" "DP-0: 1920x1080_100 +0+240 {rotation=left}, HDMI-0: 3840x2160_60 +1080+0 {ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"
+ Option "SLI" "Off"
+ Option "MultiGPU" "Off"
+ Option "BaseMosaic" "off"
+ SubSection "Display"
+ Depth 24
+ EndSubSection
+EndSection
+