From 524fc532ed9e2292d3f1726870891d3aae0b9c14 Mon Sep 17 00:00:00 2001 From: Lukas Date: Tue, 24 Jun 2025 14:16:00 +0200 Subject: [PATCH] katana --- home/lukas/catppuccin.nix | 18 ++++++- home/lukas/packages.nix | 2 + hosts/segfault-machine/configuration.nix | 3 +- modules/desktop/plasma.nix | 18 ++----- modules/input/katana.nix | 64 ++++++++++++++++++++++++ 5 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 modules/input/katana.nix diff --git a/home/lukas/catppuccin.nix b/home/lukas/catppuccin.nix index 01dcda0..c43a5b9 100644 --- a/home/lukas/catppuccin.nix +++ b/home/lukas/catppuccin.nix @@ -1,4 +1,4 @@ -{ inputs, ... }: +{ inputs, pkgs, ... }: { imports = [ inputs.catppuccin.homeModules.catppuccin ]; @@ -11,4 +11,20 @@ delta.enable = true; # <- colours delta with your mauve accent }; + gtk = { + enable = true; + catppuccin = { + enable = true; + cursor = { + enable = true; + flavor = "mocha"; + accent = "mauve"; + }; + }; + cursorTheme = { + size = 38; + name = "catppuccin-mocha-mauve-cursors"; + }; + }; + } diff --git a/home/lukas/packages.nix b/home/lukas/packages.nix index 3821d14..ced3fbe 100644 --- a/home/lukas/packages.nix +++ b/home/lukas/packages.nix @@ -26,6 +26,8 @@ pkgs.binutils pkgs.gcc + pkgs.nil + (pkgs.aspellWithDicts (dicts: with dicts; [ de en en-computers ])) diff --git a/hosts/segfault-machine/configuration.nix b/hosts/segfault-machine/configuration.nix index c44214c..cc81ab8 100644 --- a/hosts/segfault-machine/configuration.nix +++ b/hosts/segfault-machine/configuration.nix @@ -1,8 +1,9 @@ -{ config, pkgs, ... }: { +{ pkgs, ... }: { imports = [ ./hardware.nix ../../users/lukas.nix ../../modules/desktop/plasma.nix + ../../modules/input/katana.nix ../../modules/networking/networkmanager.nix ../../modules/system/locale.nix ../../modules/system/audio.nix diff --git a/modules/desktop/plasma.nix b/modules/desktop/plasma.nix index 1b38c68..5751502 100644 --- a/modules/desktop/plasma.nix +++ b/modules/desktop/plasma.nix @@ -1,18 +1,10 @@ { config, pkgs, ... }: { - # X11/KDE Plasma + # gnome services.xserver.enable = true; - services.displayManager.sddm.enable = true; - services.desktopManager.plasma6.enable = true; + services.xserver.displayManager.gdm.enable = true; + services.xserver.desktopManager.gnome.enable = true; - # Tastatur - services.xserver.xkb = { - layout = "de"; - variant = ""; - # swap caps and esc - options = "caps:swapescape"; - }; - - # Konsole-Tastatur - console.keyMap = "de"; + # we use wayland -> hint electron apps to use wayland + environment.sessionVariables.NIXOS_OZONE_WL = "1"; } diff --git a/modules/input/katana.nix b/modules/input/katana.nix new file mode 100644 index 0000000..4f55e19 --- /dev/null +++ b/modules/input/katana.nix @@ -0,0 +1,64 @@ +{ inputs, pkgs, ... }: +{ + # Enable the uinput module + boot.kernelModules = [ "uinput" ]; + + # Enable uinput + hardware.uinput.enable = true; + + # Set up udev rules for uinput + services.udev.extraRules = '' + KERNEL=="uinput", MODE="0660", GROUP="uinput", OPTIONS+="static_node=uinput" + ''; + + # Ensure the uinput group exists + users.groups.uinput = { }; + + # Add the Kanata service user to necessary groups + systemd.services.kanata-internalKeyboard.serviceConfig = { + SupplementaryGroups = [ + "input" + "uinput" + ]; + }; + + services.kanata = { + enable = true; + keyboards = { + internalKeyboard = { + devices = [ + # Replace the paths below with the appropriate device paths for your setup. + # Use `ls /dev/input/by-path/` to find your keyboard devices. + "pci-0000:66:00.0-usb-0:2.3:1.0-event-kbd" + "pci-0000:66:00.0-usb-0:2.4:1.0-event-kbd" + "pci-0000:66:00.0-usb-0:2.4:1.2-event-kbd" + "pci-0000:66:00.0-usbv2-0:2.3:1.0-event-kbd" + "pci-0000:66:00.0-usbv2-0:2.4:1.0-event-kbd" + "pci-0000:66:00.0-usbv2-0:2.4:1.2-event-kbd" + "platform-i8042-serio-0-event-kbd" + ]; + extraDefCfg = "process-unmapped-keys yes"; + config = '' + (defsrc + caps tab d h j k l + ) + (defvar + tap-time 200 + hold-time 200 + ) + (defalias + caps (tap-hold 200 200 esc lctl) + tab (tap-hold $tap-time $hold-time tab (layer-toggle arrow)) + del del ;; Alias for the true delete key action + ) + (deflayer base + @caps @tab d h j k l + ) + (deflayer arrow + _ _ @del left down up right + ) + ''; + }; + }; + }; +}