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,25 +1,39 @@
{ inputs, lib, pkgs, config, ... }:
let
{
inputs,
lib,
pkgs,
config,
...
}: let
# Disko setup
fsType = "btrfs"; # one of ext4 or btrfs. Use btrfs if using impermanence
dev = "/dev/nvme0n1"; # depends on target hardware
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";
impermanence = true;
in
{
imports =
[
in {
imports = [
# Create users for this host
../common/users/${user}
# Disk configuration
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
(import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
(import ../common/disks/btrfs/impermanence.nix {
btrfsMountDevice = btrfsMountDevice;
lib = lib;
})
# Import core options
./hardware-configuration.nix
@ -35,13 +49,13 @@ in
../common/optional/nfs-mounts/photos.nix
../common/optional/printing.nix
../common/optional/backlight.nix
../common/optional/xmodmap-arrow-remaps.nix
];
boot = {
blacklistedKernelModules = [ "snd_hda_intel" "snd_soc_skl" ];
kernelModules = [ "iwlwifi" ];
initrd.kernelModules = [ "thinkpad-acpi" "acpi-call" ];
blacklistedKernelModules = ["snd_hda_intel" "snd_soc_skl"];
kernelModules = ["iwlwifi"];
initrd.kernelModules = ["thinkpad-acpi" "acpi-call"];
kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest;
extraModulePackages = [
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 = {
bluetooth = {
enable = true;
@ -106,7 +110,7 @@ in
hostName = "citadel";
networkmanager.enable = true;
enableIPv6 = false;
nameservers = [ "10.0.10.60" "8.8.8.8" ];
nameservers = ["10.0.10.60" "8.8.8.8"];
};
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}";
}