refactor(ssh): consolidate sshd enable and port 22 into modules/ssh.nix
The daemon enable and the firewall port were duplicated in each sshd host (T400, Mac Pro, RPi5). Move both into modules/ssh.nix so importing it both hardens and enables sshd; drop the per-host copies. No build change: the three hosts evaluate to identical derivations. Closes #51
This commit is contained in:
@@ -26,10 +26,8 @@
|
||||
# workstation.nix is the backstop).
|
||||
zramSwap.enable = true;
|
||||
|
||||
# This host accepts SSH, so open 22 (the firewall itself is enabled in
|
||||
# workstation.nix with a default-deny policy).
|
||||
services.openssh.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
# sshd (daemon, port 22, key-only policy) comes from ../../modules/ssh.nix;
|
||||
# the firewall itself is enabled in workstation.nix with a default-deny policy.
|
||||
|
||||
# Dual Harpertown Xeon microcode. Redistributable firmware (GPU/NIC blobs) is
|
||||
# enabled in workstation.nix.
|
||||
|
||||
@@ -25,15 +25,12 @@
|
||||
boot.loader.grub.enable = false;
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
|
||||
# Remote administration. Key-only policy and the authorized key come from
|
||||
# ../../modules/ssh.nix; here we just enable the daemon and open the port.
|
||||
services.openssh.enable = true;
|
||||
# Remote administration: the daemon, port 22 and key-only policy all come from
|
||||
# ../../modules/ssh.nix.
|
||||
|
||||
# Default-deny inbound. Open only SSH here; the Docker and nginx submodules
|
||||
# open their own ports (Docker via a source-restricted nftables rule, nginx
|
||||
# via 80/443). List-valued, so these merge with the submodule definitions.
|
||||
# Default-deny inbound; the Docker and nginx submodules open their own ports
|
||||
# (Docker via a source-restricted nftables rule, nginx via 80/443).
|
||||
networking.firewall.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
||||
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||
system.stateVersion = "26.05";
|
||||
|
||||
@@ -21,10 +21,8 @@
|
||||
# Low-RAM host (4 GiB max): a compressed RAM swap reduces disk paging.
|
||||
zramSwap.enable = true;
|
||||
|
||||
# This host accepts SSH, so open 22 (the firewall itself is enabled in
|
||||
# laptop.nix with a default-deny policy).
|
||||
services.openssh.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
# sshd (daemon, port 22, key-only policy) comes from ../../modules/ssh.nix;
|
||||
# the firewall itself is enabled in laptop.nix with a default-deny policy.
|
||||
|
||||
# Intel Core 2 (Penryn) microcode. Redistributable firmware (enabled in
|
||||
# workstation.nix) supplies the iwlwifi blobs (Intel WiFi Link 5100/5300) and
|
||||
|
||||
Reference in New Issue
Block a user