1{ config, lib, pkgs, ... }:
2
3let
4 cfg = config.oci;
5in
6{
7 imports = [ ../profiles/qemu-guest.nix ];
8
9 # Taken from /proc/cmdline of Ubuntu 20.04.2 LTS on OCI
10 boot.kernelParams = [
11 "nvme.shutdown_timeout=10"
12 "nvme_core.shutdown_timeout=10"
13 "libiscsi.debug_libiscsi_eh=1"
14 "crash_kexec_post_notifiers"
15
16 # VNC console
17 "console=tty1"
18
19 # x86_64-linux
20 "console=ttyS0"
21
22 # aarch64-linux
23 "console=ttyAMA0,115200"
24 ];
25
26 boot.growPartition = true;
27
28 fileSystems."/" = {
29 device = "/dev/disk/by-label/nixos";
30 fsType = "ext4";
31 autoResize = true;
32 };
33
34 fileSystems."/boot" = lib.mkIf cfg.efi {
35 device = "/dev/disk/by-label/ESP";
36 fsType = "vfat";
37 };
38
39 boot.loader.efi.canTouchEfiVariables = false;
40 boot.loader.grub = {
41 device = if cfg.efi then "nodev" else "/dev/sda";
42 splashImage = null;
43 extraConfig = ''
44 serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
45 terminal_input --append serial
46 terminal_output --append serial
47 '';
48 efiInstallAsRemovable = cfg.efi;
49 efiSupport = cfg.efi;
50 };
51
52 # https://docs.oracle.com/en-us/iaas/Content/Compute/Tasks/configuringntpservice.htm#Configuring_the_Oracle_Cloud_Infrastructure_NTP_Service_for_an_Instance
53 networking.timeServers = [ "169.254.169.254" ];
54
55 services.openssh.enable = true;
56
57 # Otherwise the instance may not have a working network-online.target,
58 # making the fetch-ssh-keys.service fail
59 networking.useNetworkd = lib.mkDefault true;
60}