docs: add explanatory comments to global configurations

Add comprehensive inline documentation to both NixOS and Home Manager
global configuration files, explaining the purpose of each section,
overlay usage, unfree package policy, and configuration settings.
This commit is contained in:
♥ Minnie ♥ 2025-10-05 16:40:48 +08:00
parent 94221dbb56
commit 341d8ecf45
Signed by: jasmine
GPG key ID: 8563E358D4E8040E
2 changed files with 38 additions and 16 deletions

View file

@ -1,42 +1,53 @@
# Global Home Manager configuration for user sajenim.
# This module provides base user settings, nixpkgs configuration, and core imports
# that are inherited across all hosts where this user is configured.
{outputs, lib, ...}: {
imports = [
./zsh.nix
./zsh.nix # Shell configuration and plugins
];
# Nixpkgs configuration - applies overlays and sets package acceptance policy
nixpkgs = {
# Apply custom overlays to extend/modify the package set
overlays = [
outputs.overlays.additions
outputs.overlays.modifications
outputs.overlays.unstable-packages
outputs.overlays.additions # Custom packages from pkgs/
outputs.overlays.modifications # Package patches and modifications
outputs.overlays.unstable-packages # Unstable channel packages
];
config = {
# Default to free software only - unfree packages must be explicitly allowed
allowUnfree = false;
# Centralized unfree package allowlist.
# Centralized unfree package allowlist for Home Manager user configuration.
# Note: nixpkgs.config.allowUnfreePredicate doesn't merge across modules - only the
# last definition wins. To maintain explicit control over unfree packages, we list
# all allowed packages here rather than scattering predicates across feature modules.
allowUnfreePredicate = pkg:
builtins.elem (lib.getName pkg) [
# Editors
# Development tools
"claude-code"
"idea-ultimate"
"idea-ultimate-with-plugins"
# Desktop
"discord"
];
};
};
# Enable Home Manager to manage itself
programs.home-manager.enable = true;
# User identity and base configuration
home = {
username = "sajenim";
homeDirectory = "/home/sajenim";
sessionVariables = {
EDITOR = "nvim";
EDITOR = "nvim"; # Default text editor for CLI operations
};
};
# Automatically restart systemd user services on configuration changes
systemd.user.startServices = "sd-switch";
# Home Manager state version - don't change this after initial setup
home.stateVersion = "22.11";
}