114 lines
2.9 KiB
Nix
114 lines
2.9 KiB
Nix
{ 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";
|
|
user = "sam";
|
|
impermanence = true;
|
|
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; })
|
|
|
|
# Impermanence
|
|
(import ../common/disks/btrfs/impermanence.nix { btrfsMountDevice = btrfsMountDevice; lib = lib; })
|
|
|
|
# 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
|
|
|
|
];
|
|
|
|
boot = {
|
|
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
|
|
];
|
|
loader = {
|
|
systemd-boot.enable = true;
|
|
efi.canTouchEfiVariables = true;
|
|
timeout = 3;
|
|
};
|
|
};
|
|
|
|
services = {
|
|
libinput.touchpad.accelSpeed = "0.5";
|
|
xserver = {
|
|
xkb.options = "caps:swapescape";
|
|
dpi = 196;
|
|
upscaleDefaultCursor = true;
|
|
};
|
|
};
|
|
|
|
environment.variables = {
|
|
GDK_SCALE = "2.2";
|
|
GDK_DPI_SCALE = "0.8";
|
|
_JAVA_OPTIONS = "-Dsun.java2d.uiScale=2.2";
|
|
QT_AUTO_SCREEN_SCALE_FACTOR = "1";
|
|
XCURSOR_SIZE = "64";
|
|
};
|
|
|
|
services.tlp = {
|
|
enable = true;
|
|
settings = {
|
|
CPU_SCALING_GOVERNOR_ON_AC = "ondemand";
|
|
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
|
|
|
|
START_CHARGE_THRESH_BAT0 = 50;
|
|
STOP_CHARGE_THRESH_BAT0 = 95;
|
|
};
|
|
};
|
|
|
|
# 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;
|
|
powerOnBoot = true;
|
|
};
|
|
enableRedistributableFirmware = true;
|
|
firmware = [
|
|
pkgs.sof-firmware
|
|
];
|
|
};
|
|
|
|
networking = {
|
|
hostName = "citadel";
|
|
networkmanager.enable = true;
|
|
enableIPv6 = false;
|
|
nameservers = [ "10.0.10.60" "8.8.8.8" ];
|
|
};
|
|
|
|
services.libinput.enable = true;
|
|
}
|