1.6 KiB
1.6 KiB
NixOS Configuration Layout
This repository is structured around explicit NixOS and Home Manager layers.
Directory Overview
nixos/hosts/<host>/- Host-specific
configuration.nixandhardware-configuration.nix.
- Host-specific
nixos/modules/- Shared NixOS modules:
base.nixprofiles/(workstation.nix,server.nix)wm/(sway.nix,gnome.nix)theme/(stylix.nix)
- Shared NixOS modules:
home/users/- User base modules (
alisceon,root).
- User base modules (
home/profiles/- Shared Home Manager profile composition.
home/modules/- Home Manager feature modules grouped by
programs/,services/, andwm/.
- Home Manager feature modules grouped by
home/hosts/alisceon/- Host-specific Home Manager overrides for
alisceon.
- Host-specific Home Manager overrides for
lib/- Shared helper libraries imported by modules.
util/- Local helper scripts.
Composition Rules
flake.nixis the single composition entrypoint for hosts.- NixOS host modules should import only host-local hardware config and rely on shared modules from
nixos/modules. - Home Manager host overrides should stay small and contain only host deltas.
- Reusable behavior belongs in
nixos/modulesorhome/modules, not in host files.
Local Validation
Run these in your normal environment:
nix flake show
nix eval .#nixosConfigurations.electra.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.tower.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.tesla-nixos.config.system.build.toplevel.drvPath
nix eval .#nixosConfigurations.nuc.config.system.build.toplevel.drvPath
nix flake check --no-build