Skip to content

a-maccormack/nix_config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

140 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix Logo

Nix Flakes Configuration

A modular, reproducible NixOS setup with Flakes and Home-Manager

NixOS Flakes Home-Manager Hyprland x86_64


Devices

Host Build Type CPU Storage Key Features
x1-carbon-g10 build ThinkPad Laptop Intel 12th Gen (Alder Lake) LUKS Encrypted IPU6 Camera, Fingerprint, Tailscale VPN, Bluetooth
workstation build Desktop NVIDIA GPU LUKS Encrypted Tailscale VPN, Bluetooth, Docker
homelab build ThinkCentre M910s Server Intel Dual LUKS (NVMe + HDD) Headless, initrd SSH unlock, Docker media stack, WoL
vm build Virtual Machine QEMU/KVM ext4 Docker, Testing Environment

Installation Media

ISO Purpose Build Command
iso Generic minimal installer nix build .#iso
vm-iso VM installer with auto-setup nix build .#vm-iso
homelab-iso Server installer with LUKS + media stack nix build .#homelab-iso

Directory Structure

nix_config/
├── flake.nix                 # Flake definition & inputs
├── flake.lock                # Reproducible dependency lock
│
├── hosts/                    # Per-machine configurations
│   ├── vm/
│   ├── x1-carbon-g10/
│   ├── workstation/
│   └── homelab/
│       ├── configuration.nix
│       ├── hardware-configuration.nix
│       └── docker-compose/   # Media stack (Jellyfin, Sonarr, etc.)
│
├── modules/
│   ├── nixos/                # System-level modules
│   │   ├── desktop/          # Hyprland, Ly, SDDM, 1Password
│   │   ├── hardware/         # IPU6 camera stack
│   │   ├── server/           # initrd-ssh, openssh, wol, power-management
│   │   ├── system/           # Boot, Nix settings, GC
│   │   └── virtualisation/   # Docker, Tailscale
│   │
│   ├── home/                 # Home-Manager modules
│   │   ├── apps/             # Firefox, Neovim
│   │   ├── desktop/          # Waybar, Fuzzel, Hypridle
│   │   └── shell/            # Zsh, Tmux, Bash
│   │
│   └── shared/               # Cross-platform packages
│       ├── apps/             # GUI applications
│       └── cli-tools/        # 35+ CLI utilities
│
├── systems/                  # Bootable ISO builders
│   ├── x86_64-iso/
│   ├── x86_64-vm-iso/
│   └── x86_64-homelab-iso/
│
├── lib/                      # Helper functions
│
├── assets/
│   └── wallpapers/
│
└── .githooks/                # Git hooks (auto-format on commit)

Features

Desktop Environment

Component Tool Description
Window Manager Hyprland Dynamic tiling Wayland compositor
Status Bar Waybar Customizable top panel
App Launcher Fuzzel Fast Wayland-native launcher
Terminal Kitty GPU-accelerated terminal
Login Manager Ly Minimal TUI display manager
Notifications SwayNC Notification center
Idle Manager Hypridle Auto-lock & screen timeout
Screen Lock Hyprlock Secure Wayland lock screen

Development Tools

Languages     │ Node.js, Python (uv/pyenv), Erlang/Elixir (asdf)
Containers    │ Docker
IaC           │ Terraform, Ansible
Cloud         │ AWS CLI, Google Cloud SDK
Version Ctrl  │ Git (SSH signing), GitHub CLI
AI            │ Claude CLI, Gemini CLI
Editors       │ Neovim, Vim, VS Code
API Testing   │ Postman, Ngrok
Databases     │ Antares SQL Client

Security Tools

Tool Purpose
1Password Password & secrets management
Burp Suite Web app security testing
FFUF Web fuzzing
Nuclei Vulnerability scanning
Nmap Network discovery
SecLists Wordlists & payloads

Productivity

  • Office: LibreOffice (Writer, Calc, Impress)
  • Notes: Obsidian
  • Documents: Evince PDF Viewer
  • Cloud Storage: Dropbox
  • Media: VLC, Shotcut, Spotify
  • Communication: Slack, Telegram

Hardware Support

  • Camera: Custom Intel IPU6 stack with v4l2-relayd (ipu6ep platform)
  • Bluetooth: Full support with Blueman GUI
  • Display: HiDPI scaling (1.5x @ 2880x1800)
  • Keyboard: Dual layouts (US-intl/Spanish) with Super+I toggle

Quick Start

Validate Configuration

nix flake check --impure

Deploy to a Host

# Replace <hostname> with: vm, x1-carbon-g10, workstation, homelab
sudo nixos-rebuild switch --flake .#<hostname>

Build Installation ISO

nix build .#iso          # Generic installer
nix build .#vm-iso       # VM installer
nix build .#homelab-iso  # Server installer with LUKS setup

# Result in: ./result/iso/

Update Flake Inputs

nix flake update

Garbage Collection

# Clean old generations (auto-enabled, but manual)
sudo nix-collect-garbage -d

Format Nix Files

nix run .#formatter.x86_64-linux -- **/*.nix

Setup Git Hooks (after fresh clone)

git config core.hooksPath .githooks

Module System

This config uses an auto-discovery pattern for modules. Simply create a new directory with a default.nix and it's automatically imported.

Preset Pattern

# modules/nixos/<category>/<name>/default.nix
{ lib, config, ... }:
{
  options.presets.<category>.<name>.enable =
    lib.mkEnableOption "Description";

  config = lib.mkIf config.presets.<category>.<name>.enable {
    # Your configuration here
  };
}

Enable in Host Config

# hosts/<hostname>/configuration.nix
{
  presets.desktop.hyprland.enable = true;
  presets.virtualisation.docker.enable = true;
  presets.shared.cli-tools.enable = true;
}

Available Preset Categories

Category Scope Examples
presets.system.* NixOS boot, nix/flakes, nix/gc
presets.desktop.* NixOS hyprland, ly, 1password
presets.server.* NixOS initrd-ssh, openssh, wol, power-management, docker-compose
presets.virtualisation.* NixOS docker, tailscale
presets.hardware.* NixOS ipu6-custom
presets.home.shell.* Home-Manager zsh, tmux, bash
presets.home.apps.* Home-Manager firefox, neovim
presets.home.desktop.* Home-Manager waybar, fuzzel, hypridle
presets.shared.* Both cli-tools, apps/*

Adding a New Host

# 1. Create host directory
mkdir -p hosts/<hostname>

# 2. Generate hardware config
sudo nixos-generate-config --show-hardware-config > hosts/<hostname>/hardware-configuration.nix

# 3. Create configuration.nix (copy from existing host and modify)
cp hosts/vm/configuration.nix hosts/<hostname>/configuration.nix

# 4. Add to flake.nix nixosConfigurations

Keybindings (Hyprland)

Key Action
Super + Return Open terminal (Kitty)
Super + D App launcher (Fuzzel)
Super + Q Close window
Super + H/J/K/L Focus window (vim-style)
Super + Shift + H/J/K/L Move window
Super + 1-9 Switch workspace
Super + Shift + 1-9 Move window to workspace
Super + I Toggle keyboard layout
Super + F Fullscreen
Super + V Toggle floating

License

This configuration is provided as-is for personal use and reference.

About

Nix flakes for my personal machines

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors