Declarative dotfiles for macOS, Linux, WSL, NixOS, and Windows using Nix Flakes.
Note
Personal configuration. Fork and adapt for your own needs.
# Install Nix (if not installed)
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Apply configuration
nix run github:anko9801/dotfiles#switch --impurenix run .#switch # Apply configuration (auto-detect platform)
nix run .#switch -- <host> # Apply specific host
nix run .#windows # Setup Windows from WSL
nix run .#deploy # Deploy to remote server
nix flake check # Validate configuration
nix flake update # Update flake inputs
nix fmt # Format all filesEdit config.nix:
rec {
# Add yourself
users.yourname = {
git = {
name = "Your Name";
email = "you@example.com";
};
};
# Customize host modules
hosts.wsl.modules = baseModules ++ [
./ai
./tools
# Add or remove modules
];
}"file not found" during build
git add . # Nix flakes only see git-tracked filesConflict with existing dotfiles
# Backup and remove conflicting files in ~/.config/
mv ~/.config/foo ~/.config/foo.bakCheck what will change
nix build .#homeConfigurations.wsl.activationPackage --impure --dry-run