This is an example of how I structure my configurations, not necessarily the perfect match for every setup.
This flake example shows how to group several common tools:
- Ability to have custom packages in the system
- Ability to present this packages as an overlay
- Ability to handle one or multiple
nixosconfigurations - Ability to handle one or multiple
nix-darwinconfigurations - Ability to handle one or multiple
home-managerconfigurations
- Enter the devShell environment (using
direnvornix develop). - Update the
inputsusingflake-mgr update - Generate the system configuration using
flake-mgr switch
- This will define in the flake registy two local variations
nixpkgsto pin it for the system andnixcfgto this current flake. - Will apply
nixos-rebuild switchusing current flake (a flag might be required to select the correct configuration).
- Generate the home configuration using
flake-mgr home-switch
Currently, all the features were not used / tested (most notable
nix-darwin). Flake-mgr doesn't include yet a darwin-switch action.
Secrets handling is still a WIP, I target the integration of
sops-nix but other solutions might also apply.
Even though the current flake has an overlay, it is not propagated to
the nixpkgs entry in the registry, you will have to combine
explicitely the different overlays from other flakes/shells.
darwin/configurations: Configurations fornix-darwindarwin/modules: Modules fornix-darwinhome/configurations: Configurations for the users usinghome-managerhome/modules: Modules forhome-managerlib: Nix libraries to help handling the flakenixos/configurations: Configurations fornixosnixos/modules: Modules fornixospkgs: Local packagessecrets: Not yey implemented, but should contain keys, credentials and tokens protected bysops-nixorgit-crypt