refactor(nixos): extract workstation.nix base from laptop.nix

Move the form-factor-agnostic settings (systemd-boot, swayDesktop, dvorak
console, firewall) into a shared workstation.nix so laptop.nix and the new
desktop.nix can both import them without drifting. laptop.nix keeps only the
iwd Wi-Fi backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Emma Thorpe
2026-06-04 13:57:44 +00:00
parent 85139ddfb1
commit 0227f9d3ef
2 changed files with 21 additions and 12 deletions
+6 -12
View File
@@ -1,21 +1,15 @@
# Shared configuration for the physical NixOS laptops (X1, MBP-Asahi). Imported
# from the host table in flake.nix. Platform-specific bits (bootloader EFI var
# touching, firmware, audio, hostname, sshd) stay in the per-machine configs.
# Portable NixOS hosts (X1, MBP-Asahi). Imported from the host table in
# flake.nix. Shared graphical-workstation settings live in ./workstation.nix;
# the only laptop-specific bit is the Wi-Fi backend. Mobile home-manager
# components (battery block, brightness keys) are gated by the `portable` flag
# threaded through mkHost -- see lyrathorpe/home/sway.nix.
{ ... }:
{
boot.loader.systemd-boot.enable = true;
features.swayDesktop.enable = true;
console.keyMap = "dvorak";
imports = [ ./workstation.nix ];
# Wi-Fi via iwd with its built-in DHCP/network configuration.
networking.wireless.iwd = {
enable = true;
settings.General.EnableNetworkConfiguration = true;
};
# Default-deny inbound. Hosts that run a listening service open their own
# ports next to where the service is enabled (e.g. sshd -> 22 on X1).
networking.firewall.enable = true;
}
+15
View File
@@ -0,0 +1,15 @@
# Form-factor-agnostic base for the physical graphical NixOS machines. Imported
# by both ./laptop.nix and ./desktop.nix; those add only the bits that differ
# between portable and desktop hosts (chiefly the networking backend).
{ ... }:
{
boot.loader.systemd-boot.enable = true;
features.swayDesktop.enable = true;
console.keyMap = "dvorak";
# Default-deny inbound. Hosts that run a listening service open their own
# ports next to where the service is enabled (e.g. sshd -> 22 on X1).
networking.firewall.enable = true;
}