nix config for my personal machines
Nix 64.6%
Shell 29.9%
Other 5.4%
25 1 0

Clone this repository

https://tangled.org/frabarz.cl/nix-config https://tangled.org/did:plc:danquophndol7n2ho6g3rqns/nix-config
git@git.frabarz.cl:frabarz.cl/nix-config git@git.frabarz.cl:did:plc:danquophndol7n2ho6g3rqns/nix-config

For self-hosted knots, clone URLs may differ based on your setup.

Download tar.gz
README.md

Nix Configuration for My Devices#

This repository is a centralized system for the provision and configuration of my various devices, leveraging the Nix language for declarative and reproducible system management. It includes configurations for NixOS, macOS (via nix-darwin), OpenWRT (via custom scripts), and Android (via nix-on-droid).

Project Structure#

The project is organized into several key directories:

  • .design/: Architectural specifications and development roadmap.
  • devices/: Contains specific configurations for each individual machine.
    • baxi/: NixOS Desktop workstation.
    • eggu/: NixOS Home Server (Home Assistant, Media, etc.).
    • fink/: Android Dashboard (postmarketOS/Linux).
    • gelt/: Android Phone (nix-on-droid).
    • thor/: macOS Work Laptop.
    • vera/: OpenWRT Router.
  • modules/: Shared Nix modules used across different systems.
    • android/: Declarative ADB-based provisioning scripts.
    • core/: Base system defaults (bootloader, localization, common packages).
    • home/: User-level configuration and dotfiles via Home Manager.
    • services/: Reusable service definitions (Home Assistant, etc.).
    • users/: User account configurations.
  • lib/: Pure Nix helper functions (e.g., network validation).
  • pkgs/: Custom package definitions and overlays.
  • secrets/: Encrypted secrets managed with sops-nix.

Getting Started#

To explore or modify the configuration:

  1. Nix Shell: Enter the development shell to access necessary tools (git, jq, sops, etc.):
    nix develop
    
  2. Apply Configuration:
    • Baxi (NixOS): nixos-rebuild switch --flake .#baxi
    • Thor (macOS): darwin-rebuild switch --flake .#thor
    • Vera (Router): ./devices/vera/deploy.sh <router-ip>
    • Gelt (Android): nix run .#provision-gelt
    • Fink (Android): nix run .#provision-fink

Architectural Principles#

  • Declarative: All configurations are defined in Nix files.
  • Modular: Shared logic is decoupled into modules for maximum reuse.
  • Secure: Secrets are encrypted at rest using sops-nix and age.
  • Verified: Automatic validation of network configurations (no duplicate IPs/MACs).