1{ lib, pkgs, ... }:
2
3with lib;
4
5{
6 imports = [
7 ../profiles/qemu-guest.nix
8 ];
9
10 config = {
11 fileSystems."/" = lib.mkImageMediaOverride {
12 device = "/dev/disk/by-label/nixos";
13 autoResize = true;
14 fsType = "ext4";
15 };
16
17 boot.growPartition = true;
18 boot.kernelParams = [ "console=tty0" ];
19 boot.loader.grub.device = "/dev/vda";
20 boot.loader.timeout = 0;
21
22 # Allow root logins
23 services.openssh = {
24 enable = true;
25 settings.PermitRootLogin = "prohibit-password";
26 };
27
28 # Cloud-init configuration.
29 services.cloud-init.enable = true;
30 # Wget is needed for setting password. This is of little use as
31 # root password login is disabled above.
32 environment.systemPackages = [ pkgs.wget ];
33 # Only enable CloudStack datasource for faster boot speed.
34 environment.etc."cloud/cloud.cfg.d/99_cloudstack.cfg".text = ''
35 datasource:
36 CloudStack: {}
37 None: {}
38 datasource_list: ["CloudStack"]
39 '';
40 };
41}