For NixOS (including WSL) and macOS (with nix-darwin)
Powered by Nix and Home Manager
Requirements • Getting Started • License
A comprehensive, cross-platform Nix configuration repository managing system settings and user environments across multiple operating systems. This repository provides reproducible, declarative configurations for NixOS (including NixOS via WSL) and macOS.
Be sure to ⭐️ or fork this repo if you find it useful!
Ensure you have git
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 -fsSL https://install.determinate.systems/nix | sh -s -- install
Clone the repository:
git clone https://github.com/Nitestack/nix-config.git
Before continuing with the installation, initialize the Nix system:
sudo nixos-rebuild boot --flake ~/nix-config#nixstation
Please reboot the system.
Before continuing with the installation, initialize the Nix system:
sudo nix run nix-darwin/master#darwin-rebuild -- switch --flake ~/nix-config#macstation
Please reboot the system.
Initialize the Nix system inside of NixOS-WSL:
sudo nixos-rebuild boot --flake ~/nix-config#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.
This project is licensed under the Apache-2.0 license.