> ## Documentation Index
> Fetch the complete documentation index at: https://soriphoono-homelab.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment Prerequisites

> Essential requirements before deploying your homelab infrastructure

Before deploying any component of your homelab infrastructure, ensure you have the necessary tools and environment configured.

## Required Software

### Nix Package Manager

You must have Nix installed with Flakes support enabled.

**1. Install Nix**

Follow the official installation guide at [nixos.org](https://nixos.org/download.html) or use the Determinate Systems installer:

```bash theme={null}
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
```

**2. Verify Flakes are enabled**

Check that flakes are enabled in your Nix configuration:

```bash theme={null}
nix flake --version
```

If flakes are not enabled, add the following to `~/.config/nix/nix.conf`:

```
experimental-features = nix-command flakes
```

### Development Tools

The repository includes a development shell with all necessary tools. You can access it in two ways:

```bash direnv (Recommended) theme={null}
# Install direnv first if not already installed
nix profile install nixpkgs#direnv

# Navigate to repository and allow direnv
cd /path/to/homelab
direnv allow
```

```bash nix develop theme={null}
# Manually enter the development shell
cd /path/to/homelab
nix develop
```

The development shell includes:

* `nil` - Nix language server
* `alejandra` - Nix code formatter
* `vulnix` - Security vulnerability scanner
* `age` & `agenix` - Secrets management
* `sops` - Secrets operations
* `ssh-to-age` - SSH key conversion for age
* `disko` - Disk partitioning (Linux only)
* `nixos-facter` - Hardware detection (Linux only)

## System Requirements

### For NixOS Deployments

* Target system must be running NixOS or have NixOS installer available
* SSH access to remote systems (if deploying remotely)
* Sufficient disk space for Nix store (recommended: 20GB minimum)

### For Home Manager Deployments

* Any Linux system with Nix installed
* Write permissions to user home directory
* Shell access (bash or zsh recommended)

### For Nix-on-Droid Deployments

* Android device (ARM64 architecture)
* Termux or similar terminal emulator
* Storage permissions granted
* Stable internet connection for initial setup

## Repository Structure

Familiarize yourself with the repository layout:

| Directory | Purpose |
| - | - |
| `systems/` | NixOS host configurations |
| `homes/` | Home Manager user configurations |
| `droids/` | Nix-on-Droid Android configurations |
| `modules/` | Reusable modules (nixos/, home/, droid/) |
| `pkgs/` | Custom packages and overrides |
| `lib/` | Utility functions |

## Network Requirements

> [!WARNING]
>
> Initial deployments require internet access to download packages from Nix binary caches. Plan accordingly for large deployments.

* Access to cache.nixos.org (or configured substituters)
* GitHub access for flake inputs (if not using offline mode)
* SSH access for remote deployments

## Secrets Management

If your configuration uses encrypted secrets:

* Ensure you have the appropriate age keys or SSH keys
* Secrets are managed using `agenix`
* Keys must be available before deployment on target systems

## Next Steps

Once prerequisites are met, proceed to:

* [Validating Changes](https://soriphoono-homelab.mintlify.site/deployment/validation.md) - Always validate before deploying
* [Deploying NixOS Systems](https://soriphoono-homelab.mintlify.site/deployment/nixos-systems.md)
* [Deploying Home Manager](https://soriphoono-homelab.mintlify.site/deployment/home-manager.md)
* [Deploying to Android](https://soriphoono-homelab.mintlify.site/deployment/nix-on-droid.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.