Skip to content

baranovskis/nix-config

Repository files navigation

My NixOS Configuration

Check

Desktop Screenshot

A personal NixOS flake with GNOME, Stylix theming, gaming, VFIO passthrough, and a modern CLI toolchain. Previously used Bluefin OS and really enjoyed it — this configuration carries forward its opinionated, batteries-included desktop philosophy.

Steal anything useful!

What's Inside

System (modules/)

  • GNOME on Wayland with Stylix auto-theming
  • PipeWire audio, Bluetooth, CUPS printing
  • NVIDIA proprietary drivers (open kernel modules)
  • VFIO GPU passthrough (Radeon WX 5100) with Looking Glass (kvmfr)
  • Optimized Win10 VM — VirtIO disk/net, hugepages, io_uring, CPU pinning (P-cores for VM, E-cores for emulator), declarative libvirt definitions
  • Steam + Proton-GE, GameMode, MangoHud
  • Ollama with CUDA acceleration for local LLMs
  • Docker, Podman, Distrobox, libvirt/QEMU/KVM, Sunshine streaming
  • Btrfs with auto-scrub and restic backups
  • RDP remote desktop (XRDP + GNOME Remote Desktop)
  • Zen Browser (declarative wrapFirefox)
  • Firmware updates via fwupd, NuPhy keyboard support, Solaar for Logitech

User (home-manager/)

  • Ghostty terminal with Fish integration
  • Fish shell + Starship prompt + Atuin history
  • Nautilus with custom bookmarks (GNOME-specific)
  • MangoHud FPS overlay for gaming
  • Flatpak (declarative) — Telegram, Bitwarden, Spotify, GIMP, Inkscape, Remmina, Bottles, Alpaca, Podman Desktop, Mission Center, Bazaar, Flatseal, Warehouse, Extension Manager
  • bat, eza, fastfetch, fzf, zoxide
  • direnv with nix-direnv, Node.js 22, Python 3, Claude Code, Zed
  • Stylix dark theme — Inter font, JetBrains Mono, Papirus icons, Capitaine cursors

Project Structure

