Declarative, multi-host, modular NixOS flake template featuring Hyprland desktop environments, Quickshell rice, Home Manager integration, remote streaming, modular hardware profiles, and declarative server stacks.
.
├── config/ # Modular application configs & dotfiles
│ ├── cursor/ # Dynamic wallpaper-matching cursor generator
│ ├── fish/ # Fish shell configuration & environment
│ ├── gtk-3.0/ # GTK 3 custom stylesheets
│ ├── gtk-4.0/ # GTK 4 custom stylesheets
│ ├── hypr/ # Hyprland lua configs & window rules
│ ├── kitty/ # Kitty terminal configuration
│ └── nixpkgs/ # Nixpkgs settings (e.g. allowUnfree)
├── flake.nix # Flake inputs, outputs, and host configurations
├── hosts/ # Machine definitions (archetypes)
│ ├── desktop/ # Workstation / Gaming PC (Sunshine streaming host)
│ ├── laptop/ # Portable laptop (Moonlight client kiosk)
│ └── server/ # Headless / Storage server (Disko Btrfs & Docker)
├── modules/ # Reusable system & hardware configuration modules
│ ├── app-configs/ # Per-app integration hooks (fish, gtk, hypr, kitty)
│ ├── app-configs.nix # Modular app layering & overwrite engine
│ ├── apps.nix # System-wide GUI apps, browsers, and dev tools
│ ├── assets/ # Wallpapers and media
│ ├── core.nix # Base system, OpenSSH, nh, and networking
│ ├── desktop.nix # Hyprland, audio (PipeWire), display managers
│ ├── docker.nix # Docker daemon and Dockhand dashboard
│ ├── gaming.nix # Steam, GameMode, Prism Launcher, controller drivers
│ ├── hardware/ # Modular CPU & GPU hardware profiles
│ ├── rebuild.nix # OrbitOS rebuild CLI & SSH key tools
│ ├── remote-desktop/ # Sunshine streaming host & Moonlight client
│ └── server/ # Server stacks, Btrfs filesystem, and storage
├── secrets/ # Encrypted secrets (age-encrypted ~/.ssh archive)
│ └── .gitkeep
└── users/ # Modular user accounts & user environments
├── user/ # Primary user template (System user & Home Manager)
│ ├── default.nix # System user account, groups, password & SSH keys
│ └── home.nix # Desktop Home Manager dotfiles, themes & services
└── dev/ # Example secondary/restricted developer user
└── default.nix # Non-sudo developer account with SSH key access
| Host | Recommended Role | Included Highlights |
|---|---|---|
desktop |
Workstation & Gaming PC | Hyprland, Steam/GameMode, Sunshine streaming host, Full GUI apps |
laptop |
Portable Computer | Hyprland, Moonlight client, Battery/Hybrid GPU profile options |
server |
Headless Server / NAS | Disko declarative Btrfs partitioning, Docker, Dockhand, Server stacks |
If you have initialized this from the flake template:
nix flake init -t github:m-uvex/NixOSOr if you cloned/forked directly:
git clone <your-repo-url> /etc/nixos
cd /etc/nixos- In
flake.nix, update theusernamevariable if you want a custom username:username = "yourusername";
- Rename
users/user/to match your username (e.g.users/yourusername/), or keep it asusers/user/. - In
users/<username>/default.nix:- Set your
initialPassword(defaults to"nixos"), or generate a hashed password using:and replacemkpasswd -m sha-512
initialPassword = "nixos";withhashedPassword = "<hash>";. - Add your public SSH key to
openssh.authorizedKeys.keys.
- Set your
Choose which host profile fits your machine (desktop, laptop, or server):
# Generate hardware profile for your machine
sudo nixos-generate-config --dir ./hosts/desktop
# (Replace 'desktop' with 'laptop' or 'server' as needed)This overwrites hosts/<host>/hardware-configuration.nix with your machine's exact drives, UUIDs, and kernel modules, don't mix hardware configs of different machines.
Open hosts/<host>/default.nix and uncomment the hardware profiles that match your CPU and GPU:
imports = [
./hardware-configuration.nix
../../users/user
../../modules/core.nix
...
# Uncomment matching hardware profiles:
../../modules/hardware/amd-cpu.nix
../../modules/hardware/nvidia-desktop.nix
# ../../modules/hardware/intel-cpu.nix
# ../../modules/hardware/amd-gpu.nix
];Available hardware modules under modules/hardware/:
- CPU:
amd-cpu.nix,intel-cpu.nix - GPU:
nvidia-desktop.nix,nvidia-hybrid.nix,nvidia-legacy.nix,amd-gpu.nix,intel-arc.nix,intel-integrated.nix
For a fresh install from a NixOS Live USB:
sudo nixos-install --flake .#desktop
sudo rebootFor an existing NixOS system:
sudo nixos-rebuild switch --flake .#desktopOrbitOS provides a unified rebuild CLI with visual package diffs (powered by nh and nvd):
rebuild switch # Rebuild and switch current host
rebuild update # Update flake inputs and rebuild
rebuild test # Test configuration in current session without updating bootloader
rebuild dry # Preview package additions, upgrades, and diffs
rebuild desktop # Target a specific host definition
rebuild clean # Garbage-collect older generations (nh clean all)OrbitOS provides built-in scripts to back up and restore your ~/.ssh keys encrypted with an age passphrase:
- Backup keys: Run
backup-ssh(orrebuild backup-ssh). It archives~/.sshand encrypts it tosecrets/ssh.tar.age. - Restore keys: Run
restore-ssh(orrebuild restore-ssh). When switching to a fresh system,rebuildwill automatically detect missing keys and offer to decrypt them for you.
- Create a new directory under
hosts/<hostname>/. - Add
default.nixand generatehardware-configuration.nix. - Add an entry under
nixosConfigurationsinflake.nix:<hostname> = nixpkgs.lib.nixosSystem { inherit system specialArgs; modules = [ nix-flatpak.nixosModules.nix-flatpak driftwm.nixosModules.default home-manager.nixosModules.home-manager homeManagerModule ./hosts/<hostname>/default.nix ]; };
- Create a new directory under
users/<username>/default.nix. - Import the user inside the desired host's
default.nix:imports = [ ../../users/<username> ];