My NixOS configuration using Den, flake-parts, and import-tree.
| Path | Purpose |
|---|---|
modules/hosts.nix |
Host attributes and user assignments |
modules/hosts/<host>/default.nix |
Host aspects and hardware-specific settings |
modules/users/<user>/<user>.nix |
User aspects and included features |
modules/<category>/ |
Reusable aspects, one file per aspect |
hosts/<host>/hardware-configuration.nix |
Generated hardware configuration |
assets/ |
Images, scripts, shaders, and editable application settings |
secrets/ |
SOPS-encrypted secrets and setup instructions |
modules/flake-inputs.nix |
Flake inputs; flake.nix is generated |
All .nix files under modules/ are discovered automatically. An aspect becomes
active when included by a host, user, or bundle. Host-specific values belong in
host attributes; personal values belong in user attributes in modules/hosts.nix.
| Host | Hardware | Host includes |
|---|---|---|
void |
Ryzen 9 9950X, RX 9070 XT, three monitors | base-system, wireguard, gaming |
voidframe |
Framework laptop, Ryzen 7 7840U | base-system |
Both hosts use the neonvoid user aspect. Den applies the user aspect automatically;
do not also include it in the host aspect. Host bundles project their Home Manager
settings to users through den._.host-aspects.
System bundles
| Bundle | Included aspects |
|---|---|
base-system — core |
boot, locale, networking, systemd, overlays, nix-settings, multiverse |
base-system — hardware |
bluetooth, kernel, print, udev |
base-system — security |
sops, pcscd, sudo, noctalia-greeter, polkit |
base-system — services/packages |
ananicy, system-packages |
gaming — desktop only |
steam, mangohud, deadlock, wow, scopebuddy |
User includes — defined in neonvoid.nix.
| Category | Included aspects |
|---|---|
| Shell tools | bat, btop, direnv, devenv, delta, eza, fastfetch, fzf, git, kitty, just, lazygit, mcp, nh, nix-index, nvim, opencode, pay-respects, starship, tealdeer, yazi, zoxide, zsh |
| Desktop | desktop-environment, fonts, xdg, stylix, noctalia, flatpak, clipboard, cursor, firefox, gtk, umbriel, thunar, xembsni |
| Services | gnome-keyring, pipewire, streamcontroller, usb |
| Home | common, files, packages |
| Media | cava, easyeffects, mpv, obs-studio, pics, youtube-music |
| Communication | discord, email |
- Add a host entry under
den.hosts.x86_64-linuxinmodules/hosts.nix. Reuse the existingneonvoidattrset or assign another user:
myhost = {
users.neonvoid = neonvoid;
timezone = "America/New_York";
greeting = "My Host";
xRes = "1920";
yRes = "1080";
monitors.main = {
name = "DP-1";
mode = "1920x1080@60";
scale = 1.0;
position = "0x0";
primary = true;
};
};- Create
modules/hosts/myhost/default.nix:
{ den, inputs, ... }:
{
den.aspects.myhost = {
includes = [ den.aspects.base-system ];
nixos = {
imports = [ (inputs.self + "/hosts/myhost/hardware-configuration.nix") ];
# Add this machine's boot, hardware, and networking settings here.
};
};
}- Add
hosts/myhost/hardware-configuration.nixfromnixos-generate-config. - Prepare the machine's secrets using secrets/README.md,
stage new files, and validate with
nix flake check.
Den creates nixosConfigurations.myhost automatically. For additional host
attributes such as audio, network, printer, gamesLocation, and
gaming.environment, use the existing entries in modules/hosts.nix as examples.
- Create
modules/users/myuser/myuser.nixand select the aspects they need:
{ den, ... }:
{
den.aspects.myuser = {
includes = [
den.aspects.common
den.aspects.files
den.aspects.zsh
den.aspects.git
];
nixos.users.users.myuser.extraGroups = [ "audio" "video" ];
};
}- Assign the user in the relevant host entry in
modules/hosts.nix:
users.myuser = {
gitName = "My Name";
gitEmail = "me@example.com";
};- Stage new files and validate with
nix flake check.
Optional user attributes include avatar, logo, wallpaperRepository, and
emailAccounts. Email accounts can use plain address/userName values or
SOPS-backed addressSecret/userNameSecret references; see the
secret setup guide.
Create modules/<category>/<name>.nix defining den.aspects.<name>, then add it
to a user, host, or bundle's includes. Keep NixOS and Home Manager configuration
for the same feature in that file. Update this README when changing the structure
or included aspects.
Run on x86_64-linux, or use a compatible builder for Linux checks and builds:
nix flake check # Validate
nh os build # Build without activating
nh os switch # Deploy manually
nix flake update # Update locked inputs
treefmt # Format Nix filesAfter editing modules/flake-inputs.nix, regenerate flake.nix on Linux with
j write-flake. To run from a checkout before the global justfile is updated:
just --justfile assets/justfile write-flakeCache URLs and keys live in assets/nix/caches.nix. After changing them, run
j write-flake before building so the generated flake applies them during the
build. Both hosts accept flake settings through their NixOS configuration. The
first rebuild that installs this setting needs a one-time override:
NIX_CONFIG='accept-flake-config = true' nh os switchAfter that rebuild, later cache changes need only j write-flake before the
build. The setting accepts Nix configuration from every flake used on these
hosts.
If the checkout lives outside ~/nix, set the Home Manager option
dotfiles.checkoutPath. It controls build helpers and editable asset symlinks;
the global justfile also accepts a DOTFILES_CHECKOUT_PATH override.
Enable the formatting pre-commit hook once per clone:
git config --local core.hooksPath .githooksSee AGENTS.md for detailed agent guidance, framework patterns, and MCP setup. See secrets/README.md for key provisioning and SOPS.