Add fcitx5-configtool addon and clarify that Unikey must be added via fcitx5-configtool's Input Method tab, not through KDE Virtual Keyboard settings.
93 lines
2.6 KiB
Markdown
93 lines
2.6 KiB
Markdown
# 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
|
|
- **Vietnamese input** via fcitx5 + unikey (Telex/VNI)
|
|
- Open `fcitx5-configtool` → Input Method tab → add **Unikey**
|
|
- **Locale**: English UI, Vietnamese formats (currency, time, etc.), Asia/Ho_Chi_Minh timezone
|
|
- **Pipewire** for audio
|
|
- **Packages**: firefox, kate, claude-code, git
|
|
|
|
## 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
|
|
|
|
```bash
|
|
nix-shell -p git --command "bash"
|
|
# or just proceed if git is already available
|
|
```
|
|
|
|
### 3. Clone this repo
|
|
|
|
```bash
|
|
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:
|
|
|
|
```bash
|
|
cp /etc/nixos/hardware-configuration.nix ~/nixos-config/hosts/nixos/hardware-configuration.nix
|
|
```
|
|
|
|
### 5. Apply the configuration
|
|
|
|
```bash
|
|
sudo nixos-rebuild switch --flake ~/nixos-config#nixos
|
|
```
|
|
|
|
### 6. Lock the flake inputs
|
|
|
|
```bash
|
|
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:
|
|
1. Open **fcitx5-configtool**
|
|
2. Go to the **Input Method** tab → add **Unikey**
|
|
3. Switch between English/Vietnamese with **Super+Space**
|
|
|
|
Unikey supports both **Telex** (default) and **VNI** — configure in the Unikey settings.
|