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
nixos
configurations - Ability to handle one or multiple
nix-darwin
configurations - Ability to handle one or multiple
home-manager
configurations
- Enter the devShell environment (using
direnv
ornix develop
). - Update the
inputs
usingflake-mgr update
- Generate the system configuration using
flake-mgr switch
- This will define in the flake registy two local variations
nixpkgs
to pin it for the system andnixcfg
to this current flake. - Will apply
nixos-rebuild switch
using 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-darwin
darwin/modules
: Modules fornix-darwin
home/configurations
: Configurations for the users usinghome-manager
home/modules
: Modules forhome-manager
lib
: Nix libraries to help handling the flakenixos/configurations
: Configurations fornixos
nixos/modules
: Modules fornixos
pkgs
: Local packagessecrets
: Not yey implemented, but should contain keys, credentials and tokens protected bysops-nix
orgit-crypt