Imported from Natho86/NixOS (
AGENTS.md). Install upstream withnpx skills add Natho86/NixOS. Copyright stays with the author.
Repository Guidelines
Project Structure & Module Organization
flake.nixdefines inputs and the NixOS outputs. Host-specific entry points live underhosts/.hosts/redpill-x1-yoga/andhosts/redpill-desktop/contain per-machineconfiguration.nixplus optional helpers (e.g.,gpu-packages.nix).shared/contains common modules:configuration.nixfor system settings,home.nixfor Home Manager, anddesktop/omarchy/for the Hyprland desktop.- Secrets are managed via sops-nix; the example file is
secrets.yaml.example, and real secrets live undersecrets/(gitignored).
Build, Test, and Development Commands
make rebuild: rebuild and switch to the current host (defaults to.#laptop).make test: build and test without switching; safer for changes.make check: runnix flake checkfor basic validation.make update: update flake inputs and rebuild.make format: format Nix files withnixpkgs-fmt.- Equivalent direct commands include
sudo nixos-rebuild switch --flake .#laptopandsudo nixos-rebuild test --flake .#laptop.
Coding Style & Naming Conventions
- Nix files follow two-space indentation and conventional module style (
{ config, pkgs, ... }:then an attribute set). - Use
nixpkgs-fmtviamake formatwhen touching.nixfiles. - Keep host-specific changes in
hosts/<host>/configuration.nix; keep shared settings inshared/.
Testing Guidelines
- There is no dedicated test suite. Use
make testto validate system builds andmake checkfor flake checks. - Prefer
nixos-rebuild testbeforeswitchto avoid breaking the running system.
Commit & Pull Request Guidelines
- Commits are short, imperative, and descriptive (e.g., “Add GPU-ready faster-whisper tooling”).
- PRs should describe the host impacted, summarize the Nix modules touched, and include relevant commands run (e.g.,
make test). - If a change introduces secrets or host-specific data, verify it stays out of git (hardware configs and
secrets/are ignored).
Security & Configuration Tips
hardware-configuration.nixis machine-specific and should not be committed.- Update LUKS UUIDs only in the relevant host config under
hosts/. - Keep age keys under
~/.config/sops/age/and usesecrets.yaml.exampleas a template.
Agent Notes
- If you are an automation agent, read
CLAUDE.mdfor repository-specific context and workflows.