From da7133a088b74fd21dde255c24edac7facc58209 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 15 Jun 2023 15:02:48 +0200 Subject: initial commit --- README | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 README (limited to 'README') diff --git a/README b/README new file mode 100644 index 0000000..a1e59dd --- /dev/null +++ b/README @@ -0,0 +1,34 @@ +# Install NixOS on OCI VM.Standard.E2.1.Micro + +target=INSERT_YOUR_PUBLIC_IP_HERE + +kexec_tarball=$(nix-build --no-out-link '' -A config.system.build.kexec_tarball -I nixos-config=./kexec.nix) +scp $kexec_tarball/tarball/nixos-system-x86_64-linux.tar.xz ubuntu@$target:/tmp/ + +ssh ubuntu@$target +cd / && sudo tar xf /tmp/nixos-system-x86_64-linux.tar.xz && sudo /kexec_nixos + +sed -i "/^$target /d" ~/.ssh/known_hosts +ssh root@$target + +printf '%s\n' label:gpt ,512M,U ,4G,S ,,L | sfdisk /dev/sda +mkfs.fat -F 32 -n boot /dev/sda1 +mkswap -L swap /dev/sda2 +mkfs.ext4 -L root /dev/sda3 + +mkdir -m 0000 -p /mnt && mount /dev/disk/by-label/root /mnt +mkdir -m 0000 -p /mnt/boot && mount /dev/disk/by-label/boot /mnt/boot +swapon /dev/disk/by-label/swap + +mount -o remount,size=800M /nix/.rw-store/ + +nix-channel --add https://nixos.org/channels/nixos-23.05 nixpkgs +nix-channel --update + +scp config.nix root@$target:/mnt/etc/nixos/configuration.nix + +nixos-install --no-root-passwd +shutdown -r now + +sed -i "/^$target /d" ~/.ssh/known_hosts +ssh root@$target -- cgit v1.2.3