My NixOS configuration including hardware, configuration, flake, home manager.
Find a file
2026-07-14 14:16:43 +08:00
home Full refactor implementing multi-host, multi-user, multi-DE support. 2026-07-14 11:39:06 +08:00
hosts/laptop_01 removing user 2026-07-14 14:16:43 +08:00
modules Full refactor implementing multi-host, multi-user, multi-DE support. 2026-07-14 11:39:06 +08:00
users fixing typo 2026-07-14 13:55:34 +08:00
configuration.nix ssh key only for openssh 2026-07-14 13:37:35 +08:00
flake.lock CHORE : updating flake.lock 2026-07-14 13:38:00 +08:00
flake.nix Full refactor implementing multi-host, multi-user, multi-DE support. 2026-07-14 11:39:06 +08:00
LICENSE Initial commit 2026-07-02 03:12:34 +00:00
README.md fixing typo 2026-07-14 11:51:08 +08:00

NixOS Configuration

My personal NixOS flake supporting multi-host, multi-user, multi-DE. Each host loading the modules it needs.

It is licenced under MIT so feel free to modify, use and share.

[NOTE] If you plan on using it, be careful of removing my ssh keys, autoupdates from this repository...

NixOS Hyprland KDE Plasma

Design

The flake uses mkHost helper that reads hosts/<host>/users.nix to setup the user config and DE if needed. it import only the strict necessary modules / configs.

Each user's config is split into three layers:

Layer Path What goes here
shell users/<user>/home.nix Shell, git, anything usable headless
DE common home/common.nix + modules/desktop/common.nix Common apps for all desktop users
DE custom users/<user>/desktop/<de>.nix User's own DE settings and theming

Repository Structure

NixOS/
├── flake.nix                         # mkHost helper + nixosConfigurations outputs
├── configuration.nix                 # shared system config

├── hosts/
   └── laptop_01/
       ├── default.nix               # host-specific hardware + services
       ├── hardware-configuration.nix
       ├── users.nix                 # where to add the users of a host
       └── modules/
           └── gpu-env.nix           # NVIDIA Prime env vars + CUDA btop

├── modules/
   ├── users.nix                     # defines users option
   └── desktop/
       ├── sddm.nix                  # display manager, loaded if desktop is present
       ├── common.nix                # common config for all DE users
       ├── hyprland-noctalia/
          ├── system.nix            # hyprland programs
          └── home.nix              # UWSM env, Hyprland config, Noctalia
       ├── kde/
          ├── system.nix            # kde programs
          └── home.nix            
       └── programs/
           ├── firefox-system.nix    # programs specific configs
           └── firefox-home.nix    

├── home/
   └── common.nix                    # headless only fish, starship, btop

└── users/
    ├── charon/
       ├── system.nix                # NixOS user declaration
    │   ├── home.nix                  # minimal home (username, stateVersion)
    │   └── desktop/
    │       ├── default.nix           # DE layer: personal packages
    │       ├── firefox.nix           
    │       └── hyprland-noctalia.nix # DE specific configuration
    └── peppa/
        ├── system.nix                # minimal configuration for a user
        └── home.nix

Adding a host :

  1. Create hosts// with default.nix, hardware-configuration.nix and users.nix
  2. Add nixosConfigurations. = mkHost ""; to flake.nix

Adding a user :

  1. Create users//system.nix and users//home.nix
  2. Add the user to hosts//users.nix with their desktop (or null for headless)
  3. Optionally add users//desktop/default.nix for GUI-only config and users//desktop/.nix for DE-specific config

Willing to contact me :

Mail Signal