diff --git a/hosts/citadel/default.nix b/hosts/citadel/default.nix index a364c12..3ac3329 100644 --- a/hosts/citadel/default.nix +++ b/hosts/citadel/default.nix @@ -1,47 +1,61 @@ -{ 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 = - [ - # Create users for this host - ../common/users/${user} +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; }) + # Disk configuration + inputs.disko.nixosModules.disko + (import ../common/disks { + device = dev; + impermanence = impermanence; + fsType = fsType; + encrypted = encrypted; + }) - # Impermanence - (import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; }) + # Impermanence + (import ../common/disks/btrfs/impermanence.nix { + btrfsMountDevice = btrfsMountDevice; + lib = lib; + }) - # Import core options - ./hardware-configuration.nix - ../common/core + # Import core options + ./hardware-configuration.nix + ../common/core - # Import optional options - ../common/optional/persistence.nix - ../common/optional/pipewire.nix - ../common/optional/openssh.nix - ../common/optional/dwm.nix - ../common/optional/nfs-mounts/media.nix - ../common/optional/nfs-mounts/homeshare.nix - ../common/optional/nfs-mounts/photos.nix - ../common/optional/printing.nix - ../common/optional/backlight.nix - - ]; + # Import optional options + ../common/optional/persistence.nix + ../common/optional/pipewire.nix + ../common/optional/openssh.nix + ../common/optional/dwm.nix + ../common/optional/nfs-mounts/media.nix + ../common/optional/nfs-mounts/homeshare.nix + ../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; diff --git a/hosts/common/optional/xmodmap-arrow-remaps.nix b/hosts/common/optional/xmodmap-arrow-remaps.nix new file mode 100644 index 0000000..f4805ea --- /dev/null +++ b/hosts/common/optional/xmodmap-arrow-remaps.nix @@ -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}"; +}