Unified ~/.dotfiles 📂
For NixOS, macOS (with nix-darwin), Windows (and NixOS WSL)
Powered by Nix, Home Manager, Nushell and chezmoi
Requirements • Getting Started • License
A unified, declarative dotfiles setup leveraging, Nix, Home Manager, nix-darwin and chezmoi to provide consistent shell environments across NixOS, macOS and Windows (including NixOS via WSL). This repository uses Nushell as the primary shell.
Be sure to ⭐️ or fork this repo if you find it useful!
Warning
This repository is primarily intended for NixOS, NixOS WSL and macOS. While I could have included more features on Windows, they may not perform as well as they do on NixOS (WSL). Tools like Neovim and others are technically functional on Windows, but they are slower. As a result, I've excluded them on Windows. If you want to use these tools on Windows, I recommend using NixOS WSL, it's just a better developer experience.
Ensure you have nu
, git
and chezmoi
available when needed in the installation section.
Ensure you have the latest version of NixOS installed.
Either run the graphical installer or manually install NixOS on your system.
Ensure you have the latest version of WSL installed.
Download nixos.wsl
from the latest release.
Either open the file by double-clicking or run:
wsl --install --from-file nixos.wsl # wherever nixos.wsl was downloaded
After the initial installation, update your channels to use nixos-rebuild
:
sudo nix-channel --update
If you want to make NixOS your default distribution, you can do so with
wsl -s NixOS
Ensure you have the latest version of macOS and Nix installed.
Install Nix
with the Nix Installer from Determinate Systems:
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | \
sh -s -- install
Ensure you have the latest version of Windows installed.
Clone the dotfiles repository:
git clone https://github.com/Nitestack/dotfiles.git ~/.dotfiles
Before continuing with the installation, initialize the Nix system:
sudo nixos-rebuild boot --flake "$HOME/.dotfiles/nix#nixstation"
Please reboot the system and then continue with the Final Steps.
Before continuing with the installation, initialize the Nix system:
nix run nix-darwin/master#darwin-rebuild -- switch --flake "$HOME/.dotfiles/nix#macstation"
Please reboot the system and then continue with the Final Steps.
Initialize the Nix system inside of NixOS-WSL:
sudo nixos-rebuild boot --flake "$HOME/.dotfiles/nix#wslstation"
Execute the following commands on Windows to correctly apply the custom username:
wsl -t NixOS
wsl -d NixOS --user root exit
wsl -t NixOS
Restart WSL and then continue with the Final Steps.
Continue with the Final Steps.
Initialize chezmoi:
chezmoi init --source=~/.dotfiles --apply
This project is licensed under the Apache-2.0 license.