Skip to content

Reproducible system configurations with Nix for NixOS (including WSL) and macOS (with nix-darwin)

License

Notifications You must be signed in to change notification settings

Nitestack/nix-config

Repository files navigation

📂 Cross-Platform Nix Configuration

For NixOS (including WSL) and macOS (with nix-darwin)
Powered by Nix and Home Manager

Latest commit GitHub Repo stars Github Created At

RequirementsGetting StartedLicense

NixOS

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!

⚙️ Requirements

Ensure you have git available when needed in the installation section.

NixOS

Ensure you have the latest version of NixOS installed.

Either run the graphical installer or manually install NixOS on your system.

WSL (NixOS)

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

Post-Install

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

macOS

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

🏁 Getting Started

Clone the repository:

git clone https://github.com/Nitestack/nix-config.git

NixOS

Before continuing with the installation, initialize the Nix system:

sudo nixos-rebuild boot --flake ~/nix-config#nixstation

Please reboot the system.

macOS

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.

WSL (NixOS)

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.

📝 License

This project is licensed under the Apache-2.0 license.

About

Reproducible system configurations with Nix for NixOS (including WSL) and macOS (with nix-darwin)

Topics

Resources

License

Stars

Watchers

Forks