A modern, reproducible development environment using NixOS on WSL, featuring seamless Windows SSH agent integration, comprehensive development tools, and intelligent shell configuration.
- 🚀 Full NixOS environment running on WSL
- 🔒 Windows SSH agent integration
- 🏠 Home Manager configuration
- 🛠️ Development-ready with common tools
- ⚡ Fast package management with
nh
- 🐚 Modern shell experience with Zsh, Starship, and more
- 🔍 Smart command-not-found suggestions
- 📦 Ephemeral package execution with
comma
- Windows Subsystem for Linux (WSL2)
- NixOS-WSL installed (Installation Guide)
npiperelay.exe
installed on Windows (via WinGet or Chocolatey)# Using WinGet winget install npiperelay # Or using Chocolatey choco install npiperelay
-
Clone this repository:
git clone <repository-url> ~/nixos-config cd ~/nixos-config
-
Update Git configuration in
home.nix
:programs.git = { userName = "Your Name"; userEmail = "your.email@example.com"; };
-
Apply the configuration:
sudo nixos-rebuild switch --flake .#nixos
-
Update system and home configuration:
nosa # Alias for "nh os switch . && nh home switch ."
-
Preview changes before applying:
nos # Dry-run of system and home-manager changes
-
View system differences:
ndiff # Compare current and new system configurations
-
Install a package temporarily (ephemeral):
, hello # Run 'hello' without installing , python # Start a Python REPL
-
Install a package permanently:
- Add to
home.packages
inhome.nix
for user packages - Add to
environment.systemPackages
inconfiguration.nix
for system-wide packages
- Add to
-
Search for packages:
nsc package-name # Search NixOS packages
-
Create a new development environment:
mkdir my-project && cd my-project devenv init
-
Enter the environment:
devenv shell
-
Garbage collection:
ngc # Clean old generations ngcd # Dry-run of garbage collection
-
Update Flake inputs:
nix flake update # Update all inputs
- Modern alternatives to traditional commands:
ls
→eza
(with icons and git integration)cat
→bat
(with syntax highlighting)cd
→z
(smart directory jumping)find
→fd
(user-friendly find)grep
→rg
(ripgrep)
git st
- statusgit co
- checkoutgit br
- branchgit ci
- commitgit unstage
- reset HEADgit last
- show last commit
The system automatically connects to the Windows SSH agent. Your SSH keys managed in Windows will be available in NixOS-WSL.
To verify:
ssh-add -L # Should list your Windows SSH keys
-
Add new packages: Edit
home.nix
and add tohome.packages
:home.packages = with pkgs; [ your-package ];
-
Add system packages: Edit
configuration.nix
and add toenvironment.systemPackages
:environment.systemPackages = with pkgs; [ your-system-package ];
-
Add shell aliases: Edit
home.nix
and add toprograms.zsh.shellAliases
:programs.zsh.shellAliases = { your-alias = "your-command"; };
-
SSH agent issues:
- Verify npiperelay.exe installation
- Check the systemd service:
systemctl --user status ssh-agent-proxy
- Verify SSH_AUTH_SOCK:
echo $SSH_AUTH_SOCK
-
Rebuild fails:
sudo rm /run/current-system sudo nixos-rebuild switch --flake .#nixos
-
Clear nix store:
nix-collect-garbage -d
Feel free to submit issues and enhancement requests!