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 one of the two flake templates. The flake templates set up a
flake.nixpointing to this repository and provide aMakefileto make it easy to apply changes.-
#default(probably what you want) - only manages home configuration for the current user. Works on anything that can run nix.nix flake new -t github:mattbun/dotfiles destination-dir
-
#nixos- makes a directory structure for separate nixos and home configurations with their own flakes. The provided Makefile applies both configurations. You can combine the two flakes, but I find it works a little better for my usecases to keep them separate.nix flake new -t github:mattbun/dotfiles#nixos destination-dir
-
-
Open the directory
cd destination-dir -
Customize
home.nix(#default) orhome/home.nix(#nixos) to your liking -
Apply configuration
make