My personal NixOS + Home Manager flake configuration.
- Nix 2.4+ with flakes enabled
- A NixOS installation
# Clone the repository
git clone https://github.com/dontwait/nix-conf.git
cd nix-conf
# Rebuild NixOS system
sudo nixos-rebuild switch --flake .#laptop
# Activate Home Manager
home-manager switch --flake .#dontwaitFull desktop configuration:
- Window Manager: i3-gaps with picom, dunst, rofi
- Display Manager: LightDM
- Terminal: Ghostty, Wezterm
- Shell: zsh (Oh My Zsh)
- File Manager: Yazi, Thunar
- Editor: Neovim
- Browser: Firefox, Brave
- PDF Reader: Zathura
- Audio: PipeWire with PulseAudio/Jack support
- Input Method: Fcitx5 with Unikey
- Virtualization: Docker, VMware
- Android SDK: Platform tools, NDK 28, Build tools 35
Minimal VM configuration for lightweight development environment.
.
├── flake.nix # Root flake with NixOS & HM outputs
├── flake.lock # Locked dependencies
├── nixos/
│ ├── laptop/ # NixOS system config for laptop
│ │ ├── configuration.nix
│ │ └── hardware-configuration.nix
│ └── minimal-vm/ # NixOS system config for VM
├── users/
│ ├── laptop/ # Home Manager config for laptop
│ │ ├── dontwait.nix
│ │ ├── db.nix
│ │ └── langs.nix
│ └── minimal-vm/ # Home Manager config for VM
├── modules/
│ └── home-manager/ # Reusable Home Manager modules
│ ├── nvim.nix
│ ├── ghostty.nix
│ ├── wezterm.nix
│ ├── zsh.nix
│ ├── picom.nix
│ ├── i3.nix
│ ├── yazi.nix
│ ├── firefox.nix
│ ├── zathura.nix
│ ├── tmux.nix
│ └── opencode.nix
└── dotfiles/ # Manual backups (nvim, zsh, i3, etc.)
# For laptop
sudo nixos-rebuild switch --flake .#laptop
home-manager switch --flake .#dontwait
# For minimal-vm
sudo nixos-rebuild switch --flake .#minimal-vm
home-manager switch --flake .#dontwait-minimal-vm# Update all inputs
nix flake update
# Or update specific input
nix flake update nixpkgsBefore using this configuration, you need to modify several files to adapt it to your system.
Change all occurrences of dontwait to your username:
users/laptop/dontwait.nix (lines 23-24):
home.username = "dontwait";
home.homeDirectory = "/home/dontwait";users/minimal-vm/dontwait-vm.nix:
home.username = "dontwait";
home.homeDirectory = "/home/dontwait";nixos/laptop/configuration.nix (lines 152-175):
users.users.dontwait = {
isNormalUser = true;
description = "dontwait";
...
};Update the hostname in NixOS configs:
nixos/laptop/configuration.nix (line 28):
networking.hostName = "nixos";nixos/minimal-vm/... (same field).
Generate your hardware config:
# For a new installation
sudo nixos-generate-config --root /mnt
# For existing system
sudo nixos-generate-configCopy the generated /etc/nixos/hardware-configuration.nix to:
nixos/laptop/hardware-configuration.nixnixos/minimal-vm/hardware-configuration.nix(if using VM)
Key hardware-specific settings include:
fileSystems- your disk partitions and mount pointsboot.initrd.luks.devices- encrypted partitionshardware.cpu.intel.updateMicrocodeor AMD equivalenthardware.graphicssettingshardware.bluetoothenable
Check and update user groups in nixos/laptop/configuration.nix (lines 158-169):
extraGroups = [
"networkmanager"
"wheel"
"docker"
"adbusers"
"plugdev"
"storage"
"disk"
"video"
"render"
"kvm"
];Remove groups that don't exist on your system or add new ones.
Update in nixos/laptop/configuration.nix (line 40):
time.timeZone = "Asia/Ho_Chi_Minh";Update in nixos/laptop/configuration.nix (lines 43-55):
i18n.defaultLocale = "en_US.UTF-8";If you don't need Vietnamese input, you can simplify nixos/laptop/configuration.nix (lines 57-65):
i18n.inputMethod = {
enable = true;
type = "fcitx5";
fcitx5.addons = with pkgs; [
fcitx5-gtk
];
};Or disable entirely by removing this section.
Check nixos/laptop/configuration.nix (line 94):
services.xserver.displayManager.lightdm.enable = true;If using a different DM (SDDM, GDM, etc.), change accordingly.
The Android SDK is configured in nixos/laptop/configuration.nix (lines 236-241):
(androidenv.composeAndroidPackages {
platformVersions = [ "36" ];
ndkVersions = [ "28.2.13676358" ];
buildToolsVersions = [ "35.0.0" ];
includeNDK = true;
}).androidsdkUpdate versions as needed or remove if not required.
Docker is enabled in nixos/laptop/configuration.nix (line 246):
virtualisation.docker.enable = true;Update the flake path in nixos/laptop/configuration.nix (line 272):
system.autoUpgrade = {
enable = true;
flake = "/home/dontwait/nix#laptop"; # Change to your path
...
};Review imports in users/laptop/dontwait.nix (lines 10-21):
imports = [
./db.nix
./langs.nix
../../modules/home-manager/default.nix
../../modules/home-manager/i3.nix
../../modules/home-manager/picom.nix
../../modules/home-manager/yazi.nix
../../modules/home-manager/firefox.nix
../../modules/home-manager/zathura.nix
../../modules/home-manager/opencode.nix
];Disable or enable modules based on what you actually need.
Review and update packages in:
nixos/laptop/configuration.nix(lines 208-242) - system packagesusers/laptop/dontwait.nix(lines 35-91) - user packages
Remove packages you don't need or add new ones.
Flatpak is enabled in nixos/laptop/configuration.nix (line 129):
services.flatpak.enable = true;Disable if not needed.
Printing is enabled in nixos/laptop/configuration.nix (line 124):
services.printing.enable = true;Disable if no printer.
The laptop host has auto-upgrade enabled via system.autoUpgrade:
- Runs weekly
- Automatically commits lock file changes
- NixOS: nixos-unstable + nixos-25.11 (for polybar)
- Home Manager: nixos-unstable
- State Version: 26.05
Inspired by Kunkka19xx - thanks for the great NixOS configs!