From 8bf98661f4bdf63568ecf27afd205c6d8fe4602b Mon Sep 17 00:00:00 2001 From: Emery Hemingway Date: Tue, 23 Feb 2016 18:32:53 +0100 Subject: add hardware-notes module for documentation Fixes #3 --- lib/hardware-notes.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ supermicro/a1sri-2758f.nix | 20 +++++++++++++++++--- 2 files changed, 62 insertions(+), 3 deletions(-) create mode 100644 lib/hardware-notes.nix diff --git a/lib/hardware-notes.nix b/lib/hardware-notes.nix new file mode 100644 index 0000000..4414ea3 --- /dev/null +++ b/lib/hardware-notes.nix @@ -0,0 +1,45 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + # use tail recursion to prevent whitespace padding + mkLog = list: + let + head = builtins.head list; + tail = builtins.tail list; + in + '' + # ${head.title} + ${head.text}${if tail == [] then "" else "\n\n${mkLog tail}"} + ''; +in + +{ + + options = { + hardwareNotes = mkOption { + internal = true; + type = types.listOf types.optionSet; + options = { + title = mkOption { + type = types.str; + example = "Thunkpad-2000: increase self-destruct timeout"; + }; + text = mkOption { + type = types.str; + example = + '' + Increase security timeout at boot using platform managment + tool to prevent premature data loss. + ''; + }; + }; + }; + }; + + config = { + environment.etc."hardware-notes".text = mkLog config.hardwareNotes; + }; + +} diff --git a/supermicro/a1sri-2758f.nix b/supermicro/a1sri-2758f.nix index 3471704..b199bf1 100644 --- a/supermicro/a1sri-2758f.nix +++ b/supermicro/a1sri-2758f.nix @@ -6,11 +6,25 @@ { pkgs, ... }: { + imports = [ ../lib/hardware-notes.nix ]; + environment.systemPackages = [ pkgs.ipmitool ]; boot.kernelModules = [ "ipmi_devintf" "ipmi_si" ]; - # The Linux NIC driver seems to have faulty link state reporting - # that causes dhcpcd to release every few seconds, which is - # more annoying than not releasing when a cable is unplugged. networking.dhcpcd.extraConfig = "nolink"; + + hardwareNotes = + [ { title = "IPMI"; + text = "Load IPMI kernel modules and ipmitool to system environment."; + } + { title = "Nolink"; + text = + '' + Interface link state detection is disabled in dhcpcd because + the Linux driver seems to send erronous loss of link messages + that cause dhcpcd to release every few seconds, which is + more annoying than not releasing when a cable is unplugged. + ''; + } + ]; } -- cgit v1.2.3