stuff
This commit is contained in:
1 parent
7a249c596a
commit
dbdd9034c9
5 files changed
+34
-11
No files matched your search
@@ -1,10 +1,27 @@
|
||||
# Nixos on GCP
|
||||
# Nixos on Google Cloud
|
||||
|
||||
## Building image
|
||||
|
||||
To build the gpc image use the below command
|
||||
|
||||
```shell
|
||||
nix build .#gcp
|
||||
```
|
||||
|
||||
Once the image has been built,
|
||||
|
||||
|
||||
```shell
|
||||
python upload.py --file result/nixos-image-...
|
||||
```
|
||||
|
||||
|
||||
|
||||
### GCE shit
|
||||
|
||||
|
||||
#### Metadata
|
||||
|
||||
```
|
||||
img_path=$(echo result/*.tar.gz)
|
||||
img_name=${IMAGE_NAME:-$(basename "$img_path")}
|
||||
img_id=$(echo "$img_name" | sed 's|.raw.tar.gz$||;s|\.|-|g;s|_|-|g')
|
||||
img_family=$(echo "$img_id" | cut -d - -f1-4)
|
||||
gcloud compute images create "$img_id" --source-uri "gs://${BUCKET_NAME}/$img_name" --family="$img_family"
|
||||
gcloud compute images add-iam-policy-binding "$img_id" --member='allAuthenticatedUsers' --role='roles/compute.imageUser'
|
||||
enable-oslogin: TRUE
|
||||
```
|
||||
Reference in new issue
Block a user