Puzzlevision
Non-stop entertainment! The wackiest NixOS configuration to-date.
💡 What was the primary motivation for another re-write? #
The primary goal is improving the auto-discovery architecture, using less custom functions and more often falling back to builtins and standard library methods.
Apart from that, one of my only large linux-based desktop devices, puzzlevision, has since been mostly removed from my workflow, making a large portion of modules unnecessary as it stands today.
The above point makes this re-write very fitting now, as it allows me to start with a significantly thinner base, while also simultaneously discovering what nix-darwin has to offer for my new MacBook.
Finally, versioning my systems through a semver-compatible system has long been in my notes, but I never got the chance to really set that plan in motion, so I'm using this as a chance to understand the general shape of the flake, outside of modules, homes and systems, at a much slower and more thorough pace.
📦️ Deployment #
NixOS systems #
To deploy a system run the following command in your terminal of choice.
sudo nixos-rebuild switch --flake .#hostname
If you're interested in a quick way to experiment with this configuration, you may use the following command to build a VM.
sudo nixos-rebuild build-vm --flake .#hostname
Darwin systems #
To deploy a darwin system run the following command in your terminal of choice.
sudo darwin-rebuild switch --flake .#hostname
🏗️ Structure #
This flake follows an opinionated directory structure, described below.
flake.nix --> The flake.
/systems --> NixOS configurations for various types of systems, using easy-hosts.
/x86_64-nixos --> NixOS configuration running on the x86_64 architecture
/example --> Concrete example of a system folder.
/modules --> Modules that are mapped to their corresponding system, or home-manager configs.
/common --> Modules automatically applied to all nixos and darwin systems.
/nixos --> Modules automatically applied to all nixos systems.
/darwin --> Modules automatically applied to all darwin systems.
/home --> Modules automatically applied to all home-manager configurations.
/homes --> Directory for home-manager configurations, mapped to a specific system.
/example --> Contains all home-manager configurations for users of the example system.
/user --> Concrete example of a home-manager configuration folder for user@example
/lib --> A place for custom lib methods.
🏷️ Archetypes #
I structure my NixOS and Darwin configurations around the concept of "archetypes", where each type of system simply enables theirs and receives all relevant defaults.
Archetypes themselves often build on other archetypes, to prevent duplication.
My archetypes are currently chained as follows:
NixOS #
Many of these are not actually defined anywhere in the flake, as there are no real consumers at the moment.
- basic --> Every system needs these
- server --> Every server needs these
- workstation --> Every workstation needs these
- laptop --> Every laptop needs these
Darwin #
- basic --> Every system needs these
- workstation --> Every workstation needs these
🎨 Credits #
Various aspects of this flake are inspired by the likes of:
and documentations such as:
many thanks to their hard work!