+
Skip to content

ThomasRitaine/nixos-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

NixOS Configuration

A modular NixOS and Home Manager configuration for servers and personal laptop.
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Repository Structure
  5. Key Modules
  6. Hosts
  7. Roadmap
  8. Contributing
  9. License
  10. Contact
  11. Acknowledgments

About The Project

NixOS Config Screenshot

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.

(back to top)

Built With

This configuration uses these technologies:

  • NixOS
  • Home Manager
  • Zsh
  • Starship
  • Neovim
  • LazyVim
  • Docker
  • Kubernetes
  • Wezterm
  • Lazygit
  • Zoxide

(back to top)

Getting Started

Prerequisites

  • NixOS or Nix package manager with flakes enabled
  • Git for cloning the repository
  • Basic Nix knowledge for customization

Installation

  1. Clone the Repository

    git clone https://github.com/ThomasRitaine/nixos-config.git
    cd nixos-config
  2. For NixOS Systems

    sudo ln -sf $(pwd) /etc/nixos
  3. For Non-NixOS Systems (Any OS that supports Home Manager)

    mkdir -p ~/.config/home-manager
    ln -sf $(pwd) ~/.config/home-manager/nixos-config
  4. Apply Configuration following the usage section below

(back to top)

Usage

Applying Configurations

For NixOS Systems (VPS)

# Test configuration
sudo nixos-rebuild test --flake .#vps-8karm

# Apply configuration
sudo nixos-rebuild switch --flake .#vps-8karm

For Home Manager (Laptop)

# Apply Home Manager configuration
home-manager switch --flake .#laptop-ec

Updating System

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

(back to top)

Repository Structure

.
├── .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

(back to top)

Key Modules

Development Tools

  • 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

System Services (VPS Only)

  • OpenSSH: Remote access with key-based authentication
  • Fail2Ban: Protection against brute force attempts
  • Firewall: Basic network security
  • Backup: Automated application backup

Shell Environment

  • 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

A demo of the shell

(back to top)

Hosts

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.

(back to top)

Roadmap

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.

(back to top)

Contributing

While this is primarily a personal configuration, contributions are welcome.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Thomas Ritaine - thomas@ritaine.com - LinkedIn

Project Link: https://github.com/ThomasRitaine/nixos-config

(back to top)

Acknowledgments

  • 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

(back to top)

About

A modular NixOS and Home Manager configuration for servers and personal laptop.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载