nix-config/
├── flake.nix                 # Flake definition and inputs
├── Justfile                  # Command shortcuts
├── lib/
│   ├── default.nix           # mkHost + mkHome helpers
│   └── stylix.nix            # Shared Stylix theme settings
├── hosts/
│   └── erebor/               # Desktop workstation
│       ├── default.nix       # Enables profiles/modules, NVIDIA, VFIO, boot, restic
│       ├── hardware.nix      # Generated hardware config
│       └── vms/              # Declarative libvirt VM/network definitions
│           ├── win10.xml     # Windows 10 VM (VFIO, VirtIO, Looking Glass)
│           └── default-network.xml  # NAT network with DHCP
├── modules/                  # NixOS system modules
│   ├── default.nix           # Imports core + wm + profiles + all modules
│   ├── core/                 # Always-on base system
│   │   ├── nix.nix           # Nix daemon, flakes
│   │   ├── locale.nix        # Timezone, i18n
│   │   ├── networking.nix    # NetworkManager
│   │   ├── shell.nix         # Fish shell
│   │   ├── user.nix          # User accounts
│   │   ├── gc.nix            # Garbage collection
│   │   ├── packages.nix      # Base system packages
│   │   ├── ssh.nix           # SSH
│   │   └── power.nix         # Power management
│   ├── wm/                   # Window managers (swappable)
│   │   └── gnome.nix         # modules.wm.gnome.enable
│   ├── profiles/
│   │   └── desktop/          # profiles.desktop.enable
│   │       ├── audio.nix     # PipeWire
│   │       ├── bluetooth.nix # Bluetooth
│   │       ├── flatpak.nix   # Flatpak daemon + XDG portal
│   │       ├── gnupg.nix     # GnuPG
│   │       ├── nuphy.nix     # NuPhy keyboard
│   │       ├── printing.nix  # CUPS
│   │       ├── solaar.nix    # Logitech Solaar
│   │       └── zen-browser.nix # Zen Browser
│   ├── gpu.nix               # modules.gpu.enable
│   ├── gaming.nix            # modules.gaming.enable
│   ├── btrfs.nix             # modules.btrfs.enable
│   ├── zfs.nix               # modules.zfs.enable
│   ├── docker.nix            # modules.docker.enable
│   ├── virtualization.nix    # modules.virtualization.enable
│   ├── ai.nix                # modules.ai.enable
│   ├── sunshine.nix          # modules.sunshine.enable
│   ├── rdp.nix               # modules.rdp.enable
│   └── nfs.nix               # modules.nfs.enable
├── home-manager/             # User environment
│   ├── default.nix           # Entry point (WM-agnostic)
│   ├── config/
│   │   └── stylix.nix        # Theme, fonts, icons, cursor
│   ├── wm/                   # WM-specific user config
│   │   └── gnome/
│   │       ├── default.nix   # Nautilus bookmarks
│   │       └── dconf.nix     # GNOME dconf settings
│   ├── hosts/
│   │   └── erebor.nix        # Host-specific (Looking Glass, imports wm/gnome)
│   ├── modules/
│   │   └── nautilus.nix      # Nautilus bookmarks module
│   ├── programs/
│   │   ├── fish.nix          # Fish shell
│   │   ├── starship.nix      # Starship prompt
│   │   ├── ghostty.nix       # Ghostty terminal
│   │   ├── gaming.nix        # MangoHud
│   │   ├── atuin.nix         # Shell history
│   │   ├── bat.nix           # bat
│   │   ├── eza.nix           # ls replacement
│   │   ├── fastfetch.nix     # System info
│   │   ├── fzf.nix           # Fuzzy finder
│   │   ├── zoxide.nix        # Smart cd
│   │   ├── flatpak.nix       # Flatpak packages + overrides
│   │   ├── direnv.nix        # direnv + nix-direnv
│   │   ├── git.nix           # Git + delta
│   │   └── packages.nix      # User packages
│   └── logo/
│       └── erebor.png        # Fastfetch logo
├── assets/
│   └── wallpapers/           # Wallpapers (Stylix auto-theming + desktop)
└── overlays/
    └── default.nix           # Package overlays

Adding a New Host

# 1. Create hosts/moria/default.nix + hardware.nix
{ ... }: {
  imports = [ ./hardware.nix ];
  networking.hostName = "moria";
  modules.docker.enable = true;
  # No profiles.desktop — headless server
}

# 2. Add one line to flake.nix
nixosConfigurations.moria = lib.mkHost { hostname = "moria"; };

Adding a New Window Manager

# System side:
# 1. Create modules/wm/hyprland.nix with modules.wm.hyprland.enable
# 2. Import it in modules/wm/default.nix

# User side:
# 3. Create home-manager/wm/hyprland/ with WM-specific user config
# 4. Import from home-manager/hosts/<hostname>.nix

# In a host:
# modules.wm.hyprland.enable = true;

Usage

Everything is managed through njust (works from any directory):

njust system          # Build and switch NixOS config
njust user            # Build and switch home-manager config
njust update          # Update all flake inputs
njust clean           # GC old generations + prune Docker/Podman + Flatpak
njust changelogs      # Diff between current and previous generation
njust backup          # Run restic backup now
njust backup-list     # List backup snapshots
njust backup-status   # Check backup service status
njust backup-restore  # Restore latest backup to target directory
njust distrobox-create # Create a new Distrobox container
njust distrobox-enter  # Enter a Distrobox container
njust bios            # Reboot into UEFI firmware setup
njust                 # Show all available commands

njust is a Fish shell alias defined in home-manager/programs/fish.nix that runs just with the correct Justfile and working directory. You can also use just directly when inside the ~/nix-config directory.

Or manually:

sudo nixos-rebuild switch --flake .#$(hostname)
home-manager switch --flake .

All files must be git added before Nix can see them.

Acknowledgments

About

NixOS flake - GNOME, Stylix theming, VFIO GPU passthrough, Looking Glass, optimized Windows VM, gaming, local AI, and a modern CLI toolchain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors