Skip to content
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

Google Compute Engine image module #49854

Merged
merged 5 commits into from Nov 26, 2018

Conversation

dingxiangfei2009
Copy link
Contributor

@dingxiangfei2009 dingxiangfei2009 commented Nov 7, 2018

Motivation for this change

Make the image output overridable, since the disk size of a GCE image is somehow arbitrarily hard-coded. Related: #36450.

Request for comments: should we write this into a module instead, so that we expose some configurable options? Related: #36425.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@dingxiangfei2009
Copy link
Contributor Author

@rbvermaa any suggestion?

pushd $out
mv $diskImage disk.raw
tar -Szcf nixos-image-${config.system.nixos.label}-${pkgs.stdenv.hostPlatform.system}.raw.tar.gz disk.raw
rm $out/disk.raw
popd
'';
configFile = <nixpkgs/nixos/modules/virtualisation/google-compute-config.nix>;
configFile = ./google-compute-config.nix;
format = "raw";
inherit diskSize;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed this diskSize should become a module option instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, gonna re-formulate this into a module.

@dingxiangfei2009
Copy link
Contributor Author

@Mic92 Tested the built image on GCE. I can log in with gcloud SSH command and nixos-rebuild switch with additional configurations.

Notice that the service fetch-ssh-keys is removed, because this service is not going to work anymore (cf. #24273).

@dingxiangfei2009 dingxiangfei2009 changed the title Make GCE image overridable Google Compute Engine image module Nov 26, 2018
@Mic92
Copy link
Member

Mic92 commented Nov 26, 2018

Please use rebase in future instead of merge when syncing your changes with master.

@Mic92 Mic92 merged commit 8857053 into NixOS:master Nov 26, 2018
@dingxiangfei2009 dingxiangfei2009 deleted the gce-overridable-image branch November 27, 2018 01:35
@dingxiangfei2009
Copy link
Contributor Author

@Mic92 Got ya.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants