Skip to content

Instantly share code, notes, and snippets.

@dbaynard
Created June 23, 2021 15:06
Show Gist options
  • Save dbaynard/523700a1a5bed1628fd817c833460c6e to your computer and use it in GitHub Desktop.
Save dbaynard/523700a1a5bed1628fd817c833460c6e to your computer and use it in GitHub Desktop.
Creating nixos lxc image for crostini
Install arch https://wiki.archlinux.org/title/Chrome_OS_devices/Crostini
lxc config set arch security.nesting true
Within arch, configure downloads
mkdir ~/Downloads && sudo mount -o bind /mnt/chromeos/MyFiles/Downloads ~/Downloads
Install nix (just use the standard multi-user nix installer)
Install lxd
Add user to group lxd
sudo systemctl enable lxd.service
logout cycle for arch
lxd init
Patch nixos-generators (gettty fix), then install
lxc image import $(nixos-generate -f lxc-metadata) $(nixos-generate -f lxc) --alias nixos
lxc image export NixOS ~/Downloads
Then in termina, with FINGERPRINT defined to match unique start of full fingerprint,
lxc image import /mnt/shared/MyFiles/Downloads/meta-${FINGERPRINT?}*.tar.xz /mnt/shared/MyFiles/Downloads/${FINGERPRINT?}*.tar.xz --alias nixos
lxc init nixos nixos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment