Feat/audit improvements #24

Merged
lyrathorpe merged 11 commits from feat/audit-improvements into main 2026-06-10 17:08:25 +01:00
4 changed files with 37 additions and 2 deletions
Showing only changes of commit d172157101 - Show all commits
@@ -22,6 +22,10 @@
networking.hostName = "MacPro31-NixOS"; networking.hostName = "MacPro31-NixOS";
# Elderly host: a compressed RAM swap softens memory pressure (earlyoom in
# workstation.nix is the backstop).
zramSwap.enable = true;
# This host accepts SSH, so open 22 (the firewall itself is enabled in # This host accepts SSH, so open 22 (the firewall itself is enabled in
# workstation.nix with a default-deny policy). # workstation.nix with a default-deny policy).
services.openssh.enable = true; services.openssh.enable = true;
+11 -1
View File
@@ -1,7 +1,7 @@
# ThinkPad T400 (NixOS). Shared laptop options live in ../../modules/laptop.nix; # ThinkPad T400 (NixOS). Shared laptop options live in ../../modules/laptop.nix;
# only host-specific settings are here. Install notes (boot variants, GPU, # only host-specific settings are here. Install notes (boot variants, GPU,
# partitions): see ./README.md. # partitions): see ./README.md.
{ ... }: { config, ... }:
{ {
imports = [ imports = [
@@ -31,6 +31,16 @@
# the radeon firmware needed by the discrete GPU below. # the radeon firmware needed by the discrete GPU below.
hardware.cpu.intel.updateMicrocode = true; hardware.cpu.intel.updateMicrocode = true;
# Battery longevity: cap charging to 75-80%. tlp itself comes from the
# nixos-hardware lenovo-thinkpad profile; tp_smapi supplies the threshold
# sysfs on this 2008-era ThinkPad (kernel-native natacpi is too new for it).
boot.kernelModules = [ "tp_smapi" ];
boot.extraModulePackages = [ config.boot.kernelPackages.tp_smapi ];
services.tlp.settings = {
START_CHARGE_THRESH_BAT0 = 75;
STOP_CHARGE_THRESH_BAT0 = 80;
};
# This T400 has the optional discrete GPU fitted: an ATI Mobility Radeon HD # This T400 has the optional discrete GPU fitted: an ATI Mobility Radeon HD
# 3470 (RV620), driven by the open `radeon` KMS driver. Load it in the initrd # 3470 (RV620), driven by the open `radeon` KMS driver. Load it in the initrd
# for early modesetting (clean Sway/Wayland start); firmware comes from # for early modesetting (clean Sway/Wayland start); firmware comes from
+9
View File
@@ -12,4 +12,13 @@
enable = true; enable = true;
settings.General.EnableNetworkConfiguration = true; settings.General.EnableNetworkConfiguration = true;
}; };
# Bluetooth. The Asahi MBP loads Apple's BT firmware (see its host config) and
# the T400 has an optional BT module; enable bluez on both, with blueman as the
# GUI/tray manager for the Sway session.
hardware.bluetooth = {
enable = true;
powerOnBoot = true;
};
services.blueman.enable = true;
} }
+13 -1
View File
@@ -5,12 +5,16 @@
# The bootloader is NOT set here -- it is firmware-specific, not form-factor: # The bootloader is NOT set here -- it is firmware-specific, not form-factor:
# UEFI hosts (MBP, Mac Pro 3,1) use systemd-boot, the BIOS-only T400 uses GRUB. # UEFI hosts (MBP, Mac Pro 3,1) use systemd-boot, the BIOS-only T400 uses GRUB.
# Each machine config declares its own. # Each machine config declares its own.
{ ... }: { lib, pkgs, ... }:
{ {
features.swayDesktop.enable = true; features.swayDesktop.enable = true;
console.keyMap = "dvorak"; console.keyMap = "dvorak";
# Intel thermal management. x86 only -- the Asahi MBP governs its own SoC
# thermals, and thermald is an Intel-platform daemon.
services.thermald.enable = lib.mkIf pkgs.stdenv.hostPlatform.isx86_64 true;
# Default-deny inbound. Hosts that run a listening service open their own # 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). # ports next to where the service is enabled (e.g. sshd -> 22 on X1).
networking.firewall.enable = true; networking.firewall.enable = true;
@@ -20,6 +24,14 @@
services.fstrim.enable = true; services.fstrim.enable = true;
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
# Userspace OOM killer: act on memory pressure early instead of letting the
# kernel OOM-thrash. Matters on the 4 GiB T400 and the elderly Mac Pro.
services.earlyoom.enable = true;
# Firmware updates via LVFS. No-op on the Asahi MBP (Apple-managed firmware),
# useful for UEFI/SSD updates on the x86 hosts.
services.fwupd.enable = true;
# Audio. PipeWire with the PulseAudio shim covers every graphical host; no # Audio. PipeWire with the PulseAudio shim covers every graphical host; no
# per-machine audio config is needed. # per-machine audio config is needed.
services.pipewire = { services.pipewire = {