Nix flake-based system and home configuration for macOS (nix-darwin) and NixOS (WSL).
| Name | Type | System | User | Description |
|---|---|---|---|---|
mac |
nix-darwin | aarch64-darwin | marvin | macOS workstation |
wsl-soptim |
NixOS/WSL | x86_64-linux | maha | WSL environment for work |
.
├── flake.nix # Flake entrypoint with all system definitions
├── modules/
│ ├── hm-system.nix # Shared home-manager integration module
│ └── windows/ # Windows/WSL-specific modules
├── darwin/
│ ├── default.nix # Shared darwin configuration
│ └── mac/ # mac-specific: Homebrew, Dock, fonts
├── nixos/
│ ├── default.nix # Shared NixOS configuration
│ └── wsl-soptim/ # WSL config: networking, docker, certs
└── home/
├── default/ # Shared home-manager config (all hosts)
│ ├── shell.nix # Zsh, fzf, starship
│ ├── cli.nix # CLI tools (jq, bat, fd, ripgrep, ...)
│ ├── git/ # Git configuration
│ ├── tmux.nix # Tmux
│ ├── neovim/ # Neovim configuration
│ ├── sdk.nix # JDK, .NET, Maven, Gradle, Go
│ └── devops.nix # kubectl, fluxcd, opentofu, docker-client
├── mac/ # macOS-specific: WezTerm, browser, shell extras
└── wsl-soptim/ # WSL-specific: SSH, Go, Claude Code, shell extras
- nixpkgs (nixos-unstable)
- home-manager (master)
- nix-darwin
- nix-homebrew
- nixos-wsl
- zen-browser
The Nix implementation used is Lix.
Install Nix with flakes support. The Determinate Systems installer is recommended as it enables flakes by default.
git clone https://github.com/Marfien/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
nix run nix-darwin -- switch --flake .#macAfter the initial build, use darwin-rebuild directly:
darwin-rebuild switch --flake ~/.dotfiles#mac- Install NixOS-WSL following their instructions.
- Clone and apply the configuration:
git clone https://github.com/Marfien/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
sudo nixos-rebuild switch --flake .#wsl-soptimIf you only want the home-manager configuration without a full system rebuild:
git clone https://github.com/Marfien/dotfiles.git ~/.dotfiles
cd ~/.dotfiles
nix run home-manager -- switch --flake .#<username>Note: Standalone home-manager configurations are not currently exported by this flake. Use the full system commands above.
Update all flake inputs to their latest versions and rebuild:
cd ~/.dotfiles
nix flake updateThen apply the updated configuration:
# macOS
darwin-rebuild switch --flake ~/.dotfiles#mac
# NixOS / WSL
sudo nixos-rebuild switch --flake ~/.dotfiles#wsl-soptimTo update a single input:
nix flake update home-manager