.git-crypt | ||
hosts | ||
lib | ||
modules | ||
profiles | ||
secrets | ||
system | ||
users/jeirmeister | ||
.gitattributes | ||
.gitignore | ||
.repo-to-text-settings.yaml | ||
flake.nix | ||
README.md | ||
repo_overview.txt |
NixOS Configuration Structure
This repository contains a NixOS configuration managed through a flake-driven approach. Each directory serves a specific purpose in the overall configuration structure.
Directory Structure Overview
flake.nix
The entry point and source of truth for the entire configuration. This file:
- Defines system configurations
- Sets up home-manager configurations
- Enables profiles
- Manages input sources
- Configures the Nix environment
lib/
Library functions and utilities that power the configuration system.
conds.nix
: Condition checking helpers for configuration logicdefault.nix
: Main library entry point that re-exports all functionsmkHome.nix
: Home-manager configuration buildermkHost.nix
: NixOS host configuration buildersecrets.nix
: Secret management helper functionsutils.nix
: General utility functions used throughout the configuration
profiles/
Profile definitions that enable specific sets of modules and configurations.
-
core/
: System-level profilesminimal.nix
: Basic system setupworkstation.nix
: Desktop/laptop configurationserver.nix
: Server-specific setup
-
home/
: Home-manager profilesdesktop.nix
: Desktop environment configurationdevelopment.nix
: Development tools and settingsgaming.nix
: Gaming-related configuration
Profiles are enabled through the flake.nix and determine which modules are activated.
modules/
Module definitions that implement actual functionality. Modules are enabled by profiles.
-
core/
: System-level modulesage.nix
: Age encryption setupdesktop.nix
: Desktop environment fundamentalsfilesystem.nix
: Filesystem configurationshome-manager.nix
: Home-manager integrationnetworking.nix
: Network configurationnix.nix
: Nix package manager settingssecurity/
: Security-related modulesuser.nix
: User managementxdg.nix
: XDG base directory support
-
home/
: Home-manager modulescomms/
: Communication toolsdevelopment/
: Development environmentsfirefox/
: Browser configurationmedia/
: Media applicationsterminal/
: Terminal emulatorstheme/
: Theming configurationvirtualization/
: Virtualization tools
system/
System-level configurations that are used by modules.
-
boot/
: Boot-related configurationsquietboot.nix
: Silent boot configurationsystemd-boot.nix
: Systemd-boot setup
-
desktop/
: Desktop environment configurationsappimage.nix
: AppImage supportplasma6.nix
: KDE Plasma 6 configuration
-
hardware/
: Hardware-specific settingsbluetooth.nix
: Bluetooth configurationhardware-acceleration.nix
: GPU accelerationqmk.nix
: QMK keyboard firmwarergb.nix
: RGB lighting control
-
locales/
: Language and locale settingsus-english.nix
: US English locale configuration
-
services/
: System servicesflatpak.nix
: Flatpak supportprinting.nix
: Printer configurationsunshine.nix
: Sunshine streamingsyncthing.nix
: Syncthing file synctailscale.nix
: Tailscale VPN
-
shell/
: Shell configurationsaliases.nix
: Shell aliasesatuin.nix
: Shell history databasezsh.nix
: Zsh configurationtmux.nix
: Tmux terminal multiplexer
secrets/
Secret management using age encryption.
encrypted/
: Encrypted secret filesidentities/
: Age identities for decryptionusers/
: User-specific secret configurations${username}/
: Per-user secret definitions
hosts/
Host-specific configurations created via mkHost.
${hostname}/
hardware-configuration.nix
: Hardware-specific settingsdefault.nix
: Host-specific overrides
users/
User-specific configurations created via mkHome.
${username}/
config/
: User-specific configurationsdotfiles/
: User dotfiles${hostname}.nix
: Host-specific user settings
pkgs/
Custom package definitions and overlays.
default.nix
: Entry point for custom packagesoverlays/
: Nixpkgs overlaysdefault.nix
: Main overlay entry pointmodifications/
: Modified existing packagescustom/
: Custom package definitionspatches/
: Package patches for existing packages
The pkgs directory serves several purposes:
- Define custom packages not available in nixpkgs
- Modify existing packages from nixpkgs
- Create overlays for system-wide package modifications
- Store patches for package modifications
Package definitions here can be used throughout the configuration by:
- Being imported through overlays in flake.nix
- Direct reference in module configurations
- Usage in home-manager configurations
- Integration with development environments
Configuration Flow
flake.nix
initiates configurationlib
functions build configurations- Profiles enable appropriate modules
- Modules implement functionality using system configurations
- Secrets are applied where needed
- Host-specific configurations override as needed
- User configurations are applied through home-manager
Important Notes
- Configurations should flow from the flake.nix
- Profiles should enable modules, not implement functionality
- Modules should be composable and configurable
- System configurations should be reusable
- Secrets should be managed through age/agenix
- Host configurations should only contain necessary overrides
- User configurations should be host-aware