-
Install a
nixdistribution in your system and enable flakes. The snippet below will install Determinate Nix which have flakes pre-enabled.curl -fsSL https://install.determinate.systems/nix | sh -s -- install -
Determine which target you want to use, and run below (the example below will use the
selubi@selupctarget). This may take a while.nix run github:nix-community/home-manager -- switch --flake github:selubi/machine#selubi@selupc
Thats literally it! The only dependency needed here is curl, sh and internet access.
Any machine bootstrapped from this repo will have the nxm command available. Running it will automatically pull the latest configuration from the main branch of this repository for the current target and apply it:
nxmThis command is defined in ./modules/home/modules/nh.nix.
The current target can also be checked via NXM_TARGET environment variable.
The available targets are formatted as userName@machineName, where machineName matches the attribute keys defined under globalConfig.machines, and userName matches attribute keys of globalConfig.machines.users.
Here is an example. If the globalConfig looks like this:
{
machines = {
selupc = {
system = "x86_64-linux";
users.selubi.homeConfiguration = [ ... ];
users.guest.homeConfiguration = [ ... ];
};
selumacbook = {
system = "aarch64-darwin";
users.selubi.homeConfiguration = [ ... ];
};
};
}Then:
selubi@selupc
guest@selupc
selubi@selumacbookare all valid targets.
- devshells
- Managing secrets
- flake-parts
- google drive via rclone
- nixos
- 1password system auth & shell integration
Update flake and switch to the new system
nxm -uShout out to these resources on helping me build this setup:
- Evertras/simple-homemanager - If you're new to nix and Home Manager, start here.