213fb53a2c8fad39aca7680b08dd4ab65c38726c
nixos-config
Personal NixOS configuration using flakes and home-manager.
Structure
nixos-config/
├── flake.nix # Entry point — inputs and outputs
├── hosts/
│ └── nixos/
│ ├── configuration.nix # System configuration
│ └── hardware-configuration.nix # Auto-generated, machine-specific
└── home/
└── duynguyen/
└── default.nix # Home-manager config (user packages, dotfiles)
What's configured
- KDE Plasma 6 on Wayland via SDDM, Breeze Dark theme
- Niri scrollable-tiling compositor (available as a separate session at SDDM)
- Vietnamese input via fcitx5 + unikey (Telex/VNI)
- Open
fcitx5-configtool→ Input Method tab → add Unikey
- Open
- Touchpad: natural scroll, acceleration 0.4, scroll factor 0.75
- Shell: zsh (default) with autosuggestions, syntax highlighting, starship prompt, zoxide
- Locale: English UI, Vietnamese formats (currency, time, etc.), Asia/Ho_Chi_Minh timezone
- Pipewire for audio
- Packages:
- Browsers: firefox, zen-browser, claude-desktop
- Terminals: kitty, foot
- Editor: vscodium
- Niri tools: fuzzel, waybar, mako, wl-clipboard
- Daily apps: mpv, imv, grim + slurp, libreoffice, telegram-desktop
- CLI: btop, ripgrep, fzf, eza, bat, gh
- System: claude-code, git, kate
Reproducing on a fresh machine
1. Install NixOS
Boot the NixOS ISO, partition, and install as normal. During install, choose KDE Plasma if prompted.
2. Enable flakes temporarily
nix-shell -p git --command "bash"
# or just proceed if git is already available
3. Clone this repo
git clone <repo-url> ~/nixos-config
cd ~/nixos-config
4. Provide the hardware config
hardware-configuration.nix is machine-specific and not tracked in git. Copy the one generated by the NixOS installer:
cp /etc/nixos/hardware-configuration.nix ~/nixos-config/hosts/nixos/hardware-configuration.nix
5. Apply the configuration
sudo nixos-rebuild switch --flake ~/nixos-config#nixos
6. Lock the flake inputs
nix flake update
Commit the resulting flake.lock so future rebuilds use the exact same package versions.
Daily usage
| Task | Command |
|---|---|
| Apply system + home changes | sudo nixos-rebuild switch --flake ~/nixos-config#nixos |
| Update all inputs | nix flake update |
| Roll back last switch | sudo nixos-rebuild switch --rollback |
| Search packages | nix search nixpkgs <name> |
Adding packages
- System-wide (available to all users):
hosts/nixos/configuration.nix→environment.systemPackages - User-level (home-manager managed):
home/duynguyen/default.nix→home.packages - Per-user via NixOS:
hosts/nixos/configuration.nix→users.users.duynguyen.packages
Vietnamese input setup (fcitx5)
After first build:
- Open fcitx5-configtool
- Go to the Input Method tab → add Unikey
- Switch between English/Vietnamese with Super+Space
Unikey supports both Telex (default) and VNI — configure in the Unikey settings.
Languages
Nix
100%