refactor: code-review-improvements #47

Merged
onlyhavecans merged 2 commits from refactor/code-review-improvements into main 2025-10-25 10:36:57 -07:00
Owner
No description provided.
This refactoring addresses code review findings to improve maintainability,
readability, and follow modern Nix best practices.

## New Structure

- lib/default.nix: Helper library with getNixFiles function
- lib/nix-settings.nix: Shared Nix configuration for all platforms

## Changes

### DRY Improvements
- Extract shared Nix settings (binary caches, Lix config, trusted users)
  to lib/nix-settings.nix, eliminating 40+ lines of duplication
- Consolidate overlay management to single location in flake.nix
- Remove duplicate overlay application from nixos/nix.nix

### Consistency
- Use getNixFiles auto-import consistently in nixos/default.nix
- Centralize helper functions in lib/ directory
- Standardize module import patterns across the codebase

### Code Quality
- Add type validation to mkSystem with clear error messages
- Fix hardcoded nh flake path, now uses dynamic flakePath
- Remove unused forDarwinSystems helper function
- Fix unused _inputs parameter in overlays
- Remove redundant nix fmt from Justfile check task

### Documentation
- Add inline comments for host configurations
- Document platform detection logic in vars/default.nix
- Update CLAUDE.md with new lib/ directory structure
- Update README.md to reflect current architecture

## Impact

- Net reduction of 48 lines of code (-136 deleted, +88 added)
- Improved maintainability through DRY patterns
- Better type safety and error messages
- Consistent auto-import patterns
- All tests passing (lint, check, build validation)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
docs: fix system descriptions
All checks were successful
CI/CD Pipeline / Format Check (pull_request) Successful in 33s
CI/CD Pipeline / Linters (pull_request) Successful in 59s
CI/CD Pipeline / Flake Validation (pull_request) Successful in 2m20s
66c583eafa
onlyhavecans deleted branch refactor/code-review-improvements 2025-10-25 10:36:57 -07:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ops/nixos-skwrls!47
No description provided.