Refactor: Extract platform-specific roles to base-linux and base-darwin

Create base-linux and base-darwin modules to cleanly separate platform-
specific role imports from shared roles. This prevents importing modules
that require platform-specific home-manager modules (like plasma-manager
on NixOS) in environments where they don't exist (like nix-darwin).

- base-linux includes: plasma-manager, i3+sway
- base-darwin includes: aerospace
- roles/default.nix now only contains truly cross-platform roles

This architecture makes it immediately clear which roles are shared
versus platform-specific and makes it easy to add new platform-specific
roles in the future.
This commit is contained in:
2025-12-02 15:16:42 -08:00
parent b9c48f9dd1
commit fe6558e0c1
8 changed files with 23 additions and 27 deletions

View File

@@ -1,30 +1,6 @@
{ config, lib, pkgs, globalInputs, system, ... }:
{
# Claude Code Package Override for Corporate Work Environment
#
# This overlay overrides the default claude-code package specifically for work environments
# where corporate network restrictions may prevent access to npm registry distributions.
#
# Context:
# - The default claude-code package (used in home environments) fetches from npm registry
# - Corporate firewalls and security policies often block npm registry access
# - Our custom claude-code package uses Google Cloud Storage distribution as a workaround
# - This maintains the same package name across environments while adapting to network constraints
#
# Environment-specific behavior:
# - Home environments: Use standard npm-distributed claude-code package
# - Work environments: Use custom binary-distributed claude-code package from GCS
#
# This approach ensures consistent tooling availability regardless of network environment
# while respecting corporate security policies.
nixpkgs.overlays = [
(final: prev: {
unstable = prev.unstable // {
claude-code = prev.custom.claude-code;
};
})
];
# Home Manager configuration for Darwin work laptop
# Corporate-friendly setup with essential development tools
@@ -140,5 +116,6 @@
imports = [
./roles
./roles/base-darwin
];
}

View File

@@ -29,5 +29,6 @@
imports = [
./roles
./roles/base-linux
];
}

View File

@@ -38,5 +38,6 @@
imports = [
./roles
./roles/base-linux
];
}

View File

@@ -30,6 +30,7 @@
imports = [
./roles
./roles/base-linux
];
# Live USB specific overrides can go here if needed

View File

@@ -30,6 +30,7 @@
imports = [
./roles
./roles/base-linux
];
# Media center specific overrides can go here if needed

View File

@@ -0,0 +1,7 @@
{
# Base imports for Darwin home configurations
# Includes Darwin-specific roles that only work on macOS
imports = [
../aerospace
];
}

View File

@@ -0,0 +1,8 @@
{
# Base imports for Linux home configurations
# Includes Linux-specific roles that require Linux-only home-manager modules
imports = [
../plasma-manager
../i3+sway
];
}

View File

@@ -1,4 +1,7 @@
{
# Shared roles that work across all platforms (Linux, Darwin, etc.)
# Platform-specific roles are imported via base-linux or base-darwin
# in each home configuration file
imports = [
./base
./communication
@@ -12,9 +15,6 @@
./office
./sync
./tmux
./plasma-manager
./emacs
./aerospace
./i3+sway
];
}