Cooked configs for NixOS and Home-Manager using flake-parts.
See an overview of the flake outputs by running
nix flake show github:hey2022/dotfiles.
Project documentation can be found here.
The architecture of this flake is designed around the concepts of roles, profiles, and components. It isolates implementation code from decision-making logic, allowing configurations to remain modular and clean.
-
Roles: The entry point for each machine is found in hosts, where it is split into system NixOS
configuration.nixand user Home-Managerhome.nixroles. They act as the top-level configuration that enables profiles for the purpose of its role as well as setting machine specific configuration. -
Profiles: Configurable options are where profiles come into play. You can find them in .system/profiles and ./home/profiles. While most shared configurations across all machines are enabled by default, profiles act as a control layer defining high-level group options to enable extra sets of programs and services on or off.
-
Components: The module system is equivalent to components. NixOS configurations live in ./system and Home Manager configurations live in ./home. They define localized program configurations while remaining agnostic of which roles and profiles it is used in. To achieve this and the principle of Locality of Behaviour (LoB) in profiles, each component should not look up into profiles for their
lib.mkIf config.profile.<...>.enableoptions, but rather it should enable based on its ownlib.mkIf cfg.enableoption that will be set by profiles. Upstream NixOS or Home Manager modules already provide theseenableoptions, so upstream options should be used where possible, if not anenableoption should be created for the program.
- lib: Helper functions
- modules: Modules intended to be upstreamed into nixpkgs or home-manager
- flake-modules: Flake-parts modules
- pkgs: Custom package definitions
Other configurations where I have stolen from.
