Skip to content

Packer template to build NixOS image for Linode

License

Notifications You must be signed in to change notification settings

vholer/packer-nixos-linode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NixOS image for Linode

The repository contains the Packer template to locally build NixOS image for Linode and optionally upload via preconfigured linode-cli.

⚠️ WARNING: NixOS is not officially supported on Linode. There are few guides on how to install NixOS on Linode and this tooling mainly follows the updated steps documented by Tom Doggett on https://gist.github.com/nocoolnametom/a359624afce4278f16e2760fe65468cc. Use at your own risk!

Build

Requirements:

To build NixOS image for Linode, type:

packer build .

If the build succeeds, you'll find the gzipped image (with filename extension .gz) in build/ directory. Manually upload the gzipped image (.gz) image to the Linode via the web browser. Go to Linode ManagerImagesCreate Image → tab Upload Image.

Automatically Upload Image

If you have linode-cli installed and configured, the Packer can optionally trigger image upload automatically.

Firstly, check the linode-cli works, e.g.:

$ linode-cli linodes list
┌────┬───────┬────────┬──────┬───────┬────────┬──────┐
│ id │ label │ region │ type │ image │ status │ ipv4 │
└────┴───────┴────────┴──────┴───────┴────────┴──────┘

To build and automatically upload the image to Linode, type:

$ packer build -var linode_upload=true .

Run Linode VM

To successfully run a VM from the uploaded image, you'll need to do a few simple customizations in the configuration profile of each(!) of your new NixOS Linode VM.

  1. Create a Linode VM from uploaded image.

  2. Update configuration

  • go to your Linode VM details
  • tab Configurations
  • click on Edit on the current configuration

Linode

And do following changes:

  • in Boot Settings
    • set Select a Kernel to GRUB 2

Linode

  • in Filesystem/Boot Helpers change following features
    • uncheck Enable distro helper
    • uncheck Auto-configure networking

Linode

  • Save the configuration
  1. Reboot into a new configuration

Click on Boot to reflect the changes.

Linode

About

Packer template to build NixOS image for Linode

Topics

Resources

License

Stars

Watchers

Forks