2021-05-29 04:02:14 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2021-04-17 21:09:25 +02:00
|
|
|
|
2021-05-29 04:02:14 +02:00
|
|
|
let
|
|
|
|
cfg = config.oci;
|
|
|
|
in
|
2021-04-17 21:09:25 +02:00
|
|
|
{
|
|
|
|
imports = [ ../profiles/qemu-guest.nix ];
|
|
|
|
|
|
|
|
# Taken from /proc/cmdline of Ubuntu 20.04.2 LTS on OCI
|
|
|
|
boot.kernelParams = [
|
|
|
|
"nvme.shutdown_timeout=10"
|
2021-05-29 04:02:14 +02:00
|
|
|
"nvme_core.shutdown_timeout=10"
|
2021-04-17 21:09:25 +02:00
|
|
|
"libiscsi.debug_libiscsi_eh=1"
|
|
|
|
"crash_kexec_post_notifiers"
|
2021-05-29 04:02:14 +02:00
|
|
|
|
|
|
|
# VNC console
|
|
|
|
"console=tty1"
|
|
|
|
|
|
|
|
# x86_64-linux
|
|
|
|
"console=ttyS0"
|
|
|
|
|
|
|
|
# aarch64-linux
|
|
|
|
"console=ttyAMA0,115200"
|
2021-04-17 21:09:25 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
boot.growPartition = true;
|
|
|
|
|
|
|
|
fileSystems."/" = {
|
|
|
|
device = "/dev/disk/by-label/nixos";
|
|
|
|
fsType = "ext4";
|
|
|
|
autoResize = true;
|
|
|
|
};
|
|
|
|
|
2021-05-29 04:02:14 +02:00
|
|
|
fileSystems."/boot" = lib.mkIf cfg.efi {
|
|
|
|
device = "/dev/disk/by-label/ESP";
|
|
|
|
fsType = "vfat";
|
|
|
|
};
|
|
|
|
|
|
|
|
boot.loader.efi.canTouchEfiVariables = false;
|
2021-04-17 21:09:25 +02:00
|
|
|
boot.loader.grub = {
|
2021-05-29 04:02:14 +02:00
|
|
|
device = if cfg.efi then "nodev" else "/dev/sda";
|
2021-04-17 21:09:25 +02:00
|
|
|
splashImage = null;
|
|
|
|
extraConfig = ''
|
|
|
|
serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
|
|
|
|
terminal_input --append serial
|
|
|
|
terminal_output --append serial
|
|
|
|
'';
|
2021-05-29 04:02:14 +02:00
|
|
|
efiInstallAsRemovable = cfg.efi;
|
|
|
|
efiSupport = cfg.efi;
|
2021-04-17 21:09:25 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
# https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/configuringntpservice.htm#Configuring_the_Oracle_Cloud_Infrastructure_NTP_Service_for_an_Instance
|
|
|
|
networking.timeServers = [ "169.254.169.254" ];
|
|
|
|
|
|
|
|
services.openssh.enable = true;
|
2023-09-21 23:05:52 +02:00
|
|
|
|
|
|
|
# Otherwise the instance may not have a working network-online.target,
|
|
|
|
# making the fetch-ssh-keys.service fail
|
2023-09-28 23:03:28 +02:00
|
|
|
networking.useNetworkd = lib.mkDefault true;
|
2021-04-17 21:09:25 +02:00
|
|
|
}
|