I’ve been dabbling with a NixOS VM in hopes to build a configuration that I can eventually deploy direct to hardware on my host PC. It’s a purpose built PC with the following specs.
ASUS PRIME-X570 Pro
AMD Ryzen 9 5950x
NVIDIA RTX 4090 24GB OC
128GB Corsair Vengeance RAM
Built for gaming. It’s hosted Arch Linux for the past 3 years; but the appeal of a single configuration file was too seductive to ignore and I finally caved; thus my first attempt here.
I attempted to include the output of
nixos-rebuild switch --show-trace
But it exceeds the limit when providing the appropriate information. I’ll attempt to consolidate the issue.
Error indicates unexpected comma; but I can’t seem to resolve the issue by omitting them and any attempts I’ve had at restructuring have failed.
Errors reported from --show-trace
error: syntax error, unexpected ','
at /etc/nixos/configuration.nix:49:36:
48| kernelParams = [ "nvidia-drm.modeset=1" ]; # Enables Nvidia DRM for smoother graphics
49| supportedFilesystems = [ "ext4", "vfat", "ntfs", "exfat" ]; # Filesystem support for various storage devices
| ^
50| kernel.sysctl."vm.swappiness" = 10; # Reduces swappiness to prefer RAM over swap, beneficial for systems with ample RAM
building Nix...
error:
… while evaluating the attribute 'config'
at /nix/store/fnz9b0k8s5mfayxn77jximpib8n79k65-nixos-23.11.4516.e0da498ad77a/nixos/lib/modules.nix:320:9:
Raw configuration is as follows
{ config, pkgs, ... }:
{
imports = [ ./hardware-configuration.nix ];
# Boot and kernel configurations
boot = {
kernelPackages = pkgs.linuxPackages_latest;
kernelModules = [ "nvidia_uvm" "nvidia_modeset" "nvidia_drm" "nvidia" ];
initrd.availableKernelModules = [ "xhci_pci" "ahci" "usb_storage" "nvme" "sd_mod" "sr_mod" ];
kernelParams = [ "nvidia-drm.modeset=1" ];
supportedFilesystems = [ "ext4", "vfat", "ntfs", "exfat" ];
kernel.sysctl."vm.swappiness" = 10;
};
# Hardware configurations
hardware = {
cpu.amd.updateMicrocode = true;
nvidia.package = pkgs.linuxPackages_latest.nvidiaPackages.stable;
pulseaudio.enable = true; t
bluetooth.enable = true;
opengl.driSupport32Bit = true;
pulseaudio.support32Bit = true;
};
# Service configurations
services = {
# X server and display manager settings for graphical interface
xserver = {
enable = true;
videoDrivers = [ "nvidia" ];
displayManager.sddm.enable = true;
desktopManager.plasma5.enable = true;
};
# Peripheral and system service configurations
ckb-next.enable = true;
fail2ban.enable = true;
# Firewalld for flexible firewall management
firewalld.enable = true;
# CPU performance tuning for gaming
cpupower = {
enable = true;
frequencyGovernor = "performance";
energyPerfBias = "performance";
};
};
# System-wide package installation
environment.systemPackages = with pkgs; [
amd_microcode cmake cpupower ckb-next file firefox firewalld gamemode gcc git
gnome-disk-utility gnote htop iptables ipset krita lutris minecraft-launcher nano
nmap obs-studio python3 steam telegram-desktop unzip vlc wget xsetwacom zip
];
# ZRAM configuration for efficient RAM usage
boot.zram = {
enable = true;
compressionAlgorithm = "lz4";
zramSize = 16384; # Allocates 16GB for ZRAM, utilizing a portion of the available 128GB RAM
};
# Network and localization settings
networking = {
hostName = "THERAK";
networkmanager.enable = true;
};
time.timeZone = "Europe/Berlin";
i18n.defaultLocale = "en_US.UTF-8";
security.sudo.enable = true;
# User configuration
users.users.yourUsername = {
isNormalUser = true;
extraGroups = [ "wheel" ];
};
# Font configuration for improved aesthetics and readability
fonts.fonts = with pkgs; [
noto-fonts noto-fonts-cjk noto-fonts-emoji noto-fonts-extra dejavu_fonts
];
}
Regards,
AO
P.S. Happy to provide full report of $ nixos-rebuild switch --show-trace in a separate post if needed. I appreciate your time.