2# NixOS Dotfiles - Portable Configuration
A fully portable Nix configuration that works on both NixOS and any Linux distribution with Nix (e.g., Arch Linux, Ubuntu, Fedora, etc.).
- Fully Portable: Same configuration works on NixOS or any Linux distro with Nix
- MangoWC Compositor: Complete Wayland compositor setup via Home Manager
- Modular Design: Uses
specialArgsfor clean, reusable configuration - Live Config Editing: All dotfiles are symlinks - edit and see changes immediately
- Declarative: Everything defined in Nix, reproducible across machines
- Secret Management: Encrypted secrets with sops-nix
cd ~/nixos-dotfiles
sudo nixos-rebuild switch --flake .#nixos# Install Nix with flakes
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
# Clone and apply
git clone <your-repo-url> ~/nixos-dotfiles
cd ~/nixos-dotfiles
# First time setup - install Home Manager and apply
nix run home-manager/master -- switch --flake .#noor
# After initial setup, use the alias
apply-homeWe use specialArgs (NixOS) and extraSpecialArgs (Home Manager) to pass configuration:
# In flake.nix
userConfig = {
username = "noor";
name = "Noor Latif";
email = "noor@latif.se";
dotfilesDir = "nixos-dotfiles";
};
# Passed to all modules via specialArgs/extraSpecialArgsThis makes the configuration:
- Reusable: Easy to add more users or hosts
- Maintainable: Change username in one place
- Clean: No hardcoded strings scattered across files
This setup includes MangoWC, a lightweight dwm-like Wayland compositor configured via Home Manager.
- Super+Shift+Return: Open terminal (kitty)
- Super+d: Open launcher (rofi)
- Super+1-9: Switch workspace (tag)
- Super+Shift+1-9: Move window to workspace
- Super+hjkl: Focus window (vim-style)
- Super+Shift+hjkl: Move window
- Super+t: Tile layout
- Super+v: Vertical grid layout
- Super+c: Spiral layout
- Super+x: Scroller layout
- Super+q: Kill window
- Super+Shift+b: Toggle waybar
- Super+Shift+x: Lock screen (swaylock)
- Super+m: Quit mango
All MangoWC configs are in config/mango/:
config.conf- Main compositor settings, effects, autostartbind.conf- Key bindingsrule.conf- Window rulestag.conf- Workspace defaultsscripts/- Helper scripts
These are live symlinks - edit them directly and changes apply immediately (or press Super+Shift+r to reload mango config).
apply # Rebuild NixOS (nixos-rebuild switch)
apply-home # Rebuild Home Manager (home-manager switch)
waybar-start # Restart waybar with config
mango-reload # Reload MangoWC configEdit flake.nix:
userConfig = {
username = "yourusername"; # Change this
name = "Your Name";
# ...
};Then rebuild. The change propagates to all modules via specialArgs.
Edit home.nix:
home.packages = with pkgs; [
# Existing packages...
# Add new ones
htop
fzf
ripgrep
];In repo, run:
mkdir config/myapp
# Then copy the dotfile dir in your home folder to repo
cp ~/.config/myapp/config.conf config/myapp/It will be auto-symlinked to ~/.config/myapp/ on next rebuild.
Edit files in config/mango/ directly (they're live symlinks). To reload:
mango -r
# Or: Super+Shift+rUses sops-nix for encrypted secrets.
# Edit secrets
sops secrets/secrets.yaml
# Access in config
config.sops.secrets.MY_SECRET.pathEnsure you're in the correct groups and have required system services:
# On Arch, you may need to install these via pacman:
sudo pacman -S polkit pipewire pipewire-pulse wireplumber seatd
sudo systemctl enable --now polkit pipewire pipewire-pulse seatd- SETUP.md - Detailed installation instructions for Arch Linux
- config/mango/README.md - MangoWC-specific documentation
- Wiki: https://mangowc.vercel.app/docs/