diff options
author | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-29 21:59:17 +0100 |
---|---|---|
committer | Ethel Morgan <eth@ethulhu.co.uk> | 2020-05-29 21:59:17 +0100 |
commit | 5111fcc4a49bcef1c336e03f5279d053bae3806c (patch) | |
tree | 9b4c4fb32baa690238a9d9965e5fc0690c0790d4 /nixos/modules/hardware/linode.nix | |
parent | 3fa100e7539e25e60d4094d43cb69ae663742556 (diff) |
move various hardware configs around
Diffstat (limited to 'nixos/modules/hardware/linode.nix')
-rw-r--r-- | nixos/modules/hardware/linode.nix | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/nixos/modules/hardware/linode.nix b/nixos/modules/hardware/linode.nix new file mode 100644 index 0000000..d70c929 --- /dev/null +++ b/nixos/modules/hardware/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. + }; + }; +} |