create xmodmap-arrow config

This commit is contained in:
Sam 2024-09-15 10:12:56 +01:00
parent 16fee36e96
commit afaf3c4697
2 changed files with 59 additions and 43 deletions

View File

@ -1,47 +1,61 @@
{ inputs, lib, pkgs, config, ... }: {
let inputs,
lib,
pkgs,
config,
...
}: let
# Disko setup # Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
dev = "/dev/nvme0n1"; # depends on target hardware dev = "/dev/nvme0n1"; # depends on target hardware
encrypted = true; # currrently only applies to btrfs encrypted = true; # currrently only applies to btrfs
btrfsMountDevice = if encrypted then "/dev/mapper/crypted" else "/dev/root_vg/root"; btrfsMountDevice =
if encrypted
then "/dev/mapper/crypted"
else "/dev/root_vg/root";
user = "sam"; user = "sam";
impermanence = true; impermanence = true;
in in {
{ imports = [
imports = # Create users for this host
[ ../common/users/${user}
# Create users for this host
../common/users/${user}
# Disk configuration # Disk configuration
inputs.disko.nixosModules.disko inputs.disko.nixosModules.disko
(import ../common/disks { device = dev; impermanence = impermanence; fsType = fsType; encrypted = encrypted; }) (import ../common/disks {
device = dev;
impermanence = impermanence;
fsType = fsType;
encrypted = encrypted;
})
# Impermanence # Impermanence
(import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; }) (import ../common/disks/btrfs/impermanence.nix {
btrfsMountDevice = btrfsMountDevice;
lib = lib;
})
# Import core options # Import core options
./hardware-configuration.nix ./hardware-configuration.nix
../common/core ../common/core
# Import optional options # Import optional options
../common/optional/persistence.nix ../common/optional/persistence.nix
../common/optional/pipewire.nix ../common/optional/pipewire.nix
../common/optional/openssh.nix ../common/optional/openssh.nix
../common/optional/dwm.nix ../common/optional/dwm.nix
../common/optional/nfs-mounts/media.nix ../common/optional/nfs-mounts/media.nix
../common/optional/nfs-mounts/homeshare.nix ../common/optional/nfs-mounts/homeshare.nix
../common/optional/nfs-mounts/photos.nix ../common/optional/nfs-mounts/photos.nix
../common/optional/printing.nix ../common/optional/printing.nix
../common/optional/backlight.nix ../common/optional/backlight.nix
../common/optional/xmodmap-arrow-remaps.nix
]; ];
boot = { boot = {
blacklistedKernelModules = [ "snd_hda_intel" "snd_soc_skl" ]; blacklistedKernelModules = ["snd_hda_intel" "snd_soc_skl"];
kernelModules = [ "iwlwifi" ]; kernelModules = ["iwlwifi"];
initrd.kernelModules = [ "thinkpad-acpi" "acpi-call" ]; initrd.kernelModules = ["thinkpad-acpi" "acpi-call"];
kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest; kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest;
extraModulePackages = [ extraModulePackages = [
config.boot.kernelPackages.acpi_call config.boot.kernelPackages.acpi_call
@ -81,16 +95,6 @@ in
}; };
}; };
# Remap Alt_L +[hjkl] to left down up right
services.xserver.displayManager.sessionCommands =
"${pkgs.xorg.xmodmap}/bin/xmodmap ${pkgs.writeText "xkb-layout" ''
keycode 64 = Mode_switch
keycode 43 = h H Left H
keycode 44 = j J Down J
keycode 45 = k K Up K
keycode 46 = l L Right L
''}";
hardware = { hardware = {
bluetooth = { bluetooth = {
enable = true; enable = true;
@ -106,7 +110,7 @@ in
hostName = "citadel"; hostName = "citadel";
networkmanager.enable = true; networkmanager.enable = true;
enableIPv6 = false; enableIPv6 = false;
nameservers = [ "10.0.10.60" "8.8.8.8" ]; nameservers = ["10.0.10.60" "8.8.8.8"];
}; };
services.libinput.enable = true; services.libinput.enable = true;

View File

@ -0,0 +1,12 @@
{pkgs, ...}: let
customLayout = pkgs.writeText "xkb-layout" ''
keycode 64 = Mode_switch
keycode 43 = h H Left H
keycode 44 = j J Down J
keycode 45 = k K Up K
keycode 46 = l L Right L
'';
in {
# Remap Alt_L +[hjkl] to left down up right
services.xserver.displayManager.sessionCommands = "sleep 5 && ${pkgs.xorg.xmodmap}/bin/xmodmap ${customLayout}";
}