Skip to content

Commit e26b398

Browse files
stackptrclaude
andauthored
feat: add lobtop darwin host (#460)
* feat: add lobtop darwin host Adds a new macOS host for the work laptop (LOB-MG2QJH49W7), configured under hosts/lobtop and registered as darwinConfigurations.lobtop. Also adds a configDir parameter to mkDarwinHost (and mkNixosHost for consistency) so the flake key and config directory can differ from the actual system hostname. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: register lobtop SSH key Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: authorize lobtop key for mu SSH access Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * chore: drop unused args in lobtop host files Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: map LOB-* hostname to lobtop in prompt and justfile Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: update dock items * chore: update primaryUser * chore: update username * fix: update primaryUser and home dir for corey.johns username Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix: update Things path * feat: enable Craft * fix: lowercase alias --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 70c4402 commit e26b398

11 files changed

Lines changed: 85 additions & 6 deletions

File tree

flake.nix

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
hostname = "Stroma";
127127
username = "corey";
128128
};
129+
130+
lobtop = mkDarwinHost {
131+
hostname = "LOB-MG2QJH49W7";
132+
username = "corey.johns";
133+
configDir = "lobtop";
134+
};
129135
};
130136

131137
deploy = {

home/programs/starship.nix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@
8787
format = "[@$hostname ]($style)";
8888
style = "bg:color_orange fg:color_fg0";
8989
disabled = false;
90+
aliases = {
91+
"LOB-MG2QJH49W7" = "lobtop";
92+
};
9093
};
9194
directory = {
9295
style = "fg:color_fg0 bg:color_yellow";

hosts/lobtop/default.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
_: {
2+
imports = [
3+
./dock.nix
4+
./hardware.nix
5+
./programs.nix
6+
];
7+
8+
rc.darwin.defaults = {
9+
fonts = true;
10+
homebrew = true;
11+
security = true;
12+
system = true;
13+
};
14+
}

hosts/lobtop/dock.nix

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
_: {
2+
system.defaults.dock = {
3+
tilesize = 42;
4+
largesize = 86;
5+
persistent-apps = [
6+
"/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app"
7+
"/System/Applications/Mail.app"
8+
"/Applications/Zed.app"
9+
"/Applications/rootshell.app"
10+
"/Applications/Reeder.app"
11+
"/System/Applications/Calendar.app"
12+
"/System/Applications/Reminders.app"
13+
"/System/Applications/Notes.app"
14+
"/Applications/Things.app"
15+
"/Applications/Craft.app"
16+
"/System/Applications/Messages.app"
17+
"/Applications/Slack.app"
18+
];
19+
};
20+
}

hosts/lobtop/hardware.nix

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
_: {
2+
users.users."corey.johns" = {
3+
home = "/Users/corey.johns";
4+
};
5+
system.primaryUser = "corey.johns";
6+
7+
networking.hostName = "LOB-MG2QJH49W7";
8+
9+
system.stateVersion = 5;
10+
nixpkgs.hostPlatform = "aarch64-darwin";
11+
}

hosts/lobtop/key.pub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXjSJpXPnmfSS87TTtN2a+VM/jBQav5JRe5GaBz75gC corey.johns@lobtop

hosts/lobtop/programs.nix

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{pkgs, ...}: {
2+
environment.systemPackages = with pkgs; [
3+
m-cli
4+
mas
5+
the-unarchiver
6+
];
7+
8+
homebrew = {
9+
enable = true;
10+
# N.B.: Removed entries in `masApps` require manual uninstallation
11+
masApps = {
12+
};
13+
};
14+
15+
programs.craft = {
16+
enable = true;
17+
};
18+
}

justfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Build the system config and switch to it when running `just` with no args
22
default: switch
33

4-
hostname := `hostname | cut -d "." -f 1`
4+
# Substitute work laptop hostname if necessary
5+
hostname := `h=$(hostname | cut -d "." -f 1); case "$h" in LOB-*) echo "lobtop";; *) echo "$h";; esac`
56

67
[macos]
78
switch host=hostname:

lib/hosts.nix

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,14 @@ inputs @ {
2323
mkHomeManager = {
2424
username,
2525
hostname,
26+
configDir,
2627
system,
2728
showBatteryStatus,
2829
lightweight ? false,
2930
}: let
3031
pkgs-stable-25-11 = import nixpkgs-stable-25-11 {inherit system;};
3132
pkgs-stable-24-05 = import nixpkgs-stable-24-05 {inherit system;};
32-
hostHomePath = ./../hosts/${hostname}/home.nix;
33+
hostHomePath = ./../hosts/${configDir}/home.nix;
3334
hostHomeConfig =
3435
if builtins.pathExists hostHomePath
3536
then hostHomePath
@@ -57,6 +58,7 @@ inputs @ {
5758
system,
5859
username,
5960
lightweight ? false,
61+
configDir ? hostname,
6062
}:
6163
nixpkgs.lib.nixosSystem {
6264
inherit system;
@@ -70,11 +72,11 @@ inputs @ {
7072
disko.nixosModules.disko
7173
./../modules/base
7274
./../modules/nixos
73-
./../hosts/${hostname}
75+
./../hosts/${configDir}
7476
agenix.nixosModules.default
7577
home-manager.nixosModules.home-manager
7678
(mkHomeManager {
77-
inherit username hostname system lightweight;
79+
inherit username hostname system lightweight configDir;
7880
showBatteryStatus = false;
7981
})
8082
{
@@ -90,6 +92,7 @@ inputs @ {
9092
hostname,
9193
username,
9294
lightweight ? false,
95+
configDir ? hostname,
9396
}: let
9497
system = "aarch64-darwin";
9598
in
@@ -105,10 +108,10 @@ inputs @ {
105108
nix-homebrew.darwinModules.nix-homebrew
106109
./../modules/base
107110
./../modules/darwin
108-
./../hosts/${hostname}
111+
./../hosts/${configDir}
109112
home-manager.darwinModules.home-manager
110113
(mkHomeManager {
111-
inherit username hostname system lightweight;
114+
inherit username hostname system lightweight configDir;
112115
showBatteryStatus = true;
113116
})
114117
{

lib/keys.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ let
88
value = readKey h;
99
}) [
1010
"glyph"
11+
"lobtop"
1112
"Rhizome"
1213
"spore"
1314
"Stroma"

0 commit comments

Comments
 (0)