✨ A modular NixOS configuration with Flakes support ❄️ Snowflake-inspired infrastructure for your systems
- NixOS 26.05 (Warbler) or newer
- Flakes enabled in
/etc/nixos/configuration.nix:{ nix.settings.experimental-features = [ "nix-command" "flakes" ]; }
# Generate hardware configuration
sudo rm -rf /etc/nixos/*; sudo nixos-generate-config
# Build and activate configuration
sudo nixos-rebuild switch --flake .#$(hostname) --impurenixcfg/
├── flake.nix # ❄️ Flakes entry point + unstable overlay
├── profiles/ # 🧩 Modular system profiles
│ ├── core/ # 🖥️ Base system: locale, kernel, nix, network, firewall
│ └── user/ # 👤 User roles (multi-user ready)
│ └── ponfertato/ # 👤 Current user profile
│ ├── default.nix # Account, packages, git, aliases, services
│ ├── firefox/ # 🦊 Firefox configuration
│ │ ├── policies.nix # 🛡️ Enterprise policies (tracking, search)
│ │ └── preferences.nix # ⚙️ about:config tweaks
│ └── thunderbird/ # 📨 Thunderbird configuration
│ ├── policies.nix # 🛡️ Enterprise policies
│ └── preferences.nix # ⚙️ UI and composition
├── hosts/ # 🖥️ Host-specific configs (desktop + hardware + packages)
│ ├── potatoWork/ # 💻 Intel workstation (WoL, anydesk, mattermost)
│ │ └── default.nix
│ └── potatoLaptop/ # 💻 AMD laptop (Bluetooth, Steam, heroic)
│ └── default.nix
└── modules/ # 🧩 Reusable NixOS modules
├── docker.nix # 🐳 Docker configuration
├── flatpak.nix # 📦 Flatpak + auto Flathub setup
├── ollama.nix # 🤖 Ollama service
└── waydroid.nix # 📱 Waydroid configuration
nix-switchnix-updatenix-update && nix-check && nix-switchnix-rollnix-gc # Delete old generations + optimise store
nix-clean # Optimise store only (keeps generations)nix-check # Run `nix flake check` without applying# Update flake inputs
nix flake update
# Rebuild and activate with hardware config regeneration
sudo nixos-generate-config && sudo nixos-rebuild switch --flake .#$(hostname) --impurenix search nixpkgs <package> # in stable (nixos-26.05)
nix search nixpkgs-unstable <package> # in unstable- 🔄 Automatic Updates: Weekly GC and auto-upgrade
- 🧩 Modular Design:
coreprofile + per-user profile + per-host customization - 💻 Multi-Host Support: Shared user profile across
potatoWorkandpotatoLaptop - 🛡️ Reproducible Builds: Fully declarative configuration with Flakes
- ⚙️ Optimized Nix Settings: Yandex mirror + custom substituters for faster builds
- 🔥 Unstable Overlay: Access
pkgs.unstable.*without extra args - 🦊 Browser Hardening: Firefox and Thunderbird configured via enterprise policies + preferences
- 🖥️ Desktop Integration: KDE Plasma 6, Wayland, Pipewire, Flatpak, Docker
- Add
profiles/new-profile/directory. - Create
profiles/new-profile/default.nixcontaining the NixOS module. - Import the profile in
flake.nixfor the desired host configuration.
- Add
profiles/user/<username>/directory. - Create
default.nixwith user settings (account, packages, programs). - Split large configs into subfolders (e.g.
firefox/,thunderbird/) and import them. - Import the user profile in
hosts/<hostname>/default.nix.
- Add
modules/new-module.nix. - Import the module in
flake.nixfor the desired host configuration.
- Add
hosts/<hostname>/default.nix. - Import the desired user profile:
imports = [ ../../profiles/user/ponfertato ]; - Register it in
flake.nixundernixosConfigurations. - Point
cpuModuleto the appropriatenixos-hardwaremodule.
- Hardware-specific settings (kernel, CPU microcode, graphics drivers) are managed separately in
/etc/nixos/hardware-configuration.nix. - This file is typically generated by
nixos-generate-configand can be manually edited or supplemented withnixos-hardwaremodules if needed. - The configuration is included in
flake.nixvia--impureto allow per-machine regeneration.