-
Notifications
You must be signed in to change notification settings - Fork 0
File Structure
Understanding the NullOS directory structure.
NullOS uses a well-organized structure separating system configuration, home manager settings, and documentation.
NullOS/
├── flake.nix # Main flake configuration
├── flake.lock # Locked dependencies
├── AGENTS.md # AI agent documentation and system architecture
├── README.md # Project documentation
├── WIKI.md # Wiki index
├── .gitignore # Git ignore rules
├── .sops.yaml # SOPS secret configuration
├── _screenshots/ # Screenshots
├── wallpapers/ # Wallpaper images
├── home/ # Home Manager configs
├── machines/ # Per-machine configs, profiles, and secrets
├── modules/ # NixOS system modules
├── packages/ # Custom packages (derivations)
└── wiki/ # Local wiki (optional)
Main flake configuration that:
- Defines inputs (nixpkgs, home-manager, sops-nix, etc.)
- Configures system outputs
- Sets up overlays
- Implements the three-stage variable merging pipeline (base -> profile -> machine)
- Defines machine configurations (
nixosConfigurations) - Defines home configurations (
homeConfigurations)
Documentation detailing the architecture, quirk explanations, and quick references. This file is vital for understanding the 3-stage config pipeline.
Locked versions of all inputs. Ensures reproducibility.
Update with:
nix flake updateThis directory replaces the old variables.nix and handles per-machine settings and feature flags.
machines/
├── profiles/
│ ├── base.nix # ~70 feature flags, system defaults
│ ├── pc.nix # Feature sets for PCs
│ └── server.nix # Feature sets for servers
├── nslapt/ # Laptop configuration
│ ├── default.nix # Per-machine overrides and vars
│ └── secrets.yaml # Encrypted secrets via sops-nix
├── nspc/ # Desktop configuration
│ ├── default.nix
│ └── secrets.yaml
└── nsminipc/ # Headless server
├── default.nix
└── secrets.yaml
-
Base (
machines/profiles/base.nix) - Feature flags, most false. -
Profile (
machines/profiles/{pc,server}.nix) - Feature sets based on machine class. -
Machine (
machines/{hostname}/default.nix) - Per-machine overrides.
Result: vars object available to all modules via specialArgs. Non-reserved attributes in machine config become extraNixosConfig.
User-level configurations managed by Home Manager.
home/
├── default.nix # Main entry point (conditional imports)
├── hyprland/ # Hyprland configs
├── zsh/ # Shell configs and aliases
└── ... # Other application configs
Main home-manager configuration that conditionally imports all other home configs based on the vars feature flags.
System-level NixOS modules organized by category.
modules/
├── default.nix # Imports all system modules
├── services/ # System services (e.g. backup, ssh)
├── software/ # Applications (e.g. packages.nix)
└── system/ # System settings (boot, nvidia, network)
NullOS now uses sops-nix for managing secrets. Secrets like githubToken or resticRepository passwords are encrypted per-machine in machines/{hostname}/secrets.yaml.
- Installation - Setting up NullOS
- Customization Guide - Modifying configs
- Variables Reference - All variables explained