This is a personal NixOS configuration repository managed as a flake, with multiple user profiles and desktop environments. The configuration uses home-manager for user-level management and is structured modularly for maintainability.
Multi-User Setup: The repository supports three user profiles defined in config-specifications.nix:
pro: Work profile (flo-pro) with Clever Cloud-specific toolsperso: Personal profile (flo-perso)perso-workstation: Personal workstation with gaming support
Desktop Environments: Configurations support multiple desktop environments (Plasma, GNOME, Cosmic, Niri) via modules/desktop-env/, with the current focus on Niri (scrollable-tiling Wayland compositor).
Module Structure: The modules/ directory contains:
default.nix: Entry point importing all module categorieshardware/: Hardware-specific configurations per machinesystem-config/: System-wide settings (boot, networking, i18n, sound, virtualization)user/: User account and home-manager configurationdesktop-env/: Desktop environment configurationspackages/: Application and tool configurationsdev-env.nix: Development environment servicessecurity.nix: Security and GPG settingssecrets.nix: Encrypted secrets (do not modify directly)
Configuration Pattern: User-specific settings use the currentUser special arg to dynamically adapt configurations. Desktop environments are conditionally imported via currentDesktop.
Package configurations in modules/packages/ follow a pattern:
- Enable the program via home-manager
- Link dotfiles from
dotfiles/directory usingmkOutOfStoreSymlinkfor mutable configs - Define extra packages needed by the tool
Common packages are defined in modules/packages/default.nix with user-specific overlays (e.g., proPackages for work tools).
The dotfiles/ directory contains actual configuration files for applications. These are symlinked into the user's home directory, allowing editing without rebuilding the system. Changes to these files take effect immediately or on application restart.
Rebuild system (applies changes from this repository):
# For the 'pro' profile
rebuild-pro
# For other profiles
rebuild-perso
rebuild-perso-workstation
# Manual rebuild (if aliases aren't available)
run0 nixos-rebuild switch --flake '/path/to/nixos-config#pro'Update flake inputs and rebuild:
upd-pro # Updates and rebuilds pro profile
upd-perso
upd-perso-workstation
# Manual approach
nix flake update --flake ~/.config/nixos-configClean old generations:
clean # System and user garbage collection (>7 days old)
# Manual approach
run0 nix-collect-garbage --delete-older-than 7d
nix-collect-garbage --delete-older-than 7dNavigate to config:
nxcfg # Alias for cd ~/.config/nixos-configCheck flake structure:
nix flake show
nix flake metadataTest configuration without applying:
nixos-rebuild dry-build --flake ~/.config/nixos-config#proFormat Nix files:
nixfmt **/*.nix- System-wide package: Add to
modules/packages/default.nixincommonPackagesor user-specific list - Package with configuration: Create
modules/packages/package-name.nix, add it to imports inmodules/packages/default.nix, and optionally add dotfiles todotfiles/package-name/ - Rebuild system to apply changes
For applications with dotfiles in dotfiles/ (Helix, Neovim, Zed, etc.):
- Edit the files directly in
dotfiles/ - Changes take effect immediately or on app restart (no rebuild needed)
For applications configured via Nix modules:
- Edit the corresponding
.nixfile inmodules/packages/ - Run
rebuild-<profile>to apply
- Create
modules/desktop-env/desktop-name.nix - Add the desktop to
config-specifications.nixindesktops - Import conditionally in
modules/desktop-env/default.nix - Update flake.nix to create a configuration with the new desktop
Secrets are managed in modules/secrets.nix. Do not edit this file directly. Use appropriate secret management tools (likely sops-nix based on the sops package being installed).
- User-specific behavior: Use
currentUser.name == specs.users.pro.namechecks withlib.mkIf - Conditional imports: Use
lib.optionalorlib.optionalsfor dynamic module loading - Shell aliases: Defined in
modules/user/shell-aliases.nixusing the home directory as a base - Symlinks for mutable configs: Use
config.lib.file.mkOutOfStoreSymlinkto link dotfiles
- One module per
.nixfile with clear naming - Dotfiles mirror application config structure
- Use
default.nixas aggregation points that import other modules - Keep hardware-specific configs in
modules/hardware/
- GPG signing is enabled for all commits (per-user keys in
config-specifications.nix) - Default branch is
main - Commits use histogram diff algorithm
- Difftool and mergetool are configured to use
nvim -c DiffviewOpen
Primary Editors: Zed (default for most file types), Neovim (terminal), Helix Terminal: Kitty (primary), with Ghostty and Warp also configured Shell: Fish (default), with Zsh, Nushell available Version Control: Git with Jujutsu (jj) also configured AI Tools: GitHub Copilot CLI, Claude Code, and Warp integrated
Zed has specialized rules in dotfiles/zed/rules/ for different interaction modes (ask, coding, debug) and project-level rules in .rules.
- This configuration targets
x86_64-linux - NixOS state version: 23.11 (do not change without reading documentation)
- French keyboard layout (AZERTY) is configured
- Wayland is the primary display protocol (
NIXOS_OZONE_WL = "1") - Auto-upgrade is disabled; updates are manual via
upd-aliases - Gaming support is conditionally enabled for
perso-workstationprofile