Files
nixos/modules/common.nix
2026-02-01 19:51:22 +00:00

183 lines
5.9 KiB
Nix

{ config, pkgs, inputs, system, ... }:
{
# --------------------------------------------------------------------------
# BOOT
# --------------------------------------------------------------------------
boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true;
# --------------------------------------------------------------------------
# SYSTEM
# --------------------------------------------------------------------------
# IMPORTANT: Replace with actual values
networking.hostName = "<hostname>";
time.timeZone = "<timezone>";
i18n.defaultLocale = "<locale>";
networking.networkmanager.enable = true;
# --------------------------------------------------------------------------
# AMD GPU - RDNA 4 (RX 9060 XT) + Zen 3 CPU (5700G)
# --------------------------------------------------------------------------
# RDNA 4 requires navi44 firmware blobs (included in redistributable firmware)
hardware.enableRedistributableFirmware = true;
# Use the modern amdgpu NixOS module (cleaner than manual initrd config)
hardware.amdgpu.initrd.enable = true;
hardware.graphics = {
enable = true;
enable32Bit = true; # Required for Steam/Wine
extraPackages = with pkgs; [
rocmPackages.clr.icd # OpenCL support for RDNA 4
];
# NOTE: AMDVLK intentionally omitted
# Some games auto-select AMDVLK over RADV, causing performance issues
# RADV (Mesa) is the default and performs better for gaming
};
# RADV is already the default Vulkan driver
# This variable is optional but makes it explicit
environment.variables.AMD_VULKAN_ICD = "RADV";
# --------------------------------------------------------------------------
# CPU - Zen 3 Optimizations (Ryzen 7 5700G)
# --------------------------------------------------------------------------
boot.kernelParams = [
"amd_pstate=active" # Better power/performance scaling on Zen 3
];
# --------------------------------------------------------------------------
# MOTHERBOARD - MSI B550 Tomahawk Sensors
# --------------------------------------------------------------------------
boot.kernelModules = [ "nct6775" ]; # B550 hardware monitoring
# --------------------------------------------------------------------------
# MANGOWC + NOCTALIA
# --------------------------------------------------------------------------
programs.mango.enable = true;
# Required for screen sharing, file dialogs
xdg.portal = {
enable = true;
wlr.enable = true;
extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
};
# Enable seatd for session management
services.seatd.enable = true;
# Use greetd to automatically start a MangoWC session on login
# Note: 'mango' binary is provided by programs.mango.enable above
services.greetd = {
enable = true;
settings.default_session = {
command = "mango";
# IMPORTANT: Replace <username> with actual username
user = "<username>";
};
};
# --------------------------------------------------------------------------
# USER ACCOUNT
# --------------------------------------------------------------------------
# IMPORTANT: Replace <username> with actual username
users.users.<username> = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" "video" "seat" ];
# IMPORTANT: Generate a password hash with: mkpasswd -m sha-512
# Then replace the placeholder below with the generated hash
hashedPassword = "<replace-with-password-hash>";
packages = with pkgs; [
# -- Noctalia Shell --
inputs.quickshell.packages.${system}.default
inputs.noctalia.packages.${system}.default
brightnessctl
cliphist
wlsunset
# -- MangoWC Ecosystem --
foot # Terminal
wmenu # Launcher
wl-clipboard # Clipboard
grim # Screenshot
slurp # Region selection
swaybg # Wallpaper
# -- Applications --
firefox
];
};
# --------------------------------------------------------------------------
# SYSTEM PACKAGES
# --------------------------------------------------------------------------
environment.systemPackages = with pkgs; [
vim
wget
curl
htop
git
unzip
file
# GPU verification tools
clinfo # Verify OpenCL: clinfo
vulkan-tools # Verify Vulkan: vulkaninfo
pciutils # lspci for hardware info
];
# --------------------------------------------------------------------------
# FONTS
# --------------------------------------------------------------------------
fonts.packages = with pkgs; [
# Nerd fonts: current syntax for nixos-unstable and NixOS >= 24.05
# For older nixpkgs (before this change), use:
# (nerdfonts.override { fonts = [ "JetBrainsMono" ]; })
nerd-fonts.jetbrains-mono
# Other fonts
inter
roboto
];
# --------------------------------------------------------------------------
# AUDIO (PipeWire)
# --------------------------------------------------------------------------
services.pipewire = {
enable = true;
alsa.enable = true;
alsa.support32Bit = true;
pulse.enable = true;
};
# Disable PulseAudio (conflicts with PipeWire)
hardware.pulseaudio.enable = false;
# RealtimeKit for PipeWire
security.rtkit.enable = true;
# --------------------------------------------------------------------------
# MISC
# --------------------------------------------------------------------------
# Allow unfree packages (needed for Steam, some drivers)
nixpkgs.config.allowUnfree = true;
# Enable flakes
nix.settings.experimental-features = [ "nix-command" "flakes" ];
# Garbage collection
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 14d";
};
# IMPORTANT: Set to the NixOS version of your install media
# Check with: nixos-version
# Do NOT change this after initial install
system.stateVersion = "24.11";
}