Learn Nix (Using This Repo)
Nix is a package manager and a language for describing builds, environments, and systems. This repo shows how a pinned package set can serve all three.
Quick Vocabulary
nixpkgs: the upstream collection of packages and helper functions.pin: an exact revision of an input, recorded here inflake.lock.derivation: a recipe for a build output, often a package.overlay: a function that adds to or changes a package set.module: a reusable configuration fragment with options and implementation.flake: a way to declare inputs and expose outputs such as packages and hosts.
Follow One Feature
poglets shows the difference between a package, a module, and a host:
pkgs/server/poglets.nixdescribes how to build the binary.mods/_pkgs.nixexposes that recipe aspkgs.poglets.hosts/modules/servers/poglets.nixdefinesservices.pogletsand how systemd runs the package.hosts/neptune/configuration.nixenables the service and chooses its ports.flake.nixexposesneptuneasnixosConfigurations.neptuneand the package as a buildable output.
The package answers “what gets built?”, the module answers “how does it run?”, and the host answers “which machine uses it?”. The full case study walks through the source and commands.
Place That Example In The Repo
flake.nix declares inputs and creates outputs for each supported system; flake.lock pins their revisions. default.nix constructs the package set for a system, and overlays.nix adds local packages and tools. Hosts and Home Manager consume that package set. See Architecture for the full source map.
Try It Yourself
From the repository root, run nix flake show --no-write-lock-file and find both poglets and neptune. Then open the five files above and identify the build recipe, the service options, and the machine-specific values. Use Daily Workflows when you are ready to build either output.