New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gce/create-gce.sh: rewrite using nix-shell shebang and bash #24869
Conversation
- allows to run the script without being the same directory - nix-shell install google-cloud-sdk - some shellcheck cleanups and scripting best practice
set -euo pipefail | ||
|
||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
NIXPKGS_ROOT="$DIR/../../../../" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to simply use nixpkgs
from $NIX_PATH, similar to nixos/maintainers/scripts/ec2/create-amis.sh
. I often need to tweak create-amis.sh
temporarily (e.g. upload to one region first) but I do want to ensure that the Nixpkgs used to build the image corresponds cleanly to a channel, rather than my working directory. So I do NIX_PATH=nixpkgs=channel:nixos-17.03 ./nixos/maintainers/scripts/ec2/create-amis.sh
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
-A config.system.build.googleComputeImage \ | ||
--argstr system x86_64-linux \ | ||
-o gce \ | ||
--option extra-binary-caches https://hydra.nixos.org \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I swapped http with https here, to make building an image remote a bit more trustworthy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this option legacy, AFAIK hydra.nixos.org doesn't serve anything anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
this allows NIX_PATH to be overwritten to build a different release
) * google-cloud-sdk: 150.0.0 -> 151.0.0 - gce/create-gce.sh: rewrite using nix-shell shebang and bash - allows to run the script without being the same directory - nix-shell install google-cloud-sdk - some shellcheck cleanups and scripting best practice - gce/create-gce.sh: do not clobber NIX_PATH: this allows NIX_PATH to be overwritten to build a different release - gce/create-gce.sh: remove legacy hydra option (cherry picked from commit 73c8797)
Motivation for this change
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)