about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/virtualisation/cloudstack-config.nix
blob: 78afebdc5dd3a6ff438ffabbffe968f75ba82d49 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{ lib, pkgs, ... }:

with lib;

{
  imports = [
    ../profiles/qemu-guest.nix
  ];

  config = {
    fileSystems."/" = {
      device = "/dev/disk/by-label/nixos";
      autoResize = true;
    };

    boot.growPartition = true;
    boot.kernelParams = [ "console=tty0" ];
    boot.loader.grub.device = "/dev/vda";
    boot.loader.timeout = 0;

    # Allow root logins
    services.openssh = {
      enable = true;
      permitRootLogin = "prohibit-password";
    };

    # Cloud-init configuration.
    services.cloud-init.enable = true;
    # Wget is needed for setting password. This is of little use as
    # root password login is disabled above.
    environment.systemPackages = [ pkgs.wget ];
    # Only enable CloudStack datasource for faster boot speed.
    environment.etc."cloud/cloud.cfg.d/99_cloudstack.cfg".text = ''
      datasource:
        CloudStack: {}
        None: {}
      datasource_list: ["CloudStack"]
    '';
  };
}