diff --git a/lib/hardware-notes.nix b/lib/hardware-notes.nix deleted file mode 100644 index 4414ea3..0000000 --- a/lib/hardware-notes.nix +++ /dev/null @@ -1,45 +0,0 @@ -{ 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/lib/kernel-version.nix b/lib/kernel-version.nix deleted file mode 100644 index 99115a7..0000000 --- a/lib/kernel-version.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ config, lib, ... }: -with lib; -let - cfg = config; -in -{ - options.kernelAtleast = mkOption { - type = types.listOf types.optionSet; - options = - [ { version = mkOption { - type = types.str; - example = "4.4"; - description = - "Issue warning when kernel version is below this number."; - }; - msg = mkOption { - type = types.str; - example = ""; - }; - } - ]; - }; - - config.warnings = builtins.concatLists (map - (x: if (builtins.compareVersions cfg.boot.kernelPackages.kernel.version x.version) == -1 - then [ "${x.msg} (${cfg.boot.kernelPackages.kernel.version} < ${x.version})" ] - else [ ] - ) cfg.kernelAtleast - ); - -}