The configuration in this repo relies on Nix and Home Manager. That doesn't mean it only works on NixOS! I've also used it in macOS (with nix-darwin), Arch Linux, and ChromeOS's Crostini.
So I don't have to hard-code the system architecture, username, or home directory. The nix configurations in this repo rely on builtins.currentSystem and builtins.getEnv which don't work in pure evaluations with flakes.
Prerequisites:
nixgnumake
-
Use the flake template:
nix flake new -t github:mattbun/dotfiles destination-dir
-
Open the directory
cd destination-dir -
Customize
home.nixto your liking -
Apply configuration
make
{
inputs = {
# ...
# Add to inputs
dotfiles.url = "github:mattbun/dotfiles";
};
outputs = { dotfiles, ... }: {
homeConfigurations.matt = home-manager.lib.homeManagerConfiguration {
# ...
modules = [
# ...
# Add to modules
dotfiles.homeModule
];
};
};
}See templates/default/flake.nix for a full example.