feat: Darwin support take two #23
No reviewers
Labels
No labels
bug
dependencies
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ops/nixos-skwrls!23
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "refactor/unified-system-builder"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Replace function-based pkgs/pkgsUnstable with clearer pkgsFor/pkgsUnstableFor naming convention to improve readability and make function calls unambiguous. Changes: - Rename to pkgsFor and pkgsUnstableFor (using "For" suffix convention) - Replace all `stablePkgs.${system}` with `pkgsFor system` (clearer function call) - Replace all `unstablePkgs.${system}` with `pkgsUnstableFor system` - Keep functions lean - only create package sets when needed Benefits: - Clear naming: "For" suffix indicates parameterization - Unambiguous syntax: `pkgsFor system` is clearly a function call - More efficient: Package sets created on-demand, not all upfront - Natural to read: "packages for this system" - Follows Nix conventions for parameterized functions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>Replace on-demand pkgsFor/pkgsUnstableFor functions with pre-instantiated stablePkgs/unstablePkgs attribute sets to leverage Nix's memoization. Changes: - Use nixpkgs.lib.genAttrs to pre-instantiate package sets for all systems - Replace all pkgsFor/pkgsUnstableFor calls with attribute access - Nix lazy evaluation memoizes each stablePkgs.${system} access Performance: - Before: nix flake show in 2.425s - After: nix flake show in 1.502s - Improvement: 38% faster evaluation (~0.9s saved) Benefits: - Package sets evaluated once per system, not per usage - Nix automatically memoizes attribute set values - Same clarity as before with stablePkgs.${system} syntax - Significant speedup for flake checks and evaluations 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>Replace three separate if-then-else statements in mkSystem with a single attribute set lookup pattern for cleaner, more maintainable code. Changes: - Create typeConfig attribute set with nixos/darwin configurations - Single lookup: typeConfig.${type} instead of 3x if-then-else - All type-specific config in one clear structure Benefits: - DRY: type condition checked once, not three times - Clarity: all differences between nixos/darwin in one place - Extensibility: easy to add new system types in future - Readability: declarative structure vs imperative conditionals Before: systemBuilder = if type == "nixos" then ... else ...; extraModules = if type == "nixos" then ... else ...; homeManagerModule = if type == "nixos" then ... else ...; After: typeConfig = { nixos = {...}; darwin = {...}; }.${type}; typeConfig.systemBuilder typeConfig.extraModules typeConfig.homeManagerModule 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>