summary refs log tree commit diff
path: root/nixos/modules/virtualisation/oci-common.nix
diff options
context:
space:
mode:
authorilian <ilian@tuta.io>2021-04-17 21:09:25 +0200
committerThiago Kenji Okada <thiagokokada@gmail.com>2023-09-21 22:15:22 +0100
commit362d1d6218e04aad7d9bbf93227d227666f29e6d (patch)
treee95877ccde8b37bd0c32d32b93054dd3997e119b /nixos/modules/virtualisation/oci-common.nix
parentc57e7d5622bed85759f3153db62fd991dcd43fa6 (diff)
downloadnixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.tar
nixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.tar.gz
nixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.tar.bz2
nixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.tar.lz
nixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.tar.xz
nixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.tar.zst
nixpkgs-362d1d6218e04aad7d9bbf93227d227666f29e6d.zip
oci-image: init scripts to build and upload image
Add image configuration for Oracle Cloud Infrastructure and scripts to
build and upload the image as a Custom Image.
Diffstat (limited to 'nixos/modules/virtualisation/oci-common.nix')
-rw-r--r--nixos/modules/virtualisation/oci-common.nix39
1 files changed, 39 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/oci-common.nix b/nixos/modules/virtualisation/oci-common.nix
new file mode 100644
index 00000000000..f6327445a32
--- /dev/null
+++ b/nixos/modules/virtualisation/oci-common.nix
@@ -0,0 +1,39 @@
+{ lib, pkgs, ... }:
+
+with lib;
+{
+  imports = [ ../profiles/qemu-guest.nix ];
+
+  # Taken from /proc/cmdline of Ubuntu 20.04.2 LTS on OCI
+  boot.kernelParams = [
+    "console=tty1"
+    "console=ttyS0"
+    "nvme.shutdown_timeout=10"
+    "libiscsi.debug_libiscsi_eh=1"
+    "crash_kexec_post_notifiers"
+  ];
+
+  boot.growPartition = true;
+
+  fileSystems."/" = {
+    device = "/dev/disk/by-label/nixos";
+    fsType = "ext4";
+    autoResize = true;
+  };
+
+  boot.loader.grub = {
+    version = 2;
+    device = "/dev/sda";
+    splashImage = null;
+    extraConfig = ''
+      serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
+      terminal_input --append serial
+      terminal_output --append serial
+    '';
+  };
+
+  # 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;
+}