!atvIbxHoEqNcAIxYpN:nixos.org

NixOS AWS

64 Members
15 Servers

Load older messages


SenderMessageTime
7 Sep 2024
@commiterate:matrix.orgcommiterate *

It seems there's something I'm misunderstanding about the UKI that should be included in appliances. Maybe it includes systemd and some other stuff that removes the need for the /run folder and /bin/sh being symlinked to the Nix store's Bash install?

https://nixos.org/manual/nixos/stable/#sec-image-repart-appliance

There's this repo which seems to be producing a working image that the author is using: https://github.com/tnytown/nixos-lima-vm

Trying to do the same thing and launching the .raw file in Virtual Machine Manager w/ QEMU + KVM doesn't work though. It hangs at "Booting from Hard Disk...".

02:22:06
@commiterate:matrix.orgcommiterate Hmm even the current image I'm generating with make-nix-image hangs, so either something's wrong with both my images or my QEMU setup is broken. 03:05:09
@commiterate:matrix.orgcommiterate * Hmm even the current image I'm generating with make-nix-image hangs, so either something's wrong with both my images or my QEMU setup is broken. NixOS test VMs seem to work fine though (since I was able to run the one used in the amazon-cloudwatch-agent NixOS tests fine). 03:05:37
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 steps:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM and is optional if you don't need a full NixOS install. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in mode 1.

16:58:36
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 steps:

  1. Create a disk image with an EFI partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM and is optional if you don't need a full NixOS install. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in step 1.

16:58:50
@commiterate:matrix.orgcommiterateNevermind, it's because I disabled hardware virtualization awhile back in an attempt to fix some stability problems. Turning it back on and forcing QEMU to use UEFI lets it proceed.18:26:17
@commiterate:matrix.orgcommiterate * Nevermind, it's because I disabled hardware virtualization awhile back in an attempt to fix some stability problems. Turning it back on and forcing QEMU to use UEFI lets it proceed. Just fails to mount the root partition now.20:57:27
@commiterate:matrix.orgcommiterate *

Hmm playing around with nixos/modules/image/repart.nix and I'm not actually sure if this can be used in place of nixos/lib/make-disk-image.nix.

make-disk-image has 2 steps:

  1. Create a disk image with an EFI system partition (ESP) and a root partition with the Nix store in it.
  2. Create a disk image with a full NixOS on it.

Only step 2 requires booting up a VM and is optional if you don't need a full NixOS install. Essentially, it takes the disk image from step 1 and then runs NixOS install steps.

Step 1 doesn't require a VM just like repart, though it's using cptofs instead which is from the Linux kernel source tree (docs).

repart basically operates the same as make-disk-image in step 1.

21:00:52
14 Sep 2024
@arianvp:matrix.orgArianThere is no need for nixos-install to make a nixos image08:04:36
@arianvp:matrix.orgArianYou just need a /nix/store. The initrd takes care of setting up all other directories on startup 08:04:58
@arianvp:matrix.orgArianAnd you need to register the nix store paths into the nix database 08:05:10
@arianvp:matrix.orgArianI can make you a little example that is not appliance based08:05:25
@arianvp:matrix.orgArianBut need to catch a boat now first :')08:05:43
@arianvp:matrix.orgArianThere's also no need for UKIs. You can just put a classic systemd-boot bootloader entry on the ESP as well08:06:21
@arianvp:matrix.orgArianhttps://github.com/NixOS/amis/blob/main/modules/amazon-image.nix08:07:01
@commiterate:matrix.orgcommiterateyeah I have a non-UKI version in a local file I haven't pushed. Didn't get the root partition mount working yet since I got distracted with the EC2 SSH utils stuff (need to get EC2 Instance Connect working for the GitLab auto-scaling AWS runners)08:07:29
@arianvp:matrix.orgArianThis is missing the nix store path registration part though08:07:31
@arianvp:matrix.orgArian

So can do like a boot.postBootCommands =

nix-store --load-db < /nix/store/registration
08:10:30
@arianvp:matrix.orgArianSomeone made the bash script work with nix too08:10:52
@arianvp:matrix.orgArianDid you see that? Though a go version does sound better tbh08:11:07
@arianvp:matrix.orgArianAnyhow thanks for all the help on this. Nice to have another person trying to make this nicer.08:12:07
@commiterate:matrix.orgcommiterateyeah I saw a PR for macOS support that happens to also cover Nix08:12:39
@commiterate:matrix.orgcommiteratethough it seems like the repo's kind of abandoned08:12:58
@arianvp:matrix.orgArianhttps://github.com/NixOS/amis/pull/11408:13:41
@commiterate:matrix.orgcommiterateI'm meeting with some AWS TAMs on Tuesday to go over a few feature requests. I need to drag some AWS PM and engineer aliases out of them so the feature requests don't get lost in the system08:13:45
@commiterate:matrix.orgcommiterateoh huh08:13:51
@arianvp:matrix.orgArianWe also have TAMs here so if we can bundle forces to get something roadmapped that helps us lemme know08:14:25
@commiterate:matrix.orgcommiterateah they're relying on the fixup phase patching08:14:36
@arianvp:matrix.orgArianThough I'm on PTO until 23rd :)08:14:39
@commiterate:matrix.orgcommiterateI was going to try that at first and then just thought it would somehow be easier to rewrite08:14:50

Show newer messages


Back to Room ListRoom Version: 10