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:
@@ -1,30 +1,6 @@
|
|||||||
{ config, lib, pkgs, globalInputs, system, ... }:
|
{ 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
|
# Home Manager configuration for Darwin work laptop
|
||||||
# Corporate-friendly setup with essential development tools
|
# Corporate-friendly setup with essential development tools
|
||||||
|
|
||||||
@@ -140,5 +116,6 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./roles
|
./roles
|
||||||
|
./roles/base-darwin
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,5 +29,6 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./roles
|
./roles
|
||||||
|
./roles/base-linux
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,5 +38,6 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./roles
|
./roles
|
||||||
|
./roles/base-linux
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./roles
|
./roles
|
||||||
|
./roles/base-linux
|
||||||
];
|
];
|
||||||
|
|
||||||
# Live USB specific overrides can go here if needed
|
# Live USB specific overrides can go here if needed
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
imports = [
|
imports = [
|
||||||
./roles
|
./roles
|
||||||
|
./roles/base-linux
|
||||||
];
|
];
|
||||||
|
|
||||||
# Media center specific overrides can go here if needed
|
# Media center specific overrides can go here if needed
|
||||||
|
|||||||
7
home/roles/base-darwin/default.nix
Normal file
7
home/roles/base-darwin/default.nix
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
# Base imports for Darwin home configurations
|
||||||
|
# Includes Darwin-specific roles that only work on macOS
|
||||||
|
imports = [
|
||||||
|
../aerospace
|
||||||
|
];
|
||||||
|
}
|
||||||
8
home/roles/base-linux/default.nix
Normal file
8
home/roles/base-linux/default.nix
Normal 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
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -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 = [
|
imports = [
|
||||||
./base
|
./base
|
||||||
./communication
|
./communication
|
||||||
@@ -12,9 +15,6 @@
|
|||||||
./office
|
./office
|
||||||
./sync
|
./sync
|
||||||
./tmux
|
./tmux
|
||||||
./plasma-manager
|
|
||||||
./emacs
|
./emacs
|
||||||
./aerospace
|
|
||||||
./i3+sway
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user