Files
nixos/modules/nixos/linode.nix
T

51 lines
1.1 KiB
Nix
Raw Normal View History

2024-10-19 01:19:59 -05:00
{
config,
lib,
pkgs,
...
}:
2022-04-25 22:29:44 -05:00
let
cfg = config.greg.linode;
2022-04-25 22:29:44 -05:00
in
with lib;
2022-04-25 22:29:44 -05:00
{
options.greg.linode = {
enable = mkEnableOption "Set sensible defaults for a Linode host";
2022-04-25 22:29:44 -05:00
bootTimeout = mkOption {
type = types.int;
default = 15;
description = "Set bootloader timeout in seconds.";
};
};
2022-04-25 22:29:44 -05:00
config = mkIf cfg.enable {
# Enables connection over Linode consoles
boot.kernelParams = [ "console=ttyS0,19200n8" ];
boot.loader.grub = {
device = "nodev";
extraConfig = ''
serial --speed=19200 --unit=0 --word=8 --parity=no --stop=1;
terminal_input serial;
terminal_output serial;
'';
};
2022-04-25 22:29:44 -05:00
# Tells grub to ignore partion-free device warnings, since we are on Linode
boot.loader.timeout = 15;
2022-04-25 22:29:44 -05:00
networking.usePredictableInterfaceNames = false; # Use old style eth0 names
networking.useDHCP = false;
networking.interfaces.eth0.useDHCP = true;
2022-04-25 22:29:44 -05:00
# Suggested diagnostic tools
environment.systemPackages = with pkgs; [
inetutils
mtr
sysstat
];
};
2022-04-25 22:29:44 -05:00
}