{"id":32692046,"url":"https://github.com/kaiju/nixos-image-gcloud-example","last_synced_at":"2026-07-08T10:31:51.711Z","repository":{"id":320493060,"uuid":"1082291497","full_name":"kaiju/nixos-image-gcloud-example","owner":"kaiju","description":"NixOS Image Building for Google Cloud Compute Engine","archived":false,"fork":false,"pushed_at":"2025-10-25T00:05:07.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-01T15:07:36.705Z","etag":null,"topics":["cloud-infrastructure","configuration-management","devops","google-cloud","nixos"],"latest_commit_sha":null,"homepage":"","language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaiju.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-24T02:54:01.000Z","updated_at":"2025-10-25T00:05:10.000Z","dependencies_parsed_at":"2025-10-24T05:31:59.910Z","dependency_job_id":null,"html_url":"https://github.com/kaiju/nixos-image-gcloud-example","commit_stats":null,"previous_names":["kaiju/nixos-image-gcloud-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kaiju/nixos-image-gcloud-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaiju%2Fnixos-image-gcloud-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaiju%2Fnixos-image-gcloud-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaiju%2Fnixos-image-gcloud-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaiju%2Fnixos-image-gcloud-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaiju","download_url":"https://codeload.github.com/kaiju/nixos-image-gcloud-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaiju%2Fnixos-image-gcloud-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35262336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-08T02:00:06.796Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloud-infrastructure","configuration-management","devops","google-cloud","nixos"],"created_at":"2025-11-01T15:02:04.462Z","updated_at":"2026-07-08T10:31:51.706Z","avatar_url":"https://github.com/kaiju.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NixOS Image Building for Google Cloud Compute Engine\n\nThe only thing better than having declarative configuration management as a first class feature of your OS is leveraging it to build deployable images from your system configuration. No more hacking together Ansible and Packer or shoving overwrought shell scripts into cloud-init!\n\nNixOS provides [modules](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/image/images.nix) that can be used to build a variety of images. In this example we'll use the [`google-compute`](https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/google-compute-image.nix) module to build an image suitable for deploying on Google Cloud.\n\n## Building\n\nOn NixOS:\n```\n# nixos-rebuild build-image --flake '.#example' --image-variant google-compute\n```\n\nAlternatively with Nix on other Linux environments:\n```\n# nix build '.#nixosConfigurations.example.config.system.build.images.google-compute'\n```\n\nUpload image result to GCS:\n\n```\n# gcloud storage cp result/image.raw.tar.gz gs://\u003cbucket\u003e/\n```\n\nCreate new Compute Engine image:\n\n```\n# gcloud compute images create nixos-example-image --source-uri gs://\u003cbucket\u003e/image.raw.tar.gz\n```\n\n## Cloud Build\n\nThe image build \u0026 publish process can also be automated with Cloud Build. `cloudbuild.yaml` is a pipeline that creates a Nix builder, builds the system image, uploads it to GCS, and creates a new image in Compute Engine.\n\n```\n# gcloud builds submit . --substitutions=\"_BUCKET=\u003cbucket\u003e,SHORT_SHA=$(git rev-parse --short HEAD)\"\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaiju%2Fnixos-image-gcloud-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaiju%2Fnixos-image-gcloud-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaiju%2Fnixos-image-gcloud-example/lists"}