A modular NixOS and Home Manager configuration for servers and personal laptop.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This repository contains my NixOS configurations for multiple systems:
- Declarative Config: All settings in one place, versioned with Git
- Multiple Systems: Works on both servers and personal laptop
- Modular Design: Reusable components for shell, dev tools, and services
- Nix Flakes: For reproducible builds and easy deployment
- Home Manager: Consistent user environment across systems
This setup serves as both my personal configuration and a reference for others interested in NixOS.
This configuration uses these technologies:
- NixOS or Nix package manager with flakes enabled
- Git for cloning the repository
- Basic Nix knowledge for customization
-
Clone the Repository
git clone https://github.com/ThomasRitaine/nixos-config.git cd nixos-config
-
For NixOS Systems
sudo ln -sf $(pwd) /etc/nixos
-
For Non-NixOS Systems (Any OS that supports Home Manager)
mkdir -p ~/.config/home-manager ln -sf $(pwd) ~/.config/home-manager/nixos-config
-
Apply Configuration following the usage section below
# Test configuration
sudo nixos-rebuild test --flake .#vps-8karm
# Apply configuration
sudo nixos-rebuild switch --flake .#vps-8karm
# Apply Home Manager configuration
home-manager switch --flake .#laptop-ec
The repository includes a convenient update script:
# On NixOS systems
update # Apply the configuration
update -t # Test the configuration without applying
# On Home Manager systems
update # Apply the Home Manager configuration
.
├── .github/ # GitHub-specific files
│ └── ISSUE_TEMPLATE/ # Templates for GitHub issues
├── docs/ # Documentation assets
├── hosts/ # Host-specific configurations
│ ├── laptop-ec/ # Configuration for Ubuntu with Home Manager
│ ├── vps-8karm/ # ARM-based VPS (primary)
│ └── vps-orarm/ # ARM-based VPS (secondary)
├── modules/ # Reusable configuration modules
│ ├── home-manager/ # Home Manager modules
│ │ ├── lazygit/ # LazyGit terminal UI for Git
│ │ ├── neovim/ # Neovim editor configuration
│ │ │ ├── config/ # LazyVim config files, symlinked to ~/.config/nvim
│ │ │ ├── base.nix # Basic Neovim setup without plugins
│ │ │ └── lazyvim.nix # LazyVim distribution integration
│ │ ├── profiles/ # Common user profiles
│ │ ├── wezterm/ # Terminal emulator configuration
│ │ ├── dev-env.nix # Development environment settings
│ │ ├── distro-icon.nix # Linux distro detection icons
│ │ ├── fzf.nix # Fuzzy finder configuration
│ │ ├── git-thomas.nix # Personal Git configuration
│ │ ├── kubernetes.nix # k8s tools configuration
│ │ ├── starship.nix # Cross-shell prompt configuration
│ │ ├── update-flake.nix # Helper script for updating
│ │ ├── utils.nix # Common utilities package list
│ │ ├── zoxide.nix # Smart directory navigation
│ │ └── zsh.nix # Z-shell configuration and plugins
│ └── nixos/ # NixOS system modules
│ ├── vps/ # VPS-specific services
│ │ ├── applications-backup.nix # Backup application dir
│ │ ├── fail2ban.nix # Brute-force attack prevention
│ │ ├── firewall.nix # Network security, port filtering
│ │ └── openssh.nix # SSH server configuration
│ ├── common-vps.nix # Shared VPS configurations
│ ├── docker.nix # Docker container platform
│ └── zsh.nix # System-wide Z-shell setup
├── secrets/ # Contains hashed passwords on VPS
└── .gitignore # Prevents secrets from being committed
├── LICENSE # MIT license file
├── README.md # Repository documentation
├── flake.nix # Main entry point defining system configurations
└── flake.lock # Lock file for reproducible builds
- Neovim + LazyVim: Code editor with IDE features out of the box
- LazyGit: Git terminal UI with conventional commits support
- Docker: Container platform for development and deployment
- Kubernetes Tools: kubectl, k9s, helm, and more for container orchestration
- OpenSSH: Remote access with key-based authentication
- Fail2Ban: Protection against brute force attempts
- Firewall: Basic network security
- Backup: Automated application backup
- Zsh: Shell with autocompletion and syntax highlighting
- Starship: Fast and customizable prompt showing context-aware info
- Zoxide: Smart
cd
command that remembers your most used directories - FZF: Fuzzy finder for history, files, and more
The repository manages multiple systems with different configurations:
Host | Type | OS | Primary Use | Key Features |
---|---|---|---|---|
vps-8karm | NixOS | NixOS | Service hosting | Docker, fail2ban, firewall, SSH, app backup |
vps-orarm | NixOS | NixOS | Service hosting | Same as vps-8karm |
laptop-ec | Home Manager | Ubuntu | Development | Full dev environment, GUI tools |
Common Components: All systems share user environment configuration including:
- Shell setup (Zsh, Starship)
- Development tools (Neovim, Git)
- Directory navigation (Zoxide, FZF)
The main difference is that the VPS hosts use complete NixOS system configurations including kernel, system services, and networking, while the laptop uses only Home Manager to configure the user environment on top of Ubuntu.
As a personal project, there's no formal roadmap. Some potential improvements:
- Secret management with agenix
- Container-based testing for configurations
- System monitoring and health checks
See open issues for more ideas.
While this is primarily a personal configuration, contributions are welcome.
Distributed under the MIT License. See LICENSE
for more information.
Thomas Ritaine - thomas@ritaine.com - LinkedIn
Project Link: https://github.com/ThomasRitaine/nixos-config
- NixOS - The purely functional Linux distribution
- Home Manager - User environment management
- Nix Flakes - Reproducible builds and dependencies
- LazyVim - Neovim distribution with sane defaults
- Zsh - Extended shell with many improvements
- Starship - Cross-shell prompt
- Wezterm - Terminal emulator
- Docker - Container platform
- Kubernetes - Container orchestration
- Lazygit - Terminal UI for Git
- Zoxide - Smarter cd command
- FZF - Command-line fuzzy finder