Skip to content
6 changes: 6 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@
hostname = "Stroma";
username = "corey";
};

lobtop = mkDarwinHost {
hostname = "LOB-MG2QJH49W7";
username = "corey.johns";
configDir = "lobtop";
};
};

deploy = {
Expand Down
3 changes: 3 additions & 0 deletions home/programs/starship.nix
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@
format = "[@$hostname ]($style)";
style = "bg:color_orange fg:color_fg0";
disabled = false;
aliases = {
"LOB-MG2QJH49W7" = "lobtop";
};
};
directory = {
style = "fg:color_fg0 bg:color_yellow";
Expand Down
14 changes: 14 additions & 0 deletions hosts/lobtop/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
_: {
imports = [
./dock.nix
./hardware.nix
./programs.nix
];

rc.darwin.defaults = {
fonts = true;
homebrew = true;
security = true;
system = true;
};
}
20 changes: 20 additions & 0 deletions hosts/lobtop/dock.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
_: {
system.defaults.dock = {
tilesize = 42;
largesize = 86;
persistent-apps = [
"/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app"
"/System/Applications/Mail.app"
"/Applications/Zed.app"
"/Applications/rootshell.app"
"/Applications/Reeder.app"
"/System/Applications/Calendar.app"
"/System/Applications/Reminders.app"
"/System/Applications/Notes.app"
"/Applications/Things.app"
"/Applications/Craft.app"
"/System/Applications/Messages.app"
"/Applications/Slack.app"
];
};
}
11 changes: 11 additions & 0 deletions hosts/lobtop/hardware.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
_: {
users.users."corey.johns" = {
home = "/Users/corey.johns";
};
system.primaryUser = "corey.johns";

networking.hostName = "LOB-MG2QJH49W7";

system.stateVersion = 5;
nixpkgs.hostPlatform = "aarch64-darwin";
}
1 change: 1 addition & 0 deletions hosts/lobtop/key.pub
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXjSJpXPnmfSS87TTtN2a+VM/jBQav5JRe5GaBz75gC corey.johns@lobtop
18 changes: 18 additions & 0 deletions hosts/lobtop/programs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{pkgs, ...}: {
environment.systemPackages = with pkgs; [
m-cli
mas
the-unarchiver
];

homebrew = {
enable = true;
# N.B.: Removed entries in `masApps` require manual uninstallation
masApps = {
};
};

programs.craft = {
enable = true;
};
}
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Build the system config and switch to it when running `just` with no args
default: switch

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

[macos]
switch host=hostname:
Expand Down
13 changes: 8 additions & 5 deletions lib/hosts.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,14 @@ inputs @ {
mkHomeManager = {
username,
hostname,
configDir,
system,
showBatteryStatus,
lightweight ? false,
}: let
pkgs-stable-25-11 = import nixpkgs-stable-25-11 {inherit system;};
pkgs-stable-24-05 = import nixpkgs-stable-24-05 {inherit system;};
hostHomePath = ./../hosts/${hostname}/home.nix;
hostHomePath = ./../hosts/${configDir}/home.nix;
hostHomeConfig =
if builtins.pathExists hostHomePath
then hostHomePath
Expand Down Expand Up @@ -57,6 +58,7 @@ inputs @ {
system,
username,
lightweight ? false,
configDir ? hostname,
}:
nixpkgs.lib.nixosSystem {
inherit system;
Expand All @@ -70,11 +72,11 @@ inputs @ {
disko.nixosModules.disko
./../modules/base
./../modules/nixos
./../hosts/${hostname}
./../hosts/${configDir}
agenix.nixosModules.default
home-manager.nixosModules.home-manager
(mkHomeManager {
inherit username hostname system lightweight;
inherit username hostname system lightweight configDir;
showBatteryStatus = false;
})
{
Expand All @@ -90,6 +92,7 @@ inputs @ {
hostname,
username,
lightweight ? false,
configDir ? hostname,
}: let
system = "aarch64-darwin";
in
Expand All @@ -105,10 +108,10 @@ inputs @ {
nix-homebrew.darwinModules.nix-homebrew
./../modules/base
./../modules/darwin
./../hosts/${hostname}
./../hosts/${configDir}
home-manager.darwinModules.home-manager
(mkHomeManager {
inherit username hostname system lightweight;
inherit username hostname system lightweight configDir;
showBatteryStatus = true;
})
{
Expand Down
1 change: 1 addition & 0 deletions lib/keys.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ let
value = readKey h;
}) [
"glyph"
"lobtop"
"Rhizome"
"spore"
"Stroma"
Expand Down
1 change: 1 addition & 0 deletions modules/nixos/ssh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
keys.Rhizome
keys.glyph
keys.Stroma
keys.lobtop
];

security.pam.sshAgentAuth.authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];
Expand Down
Loading