How aka-raccoon/.factory works
Main Components
a. Configuration Layers:
– Hosts: Under the “hosts” directory you see groupings (e.g., hosts/amb, hosts/asc, hosts/cmb, hosts/ley, hosts/pmb) and a _modules subdirectory that further encapsulates host‐specific configuration including NixOS modules, common defaults, filesystem setups, and services (DNS, k3s, nginx, etc).
– Homes: The “homes” directory contains home-manager configurations for different users (such as I572068, c4300n, trash-panda-v91-beta) as well as a shared modules folder (“homes/_modules”) that covers domains like browsers, deployment, editor configurations, shells, themes, virtualization, etc.
b. Package and Overlay Management:
– Pkgs: The “pkgs” directory holds custom package definitions and related TypeScript code (for example, the karabiner-config subdirectory) that likely provide further customization or installation routines.
– Overlays and Lib: The “overlays” directory (and “lib/mkSystem.nix”) indicate additional customization layers that override or extend standard Nixpkgs behavior.
c. Core Nix Infrastructure:
– flake.nix, flake.lock, and Taskfile.yaml files at the project root (and in the .taskfiles subfolders) show that the project uses flakes and task automation scripts. These serve as the entry-points for building, testing, or deploying the configurations.
d. Auxiliary Components:
– The presence of .github related items, along with organizational directories like .taskfiles for different domains (nix, sops), indicates integration with CI/CD systems and secrets management.
Relationships and Interactions
• How the base Nix infrastructure (flake.nix, Taskfile.yaml) feeds into building both hosts and homes configurations.
• The interaction between shared modules (in both hosts/_modules and homes/_modules) and their specific instances in individual hosts or user configuration directories.
• How overlays and pkgs provide modifications or extensions to base Nixpkgs which then are consumed by the hosts and homes modules.
• External interactions such as integration with secrets management tools (sops in .taskfiles/sops) and potential CI/CD pipelines (via the .github directory).
Architectural Patterns and Design Principles
• Modularity: The repository uses a highly modular structure (separation of concerns between host configuration, user home configuration, package customization, and overlays).
• Reusability: Notice common modules reused across different hosts and homes.
• Declarative configuration: The project is built around a declarative model where system settings are fully represented by Nix expressions.