From 433a9ffcbddda74b0449eba251246a60221ae7cd Mon Sep 17 00:00:00 2001 From: Ethel Morgan Date: Fri, 29 May 2020 21:45:44 +0100 Subject: better mirror upstream nixpkgs layout --- nixos/modules/linode.nix | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 nixos/modules/linode.nix (limited to 'nixos/modules/linode.nix') diff --git a/nixos/modules/linode.nix b/nixos/modules/linode.nix new file mode 100644 index 0000000..d70c929 --- /dev/null +++ b/nixos/modules/linode.nix @@ -0,0 +1,38 @@ +{ config, pkgs, lib, ... }: +with lib; + +# from https://www.linode.com/docs/tools-reference/custom-kernels-distros/install-nixos-on-linode/. + +let + cfg = config.eth.linode; + +in { + + options.eth.linode = { + enable = mkEnableOption "good defaults for Linodes"; + }; + + config = mkIf cfg.enable { + + # Enable LISH serial console. + boot.kernelParams = [ "console=ttyS0,19200n8" ]; + boot.loader.grub.extraConfig = '' + serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1; + terminal_input serial; + terminal_output serial; + ''; + + # GRUB has issues with Linode, + # so this ignores the warnings. + boot.loader.grub.forceInstall = true; + + # A long timeout to cope with LISH delays. + boot.loader.timeout = 10; + + boot.loader.grub = { + enable = true; + version = 2; + device = "nodev"; # "nodev" for EFI. + }; + }; +} -- cgit v1.2.3