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 # 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 # Create users for this host
../common/users/${user} ../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
@ -35,7 +49,7 @@ in
../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 = {
@ -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;

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}";
}