A standardized NixOS-WSL development environment that provides a consistent, reproducible setup for development teams. This project creates a distributable WSL tarball with pre-configured development tools and allows individual user customization.
- Standardized Environment: Consistent development setup across all team members
- User Customization: Personal configuration template for individual preferences
- Docker Support: Pre-configured Docker with custom daemon settings
- Development Tools: Node.js 22, JDK 17, Git, Neovim, and essential utilities
- Shell Environment: Zsh with Oh My Zsh and useful plugins
- Automated Distribution: PowerShell installer for easy deployment
- Nix with flakes enabled
justcommand runnersudoaccess for tarball building
# Build the WSL tarball
just build-tar
# The tarball will be created at: output/nixos.wsljust build-tar # Build WSL tarball
just clean # Remove output directory
just info # Show build informationnix-develop/
βββ flake.nix # Main flake configuration
βββ configuration.nix # System-level configuration
βββ shell.nix # Development shell
βββ Justfile # Build commands
βββ scripts/
β βββ install.ps1 # PowerShell installer
βββ user-template/ # User configuration template
βββ flake.nix # User's personal flake
βββ home.nix # Home Manager configuration
βββ README.md # User documentation
βββ home/
βββ git.nix # Git configuration template
βββ zsh.nix # Zsh configuration
βββ packages.nix # Personal packages template
- Development: Node.js 22, JDK 17, Git, Neovim
- Shell Tools: Zsh, Bat, Curl, Wget
- System: Docker with custom settings
- Default user:
dev - Sudo without password for wheel group
- Time zone: Europe/Madrid (configurable)
- Docker enabled with custom daemon settings
- User-specific configurations via
user-template/ - Git, Zsh, and package customization
- Automatic deployment to user's home directory
The installer automates:
- WSL distro installation from GitHub releases
powershell -NoProfile -ExecutionPolicy Bypass -Command "iwr 'https://raw.githubusercontent.com/0xCAB0/nix-develop/refs/heads/main/scripts/install.ps1' | iex"- User configuration bootstrap from template branch
- Environment setup and validation
Configuration Variables:
$DistroName = "NixOS-Dev"
$InstallDir = "C:\WSL\$DistroName"
$TarballUrl = "https://github.com/acabociu-ntt/nix-develop/releases/latest/download/nix-develop.wsl"
$ConfigBranch = "user_template"- Build tarball:
just build-tar - Create GitHub release with
output/nixos.wsl - Update installer URL if needed
- Test installation on target systems
- Run PowerShell installer
- Launch WSL:
wsl -d NixOS-Dev - Customize configuration in
~/.config/nixos/ - Apply changes:
sudo nixos-rebuild switch --flake ~/.config/nixos#wsl
Users can update their environment:
nix flake update ~/.config/nixos
sudo nixos-rebuild switch --flake ~/.config/nixos#wsl# Enter development shell
nix develop
# Test configuration
nix flake check
# Build and test tarball
just build-tarEdit configuration.nix:
environment.systemPackages = with pkgs; [
# Add new system-wide packages here
new-package
];Update files in user-template/:
home.nix- Main home configurationhome/*.nix- Specific tool configurations
Docker is pre-configured with:
- TLS disabled (for Zscaler compatibility)
- Debug mode enabled
- Insecure registry: docker.io
# Check flake syntax
nix flake check
# Rebuild with trace
nix build --show-trace
# Clean and rebuild
just clean && just build-tar- Git tree dirty warning: Commit changes before building
- Permission errors: Ensure sudo access for tarball builder
- Package conflicts: Check for duplicate package definitions
# Check system configuration
nix eval .#nixosConfigurations.wsl-dev-env.config.system.build
# Test in development shell
nix develop- Make changes to configuration files
- Test locally with
just build-tar - Update documentation if needed
- Create pull request with changes
- NixOS Manual: https://nixos.org/manual/nixos/stable/
- NixOS-WSL: https://github.com/nix-community/NixOS-WSL
- Home Manager: https://github.com/nix-community/home-manager
- Package Search: https://search.nixos.org/packages