diff --git a/flake.nix b/flake.nix index 2b597c93..9d5026d0 100644 --- a/flake.nix +++ b/flake.nix @@ -126,6 +126,12 @@ hostname = "Stroma"; username = "corey"; }; + + lobtop = mkDarwinHost { + hostname = "LOB-MG2QJH49W7"; + username = "corey.johns"; + configDir = "lobtop"; + }; }; deploy = { diff --git a/home/programs/starship.nix b/home/programs/starship.nix index 72738fb7..59d5c89c 100644 --- a/home/programs/starship.nix +++ b/home/programs/starship.nix @@ -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"; diff --git a/hosts/lobtop/default.nix b/hosts/lobtop/default.nix new file mode 100644 index 00000000..adce4393 --- /dev/null +++ b/hosts/lobtop/default.nix @@ -0,0 +1,14 @@ +_: { + imports = [ + ./dock.nix + ./hardware.nix + ./programs.nix + ]; + + rc.darwin.defaults = { + fonts = true; + homebrew = true; + security = true; + system = true; + }; +} diff --git a/hosts/lobtop/dock.nix b/hosts/lobtop/dock.nix new file mode 100644 index 00000000..3cc17af7 --- /dev/null +++ b/hosts/lobtop/dock.nix @@ -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" + ]; + }; +} diff --git a/hosts/lobtop/hardware.nix b/hosts/lobtop/hardware.nix new file mode 100644 index 00000000..0f78fc41 --- /dev/null +++ b/hosts/lobtop/hardware.nix @@ -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"; +} diff --git a/hosts/lobtop/key.pub b/hosts/lobtop/key.pub new file mode 100644 index 00000000..ce1a6e33 --- /dev/null +++ b/hosts/lobtop/key.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOXjSJpXPnmfSS87TTtN2a+VM/jBQav5JRe5GaBz75gC corey.johns@lobtop diff --git a/hosts/lobtop/programs.nix b/hosts/lobtop/programs.nix new file mode 100644 index 00000000..75e8f9e7 --- /dev/null +++ b/hosts/lobtop/programs.nix @@ -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; + }; +} diff --git a/justfile b/justfile index b5d27bf0..fa2116b3 100644 --- a/justfile +++ b/justfile @@ -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: diff --git a/lib/hosts.nix b/lib/hosts.nix index 89e6940b..11259bb4 100644 --- a/lib/hosts.nix +++ b/lib/hosts.nix @@ -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 @@ -57,6 +58,7 @@ inputs @ { system, username, lightweight ? false, + configDir ? hostname, }: nixpkgs.lib.nixosSystem { inherit system; @@ -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; }) { @@ -90,6 +92,7 @@ inputs @ { hostname, username, lightweight ? false, + configDir ? hostname, }: let system = "aarch64-darwin"; in @@ -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; }) { diff --git a/lib/keys.nix b/lib/keys.nix index 657ed7f7..2e24af77 100644 --- a/lib/keys.nix +++ b/lib/keys.nix @@ -8,6 +8,7 @@ let value = readKey h; }) [ "glyph" + "lobtop" "Rhizome" "spore" "Stroma" diff --git a/modules/nixos/ssh.nix b/modules/nixos/ssh.nix index dac23282..71b745b4 100644 --- a/modules/nixos/ssh.nix +++ b/modules/nixos/ssh.nix @@ -16,6 +16,7 @@ keys.Rhizome keys.glyph keys.Stroma + keys.lobtop ]; security.pam.sshAgentAuth.authorizedKeysFiles = lib.mkForce ["/etc/ssh/authorized_keys.d/%u"];