nixos/systems/warp.nix

82 lines
2.4 KiB
Nix
Executable file

{ config, lib, pkgs, modulesPath, ... }: {
networking.hostName = "warp";
fileSystems."/" =
{ device = "/dev/disk/by-partlabel/primary";
fsType = "ext4";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-partlabel/ESP";
fsType = "vfat";
};
# CPU Settings for 13th gen Intel Core i5
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
# Boot and kernel modules for Intel NUC
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "sd_mod" ];
boot.initrd.kernelModules = [ ]; # No graphics drivers needed for headless
boot.kernelModules = [ "kvm-intel" ]; # Intel virtualization support
boot.extraModulePackages = [];
# Server-specific kernel parameters
boot.kernelParams = [
"intel_iommu=on" # Enable IOMMU for virtualization
];
networking.useDHCP = lib.mkDefault true;
# Note: DNS servers manually configured via nmcli for ACME certificate validation
# Command used: nmcli connection mod "Wired connection 1" ipv4.dns "8.8.8.8 1.1.1.1 9.9.9.9" ipv4.ignore-auto-dns yes
# These settings are persistent in NetworkManager connection profiles
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
# Power management optimized for server use
powerManagement = {
enable = true;
cpuFreqGovernor = "ondemand";
};
# Thermal management
services.thermald.enable = true;
# Server-oriented settings
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
PermitRootLogin = "no";
};
};
# Swap configuration (smaller for server use)
swapDevices = [
{
device = "/swapfile";
size = 8192; # 8GB swap for server workload
priority = 0;
}
];
# Enable hardware monitoring (CLI only)
hardware.sensor.iio.enable = true;
# Network performance tuning for server use
boot.kernel.sysctl = {
"net.core.rmem_max" = 134217728;
"net.core.wmem_max" = 134217728;
"net.ipv4.tcp_rmem" = "4096 65536 134217728";
"net.ipv4.tcp_wmem" = "4096 65536 134217728";
"net.core.netdev_max_backlog" = 5000;
};
# Disable unnecessary services for server use
services.xserver.enable = lib.mkForce false;
services.pipewire.enable = lib.mkForce false;
# Enable container support for future server services
virtualisation.docker.enable = true;
virtualisation.podman.enable = lib.mkDefault true;
}