Install NixOS on GCE: Difference between revisions
imported>Fadenb Created page with "This is a recipe for creating a NixOS machine on Google Compute Engine (GCE) which is part of [https://cloud.google.com/ Google Cloud Platform]. This tutorial assumes you have..." |
imported>Mic92 |
||
Line 113: | Line 113: | ||
You normally can use a preexisting NixOS image, such as the ones found in gs://nixos-images. Sometimes the images there haven't been updated in a long time, or you need a newer one to work around a bug. If you need to make a new one, here's how. Perform these steps from any Linux machine. | You normally can use a preexisting NixOS image, such as the ones found in gs://nixos-images. Sometimes the images there haven't been updated in a long time, or you need a newer one to work around a bug. If you need to make a new one, here's how. Perform these steps from any Linux machine. | ||
You'll need | You'll need setup the credentials for Google Cloud, with the Cloud Storage and Compute Engine APIs enabled. You'll also need a Storage bucket. These steps will assume you've already made a bucket and it's named <code>gs://example</code>. | ||
Prepare a local copy of the nixpkgs repository in the state you want to build from. If you want to build a released version, this means checking out one of the release branches from the nixpkgs-channels repository. Make sure you haven't left any unwanted local changes in it. These examples assume you've checked it out at <code>/home/example/nixpkgs-clean</code>. | Prepare a local copy of the nixpkgs repository in the state you want to build from. If you want to build a released version, this means checking out one of the release branches from the nixpkgs-channels repository. Make sure you haven't left any unwanted local changes in it. These examples assume you've checked it out at <code>/home/example/nixpkgs-clean</code>. | ||
$ | $ BUCKET_NAME=example /home/example/nixpkgs-clean/maintainers/create-gce.sh | ||
This will create an image and upload it to the bucket <code>example</code> | |||