Personal dotfiles managed with Nix and Home Manager.
# Clone the repository
git clone https://github.com/FOLLGAD/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
# Run the installation script
./install-nix.shThe script will:
- Install Nix (if not already installed)
- Enable flakes
- Set up Home Manager with your configurations
- Install all declared packages
- NIX-REFERENCE.md - Quick reference for common Nix commands and patterns
- This README - Installation and basic usage
sh <(curl -L https://nixos.org/nix/install) --daemonAfter installing Nix, enable flakes by adding this to ~/.config/nix/nix.conf (create if it doesn't exist):
experimental-features = nix-command flakes
Or run:
mkdir -p ~/.config/nix
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.confgit clone https://github.com/FOLLGAD/dotfiles.git ~/.dotfiles
cd ~/.dotfiles./install-nix.shOr manually install Home Manager:
nix run home-manager/master -- switch --flake .#emil@linuxnix run home-manager/master -- switch --flake .#emilnix run home-manager/master -- switch --flake .#emil@darwin-x86Note on flake targets: the names after # come from flake.nix under homeConfigurations. In this repo:
emil: macOS (Apple Silicon)emil@darwin-x86: macOS (Intel)emil@linux: Linux
To list them on your machine:
nix flake show ~/.dotfilesEdit home.nix and update the username (and home directory) if needed:
home.username = lib.mkDefault "your-actual-username";
home.homeDirectory = lib.mkDefault "/home/your-actual-username"; # or /Users/your-actual-username on macOSThen rebuild:
home-manager switch --flake .After making changes to the configuration files:
home-manager switch --flake ~/.dotfilesTo update all packages:
nix flake update
home-manager switch --flake ~/.dotfiles- Shell: Zsh with Oh My Zsh, vi-mode, syntax highlighting
- Editor: Neovim with custom configuration
- Media Player: MPV configuration
- macOS Window Manager: Aerospace (macOS only)
Edit home.nix and add packages to the home.packages list:
home.packages = with pkgs; [
# ... existing packages
your-new-package
];Home Manager provides modules for many programs. Check the Home Manager options for available programs.
Example:
programs.git = {
enable = true;
userName = "Your Name";
userEmail = "[email protected]";
};.
├── flake.nix # Nix flake configuration
├── home.nix # Home Manager configuration
├── flake.lock # Locked versions of dependencies
├── mpv/ # MPV configuration
├── aerospace/ # Aerospace configuration (macOS)
├── zshrc # Legacy Zsh configuration (reference only)
└── install-nix.sh # Bootstrap installer
If you get an error about experimental features, make sure you've enabled flakes in ~/.config/nix/nix.conf.
Make sure ~/.nix-profile/bin is in your PATH. You may need to restart your shell or source the Nix profile script.