[nixos-configs-ek5] Consolidate flake overlay configurations #21

Merged
johno merged 1 commits from bead/nixos-configs-ek5 into main 2026-01-10 13:16:00 -08:00
Owner

Summary

  • Extract duplicated overlay configuration into mkBaseOverlay function that accepts optional unstableOverlays parameter
  • Extract duplicated home-manager configuration into mkHomeManagerConfig function that accepts sharedModules parameter
  • Reduce code from 66 lines to 47 lines while preserving all functionality
  • Makes it easier to add new platform configurations in the future

Changes

The overlay configuration was repeated 3 times in flake.nix (nixosModules, nixosModulesUnstable, darwinModules). This PR extracts common patterns into two factory functions:

mkBaseOverlay: Creates the standard overlay with:

  • unstable package set from nixpkgs-unstable
  • custom packages from ./packages
  • bitwarden-desktop compatibility alias

mkHomeManagerConfig: Creates home-manager configuration with:

  • useGlobalPkgs and useUserPackages enabled
  • doom-emacs module always included
  • configurable sharedModules for platform-specific modules (e.g., plasma-manager)

Test plan

  • Verified flake evaluates correctly with nix eval .#nixosConfigurations.nix-book.config.system.stateVersion
  • Confirmed pre-existing flake check errors (live-usb fontconfig) are unchanged from main branch

Implements bead: nixos-configs-ek5

## Summary - Extract duplicated overlay configuration into `mkBaseOverlay` function that accepts optional `unstableOverlays` parameter - Extract duplicated home-manager configuration into `mkHomeManagerConfig` function that accepts `sharedModules` parameter - Reduce code from 66 lines to 47 lines while preserving all functionality - Makes it easier to add new platform configurations in the future ## Changes The overlay configuration was repeated 3 times in flake.nix (nixosModules, nixosModulesUnstable, darwinModules). This PR extracts common patterns into two factory functions: **mkBaseOverlay**: Creates the standard overlay with: - `unstable` package set from nixpkgs-unstable - `custom` packages from ./packages - `bitwarden-desktop` compatibility alias **mkHomeManagerConfig**: Creates home-manager configuration with: - `useGlobalPkgs` and `useUserPackages` enabled - doom-emacs module always included - configurable `sharedModules` for platform-specific modules (e.g., plasma-manager) ## Test plan - [x] Verified flake evaluates correctly with `nix eval .#nixosConfigurations.nix-book.config.system.stateVersion` - [x] Confirmed pre-existing flake check errors (live-usb fontconfig) are unchanged from main branch Implements bead: nixos-configs-ek5
johno added 1 commit 2026-01-10 13:11:02 -08:00
Extract duplicated overlay and home-manager configuration code into two
reusable factory functions:

- mkBaseOverlay: Creates the base overlay with unstable pkgs, custom
  packages, and bitwarden-desktop compatibility. Accepts optional
  unstableOverlays parameter for darwin-specific customizations.

- mkHomeManagerConfig: Creates home-manager configuration with shared
  settings (useGlobalPkgs, useUserPackages, doom-emacs module). Accepts
  sharedModules parameter for platform-specific modules like plasma-manager.

This reduces code duplication across nixosModules, nixosModulesUnstable,
and darwinModules, making the flake easier to maintain and extend.

Implements bead: nixos-configs-ek5
johno merged commit bbcb13881f into main 2026-01-10 13:16:00 -08:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: johno/nixos-configs#21