refactor(home): consolidate host home modules under home/hosts

This commit is contained in:
Ryan Yin
2026-03-23 12:32:17 +08:00
parent cf7b5a5be7
commit 8207ccbdff
22 changed files with 59 additions and 47 deletions

View File

@@ -26,6 +26,9 @@ home/
│ │ └── ...
│ ├── editors/ # Linux-specific editors
│ └── ...
├── hosts/ # Host-specific home manager entry modules
│ ├── linux/ # Linux host home modules (ai, shoukei, k3s-*, etc.)
│ └── darwin/ # macOS host home modules (fern, frieren)
└── darwin/ # macOS-specific home manager configurations
├── aerospace/ # macOS window manager
├── proxy/ # Proxy configurations
@@ -46,3 +49,8 @@ home/
3. **darwin**: macOS-specific configuration
- macOS applications and services
- Platform-specific integrations (Aerospace, Squirrel, etc.)
4. **hosts**: Host entry modules for Home Manager
- Each output should reference only one host home module file
- Host modules are responsible for importing shared stacks (`home/linux/*` or `home/darwin`) and
applying host overrides

View File

@@ -1,4 +0,0 @@
{ mylib, ... }:
{
imports = mylib.scanPaths ./.;
}

17
home/hosts/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Host Home Modules
This directory contains host-specific Home Manager entry modules.
## Layout
- `home/hosts/linux/*.nix`: Linux host home modules
- `home/hosts/darwin/*.nix`: macOS host home modules
## Conventions
1. Each host output should reference only one file under `home/hosts/...`.
2. Shared home module imports should be handled in the host file itself.
- Linux hosts usually import `../../linux/core.nix` or `../../linux/gui.nix`.
- Darwin hosts import `../../darwin`.
3. Host-specific overrides (SSH keys, desktop toggles, host-local config links) live in the same
host file.

View File

@@ -3,6 +3,8 @@ let
hostName = "fern";
in
{
imports = [ ../../darwin ];
programs.ssh.matchBlocks."github.com".identityFile =
"${config.home.homeDirectory}/.ssh/${hostName}";
}

View File

@@ -3,6 +3,8 @@ let
hostName = "frieren";
in
{
imports = [ ../../darwin ];
programs.ssh.matchBlocks."github.com".identityFile =
"${config.home.homeDirectory}/.ssh/${hostName}";
}

View File

@@ -4,9 +4,13 @@ let
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
in
{
imports = [ ../../linux/gui.nix ];
programs.ssh.matchBlocks."github.com".identityFile =
"${config.home.homeDirectory}/.ssh/${hostName}";
modules.desktop.gaming.enable = false;
modules.desktop.niri.enable = true;
modules.desktop.nvidia.enable = false;
xdg.configFile."niri/niri-hardware.kdl".source =

View File

@@ -3,8 +3,12 @@ let
mkSymlink = config.lib.file.mkOutOfStoreSymlink;
in
{
imports = [ ../../linux/gui.nix ];
programs.ssh.matchBlocks."github.com".identityFile = "${config.home.homeDirectory}/.ssh/idols-ai";
modules.desktop.gaming.enable = true;
modules.desktop.niri.enable = true;
modules.desktop.nvidia.enable = true;
xdg.configFile."niri/niri-hardware.kdl".source =

View File

@@ -0,0 +1,3 @@
{
imports = [ ../../linux/core.nix ];
}

View File

@@ -0,0 +1,3 @@
{
imports = [ ../../linux/core.nix ];
}