This document provides a comprehensive reference for the NixOS configuration framework.
nixos-config/
├── docs/ # Documentation
│ ├── installation.md # Installation guide
│ ├── reference.md # This reference guide
│ ├── programs.md # Program configurations
│ └── secrets_management.md # Secrets management guide
├── home/ # Home Manager configurations
│ ├── default.nix # Work mode (full dev setup)
│ ├── gaming.nix # Gaming mode (minimal + Steam)
│ ├── env.nix # Environment variables
│ └── programs/ # Individual program configurations
│ ├── claude.nix # Claude AI assistant config
│ ├── claude/ # Claude commands & skills
│ │ ├── commands/ # Custom slash commands
│ │ └── skills/ # Custom skills
│ ├── browser.nix
│ ├── editor.nix
│ ├── terminal.nix
│ └── ...
├── hosts/ # Host-specific configurations
│ └── jokyv/ # Host-specific files
│ ├── default.nix # Main host configuration
│ ├── hardware-configuration.nix # Hardware settings
│ └── zsa-udev-rules.nix # Custom udev rules
├── disks/ # Disk configurations (shared across hosts)
│ ├── universal-config.nix # Auto-detecting installer
│ ├── disk-config-btrfs-luks.nix # Legacy Btrfs+LUKS config
│ └── disk-config-btrfs.nix # Legacy Btrfs config
├── install-config.nix # Universal installer settings
├── flake.nix # Main flake configuration
├── flake.lock # Locked dependency versions
├── justfile # Task automation commands
└── secrets.enc.yaml # Encrypted secrets
The main flake configuration defines:
Key sections:
inputs: Define external dependencies (nixpkgs, home-manager, etc.)outputs: Define system configurations, packages, and development toolshosts/*/default.nix)Each host configuration includes:
System-level gaming performance is configured in hosts/jokyv/default.nix:
programs.gamemode): Automatic CPU/IO prioritization when games runservices.pipewire.extraConfig): 48kHz clock, 256‑sample quantum, RTKit with high priorityhardware.steam-hardware.enable): udev rules for controllers, VR, Steam Deck supportboot.kernelParams, boot.kernel.sysctl): nowatchdog, split_lock_detect=off, vm.max_map_count, vm.swappiness, etc.nixos-hardware.nixosModules.common-cpu-amd-pstate): Optimal power management and performanceUser‑level gaming packages (Steam, Wine, MangoHUD) and environment variables are managed by Home Manager home/gaming.nix and activated via just game.
home/)Home configurations manage:
Use imports to organize configurations:
{
imports = [
./hardware-configuration.nix
../../modules/common.nix
../../modules/desktop.nix
];
}
Add system packages:
environment.systemPackages = with pkgs; [
git
vim
firefox
];
Add user packages via Home Manager:
home.packages = with pkgs; [
helix
kitty
cargo
];
Enable and configure system services:
services = {
xserver.enable = true;
printing.enable = true;
pipewire = {
enable = true;
alsa.enable = true;
};
};
Configure system-wide theming:
stylix = {
enable = true;
base16Scheme = "${pkgs.base16-schemes}/share/themes/gruvbox-dark-hard.yaml";
image = ../../wallpapers/nix.png;
fonts = {
monospace = {
package = pkgs.nerdfonts;
name = "FiraCode Nerd Font";
};
};
};
The project includes a justfile for common tasks:
just switch: Rebuild system configurationjust home: Apply Home Manager configuration (work mode)just game: Apply Home Manager configuration (gaming mode)just up: Update system packagesjust cleanup: Smart cleanup (keep 3 generations)just encode: Encrypt secretsjust decode: Decrypt secretsThe configuration uses sops-nix for encrypted secrets:
sops secrets.enc.yamlage-keygen -o ~/.config/sops/age/secrets.keyconfig.sops.secrets.<secret-name>.pathnix flake checkjust switch or just homenix optionsnix flake updatejust cleanhardware-configuration.nix# Check flake outputs
nix flake show
# Test configuration
nixos-rebuild test --flake .#hostname
# Search packages
nix search nixpkgs package-name
# Garbage collect
nix-collect-garbage -d
When contributing to the configuration: