$ show erikarvstedt/extra-container
extra-container is a command-line tool for managing NixOS containers without requiring full system rebuilds. It builds container configurations using Nix and integrates them into the host system via systemd service files and garbage collection roots. The tool supports creating, starting, stopping, and accessing containers via shell. Key innovations include a minimal NixOS module set for fast evaluation (eval-config.nix) and compatibility abstractions for different NixOS versions. The tool is actively maintained with recent commits and uses modern Nix Flakes.
The LLM identified 2 files worth highlighting for reuse:
Defines a minimal set of NixOS modules for evaluating container configurations, reducing evaluation time by avoiding the full module set. Also provides the 'extra' option set for containers to simplify common configurations like private networks and WAN access. This module is self-contained and can be reused in any Nix project that needs to evaluate NixOS configurations with a custom module set.
Contains the getInstallDirs function that abstracts away the differences in container file locations between NixOS versions (pre and post 22.05). This function determines the correct configuration and state directories by checking the nixos-container binary, allowing the tool to work across different NixOS releases. This pattern can be extracted as a utility for managing NixOS version-specific paths.