NixOS-WSL configuration targeted for work.
This repository is structured into small nix files that are combined to create the system configuration. The general structure is as follows:
| Directory | Description |
|---|---|
./channels |
channel configuration |
./install |
general installation configurations |
When copying the system to a new device it is necessary to install the base nixos.wsl-Image with wsl --install --name nix --from-file nixos.wsl. Afterwards, the setup script can be run with ./setup.sh within wsl -d nix to load this repository for the first time (when migrating the system to another device, the SSH keys in ~/.ssh should also be copied to the new device), followed by sudo nixos-rebuild switch to build the system.
Additionally, channels must be subscribed to manually with sudo nix-channel --add $URL $NAME and updated with sudo nix-channel --update. This setup requires the following channels:
sudo nix-channel --add https://nixos.org/channels/nixos-25.11 nixos
sudo nix-channel --add https://github.com/nix-community/NixOS-WSL/archive/refs/heads/release-25.11.tar.gz nixos-wslWhen reusing old configurations, make sure to update the stateVersion in the default configuration to the latest version.
If the system fails to boot, it is possible to open a recovery shell.