configuration.nix 1. Removed stale NixOS boilerplate comments — all the default # Edit this configuration file..., # Bootloader., # Enable the X11 windowing system., # Define a user account..., commented-out options like # services.openssh.enable, firewall comments, and stateVersion comment 2. Removed Docker/docker-compose — virtualisation.docker block, users.groups.docker, "docker" from extraGroups, docker-compose from systemPackages 3. Removed vim from systemPackages 4. Removed environment.variables.EDITOR (helix defaultEditor = true in home.nix handles this) 5. Removed environment.sessionVariables.TERMINAL and environment.variables.RUSTICL_ENABLE (moved to home.nix) 6. Removed /tmp/nix-build tmpfs mount 7. Added networking.firewall.enable = true and # Required for Tailscale comment on checkReversePath 8. Separated v4l2loopback from the RAM section (moved # RAM optimizations comment to above boot.kernel.sysctl) 9. Fixed indentation — systemPackages, programs.appimage, imports, lists reformatted to one-item-per-line 10. Trailing whitespace cleanup throughout home.nix 1. Removed services.podman block 2. Added TERMINAL = "kitty" and RUSTICL_ENABLE = "radeonsi" to home.sessionVariables 3. Replaced 3 repetitive helix language blocks with a single map expression 4. Formatting fixes — function args split to one-per-line, trailing whitespace, list formatting (categories, urls, etc.) 5. Removed blank line before home.sessionVariables
272 lines
7 KiB
HolyC
272 lines
7 KiB
HolyC
{ config, pkgs, ... }:
|
|
|
|
{
|
|
imports = [ ./hardware-configuration.nix ];
|
|
|
|
boot.loader.systemd-boot.enable = true;
|
|
boot.loader.efi.canTouchEfiVariables = true;
|
|
boot.loader.timeout = 0;
|
|
|
|
networking.hostName = "framework";
|
|
|
|
hardware.bluetooth = {
|
|
enable = true;
|
|
powerOnBoot = true;
|
|
settings = {
|
|
General = {
|
|
Experimental = true; # Show battery charge of Bluetooth devices
|
|
};
|
|
};
|
|
};
|
|
|
|
networking.networkmanager.enable = true;
|
|
|
|
services.resolved = {
|
|
enable = true;
|
|
};
|
|
|
|
networking.firewall.enable = true;
|
|
# Required for Tailscale
|
|
networking.firewall.checkReversePath = "loose";
|
|
|
|
services.tailscale.enable = true;
|
|
|
|
time.timeZone = "America/Los_Angeles";
|
|
i18n.defaultLocale = "en_US.UTF-8";
|
|
|
|
i18n.extraLocaleSettings = {
|
|
LC_ADDRESS = "en_US.UTF-8";
|
|
LC_IDENTIFICATION = "en_US.UTF-8";
|
|
LC_MEASUREMENT = "en_US.UTF-8";
|
|
LC_MONETARY = "en_US.UTF-8";
|
|
LC_NAME = "en_US.UTF-8";
|
|
LC_NUMERIC = "en_US.UTF-8";
|
|
LC_PAPER = "en_US.UTF-8";
|
|
LC_TELEPHONE = "en_US.UTF-8";
|
|
LC_TIME = "en_US.UTF-8";
|
|
};
|
|
|
|
services.xserver.enable = true;
|
|
|
|
# Framework Laptop 13 AMD AI 300 Series specific configurations
|
|
# Enable AMD GPU support and power management
|
|
hardware.graphics = {
|
|
enable = true;
|
|
enable32Bit = true;
|
|
# Add OpenCL support via Rusticl (recommended by NixOS wiki for DaVinci Resolve)
|
|
extraPackages = with pkgs; [ mesa.opencl ];
|
|
};
|
|
|
|
# Enable keyd for key remapping
|
|
services.keyd = {
|
|
enable = true;
|
|
keyboards = {
|
|
default = {
|
|
ids = [ "*" ]; # Apply to all keyboards
|
|
settings = {
|
|
main = {
|
|
capslock = "esc";
|
|
esc = "capslock";
|
|
leftalt = "leftcontrol";
|
|
leftcontrol = "leftalt";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
|
|
# Prevent trackpad interference with keyd
|
|
environment.etc."libinput/local-overrides.quirks".text = ''
|
|
[Serial Keyboards]
|
|
MatchUdevType=keyboard
|
|
MatchName=keyd virtual keyboard
|
|
AttrKeyboardIntegration=internal
|
|
'';
|
|
|
|
# Set Kitty as default terminal
|
|
xdg.terminal-exec = {
|
|
enable = true;
|
|
settings = {
|
|
default = [ "kitty.desktop" ];
|
|
};
|
|
};
|
|
|
|
services.displayManager.gdm.enable = true;
|
|
services.desktopManager.gnome.enable = true;
|
|
|
|
# Remove default GNOME apps (keeping loupe and file-roller)
|
|
environment.gnome.excludePackages = with pkgs; [
|
|
epiphany # GNOME Web
|
|
gnome-calculator
|
|
gnome-calendar
|
|
gnome-characters
|
|
gnome-clocks
|
|
gnome-connections
|
|
gnome-console
|
|
gnome-contacts
|
|
gnome-maps
|
|
gnome-music
|
|
gnome-weather
|
|
snapshot # Camera
|
|
gnome-text-editor
|
|
simple-scan
|
|
totem # Videos (have VLC)
|
|
yelp # Help docs
|
|
evince # PDF viewer (using Zen Browser)
|
|
geary # Email
|
|
gnome-tour
|
|
gnome-font-viewer # Have font-manager
|
|
nautilus # Using Nemo
|
|
];
|
|
|
|
services.xserver.xkb = {
|
|
layout = "us";
|
|
variant = "";
|
|
};
|
|
|
|
services.printing.enable = true;
|
|
|
|
services.pulseaudio.enable = false;
|
|
security.rtkit.enable = true;
|
|
services.pipewire = {
|
|
enable = true;
|
|
alsa.enable = true;
|
|
alsa.support32Bit = true;
|
|
pulse.enable = true;
|
|
};
|
|
users.users.jet = {
|
|
isNormalUser = true;
|
|
description = "Jet";
|
|
extraGroups = [
|
|
"networkmanager"
|
|
"wheel"
|
|
"video"
|
|
"render"
|
|
];
|
|
};
|
|
|
|
nixpkgs.config.allowUnfree = true;
|
|
nix.settings.experimental-features = [
|
|
"nix-command"
|
|
"flakes"
|
|
];
|
|
|
|
# Framework-specific services
|
|
# Enable fwupd for BIOS updates (distributed through LVFS)
|
|
services.fwupd.enable = true;
|
|
|
|
# Enable periodic TRIM for NVMe/SSD health
|
|
services.fstrim.enable = true;
|
|
|
|
# Enable automatic garbage collection to prevent old generations from slowing boot
|
|
nix.gc = {
|
|
automatic = true;
|
|
dates = "daily";
|
|
options = "--delete-older-than 7d";
|
|
};
|
|
nix.settings.auto-optimise-store = true;
|
|
nix.optimise.automatic = true;
|
|
|
|
nix.settings = {
|
|
max-jobs = "auto";
|
|
cores = 0;
|
|
build-users-group = "nixbld";
|
|
};
|
|
|
|
# Power management for laptop
|
|
# Configure lid switch behavior - suspend (no swap needed with 96GB RAM)
|
|
services.logind = {
|
|
settings = {
|
|
Login = {
|
|
HandleLidSwitch = "suspend";
|
|
HandleLidSwitchExternalPower = "suspend";
|
|
HandleLidSwitchDocked = "ignore";
|
|
};
|
|
};
|
|
};
|
|
|
|
# Enable auto-cpufreq for intelligent power management (replaces TLP)
|
|
services.auto-cpufreq.enable = true;
|
|
services.auto-cpufreq.settings = {
|
|
battery = {
|
|
governor = "powersave";
|
|
turbo = "never";
|
|
};
|
|
charger = {
|
|
governor = "performance";
|
|
turbo = "auto";
|
|
};
|
|
};
|
|
|
|
# Enable thermald for thermal management
|
|
services.thermald.enable = true;
|
|
|
|
# Framework Laptop 13 specific power optimizations
|
|
# Enable power-profiles-daemon for better AMD power management
|
|
# (Note: This conflicts with auto-cpufreq, so we'll keep auto-cpufreq disabled)
|
|
services.power-profiles-daemon.enable = false;
|
|
|
|
# AMD specific power management
|
|
powerManagement.cpuFreqGovernor = "powersave";
|
|
|
|
# Enable power management
|
|
powerManagement.enable = true;
|
|
|
|
# v4l2loopback for OBS Virtual Camera
|
|
boot.extraModulePackages = with config.boot.kernelPackages; [ v4l2loopback ];
|
|
boot.kernelModules = [ "v4l2loopback" ];
|
|
boot.extraModprobeConfig = ''
|
|
options v4l2loopback devices=1 video_nr=1 card_label="OBS Virtual Camera" exclusive_caps=1
|
|
'';
|
|
|
|
# RAM optimizations for 96GB system
|
|
boot.kernel.sysctl = {
|
|
"vm.swappiness" = 0; # Never swap to disk
|
|
"vm.vfs_cache_pressure" = 50; # Keep more filesystem cache in RAM
|
|
"vm.dirty_ratio" = 15; # Write to disk when 15% of RAM is dirty
|
|
"vm.dirty_background_ratio" = 5; # Start writing when 5% dirty
|
|
};
|
|
|
|
# Use RAM disk (tmpfs) for temporary files - much faster than disk
|
|
fileSystems."/tmp" = {
|
|
device = "tmpfs";
|
|
fsType = "tmpfs";
|
|
options = [
|
|
"size=32G" # Use up to 32GB RAM for /tmp (adjust as needed)
|
|
"mode=1777"
|
|
"nosuid"
|
|
"nodev"
|
|
];
|
|
};
|
|
|
|
environment.systemPackages = with pkgs; [
|
|
git
|
|
wget
|
|
nh
|
|
];
|
|
|
|
programs.steam.enable = true;
|
|
programs.nix-index-database.comma.enable = true;
|
|
|
|
# https://wiki.nixos.org/wiki/Appimage
|
|
programs.appimage = {
|
|
enable = true;
|
|
binfmt = true;
|
|
};
|
|
|
|
# GameCube adapter udev rules for Slippi/Dolphin
|
|
# Disable USB autosuspend for Framework's problematic devices (fingerprint reader, USB-C hub)
|
|
services.udev.extraRules = ''
|
|
# GameCube adapter USB device (vendor ID 057e, product ID 0337)
|
|
SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666"
|
|
# GameCube adapter HID device (needed for Dolphin to access controllers)
|
|
KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="0337", MODE="0666", GROUP="input"
|
|
# Disable autosuspend for Framework fingerprint reader
|
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="27a6", ATTR{power/autosuspend}="-1"
|
|
# Disable autosuspend for Framework USB-C hub controllers
|
|
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{power/autosuspend}="-1"
|
|
'';
|
|
|
|
system.stateVersion = "25.05";
|
|
|
|
}
|