Move Linode support to a module
This commit is contained in:
@@ -3,13 +3,13 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
../../profiles/linode.nix
|
|
||||||
./nextcloud.nix
|
./nextcloud.nix
|
||||||
./nginx.nix
|
./nginx.nix
|
||||||
./postgres.nix
|
./postgres.nix
|
||||||
./synapse.nix
|
./synapse.nix
|
||||||
];
|
];
|
||||||
greg.home = false;
|
greg.home = false;
|
||||||
|
greg.linode.enable = true;
|
||||||
networking.hostName = "linode";
|
networking.hostName = "linode";
|
||||||
networking.domain = "thehellings.com";
|
networking.domain = "thehellings.com";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./home.nix
|
./home.nix
|
||||||
|
./linode.nix
|
||||||
./proxy.nix
|
./proxy.nix
|
||||||
./rpi4.nix
|
./rpi4.nix
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
cfg = config.greg.linode;
|
||||||
|
|
||||||
|
in with lib;
|
||||||
|
{
|
||||||
|
options.greg.linode = {
|
||||||
|
enable = mkEnableOption "Set sensible defaults for a Linode host";
|
||||||
|
|
||||||
|
bootTimeout = mkOption {
|
||||||
|
type = types.int;
|
||||||
|
default = 15;
|
||||||
|
description = "Set bootloader timeout in seconds.";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
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;
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Tells grub to ignore partion-free device warnings, since we are on Linode
|
||||||
|
boot.loader.timeout = 15;
|
||||||
|
|
||||||
|
networking.usePredictableInterfaceNames = false; # Use old style eth0 names
|
||||||
|
networking.useDHCP = false;
|
||||||
|
networking.interfaces.eth0.useDHCP = true;
|
||||||
|
|
||||||
|
# Suggested diagnostic tools
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
inetutils
|
||||||
|
mtr
|
||||||
|
sysstat
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
# 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;
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
# Tells grub to ignore partion-free device warnings, since we are on Linode
|
|
||||||
boot.loader.timeout = 15;
|
|
||||||
|
|
||||||
networking.usePredictableInterfaceNames = false; # Use old style eth0 names
|
|
||||||
networking.useDHCP = false;
|
|
||||||
networking.interfaces.eth0.useDHCP = true;
|
|
||||||
|
|
||||||
# Suggested diagnostic tools
|
|
||||||
environment.systemPackages = with pkgs; [
|
|
||||||
inetutils
|
|
||||||
mtr
|
|
||||||
sysstat
|
|
||||||
];
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user