about summary refs log tree commit diff
path: root/nixos/modules/virtualisation
diff options
context:
space:
mode:
authorRyan Mulligan <ryan@ryantm.com>2019-02-24 08:28:42 -0800
committerGitHub <noreply@github.com>2019-02-24 08:28:42 -0800
commitd14f102334e2d91ce94c29be79ce57989c88206c (patch)
treed3d999399e17777481756a24fb981eae3a30154c /nixos/modules/virtualisation
parent1a50038ed707c59e41630b996a8a48a1a11f6540 (diff)
parent15f98b7192f7f0cde166d0b0a400cffefa5399ff (diff)
downloadnixlib-d14f102334e2d91ce94c29be79ce57989c88206c.tar
nixlib-d14f102334e2d91ce94c29be79ce57989c88206c.tar.gz
nixlib-d14f102334e2d91ce94c29be79ce57989c88206c.tar.bz2
nixlib-d14f102334e2d91ce94c29be79ce57989c88206c.tar.lz
nixlib-d14f102334e2d91ce94c29be79ce57989c88206c.tar.xz
nixlib-d14f102334e2d91ce94c29be79ce57989c88206c.tar.zst
nixlib-d14f102334e2d91ce94c29be79ce57989c88206c.zip
Merge pull request #44573 from vincentbernat/feature/cloudstack
nixos/cloudstack-image: initial import
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r--nixos/modules/virtualisation/cloudstack-config.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/nixos/modules/virtualisation/cloudstack-config.nix b/nixos/modules/virtualisation/cloudstack-config.nix
new file mode 100644
index 000000000000..81c545676277
--- /dev/null
+++ b/nixos/modules/virtualisation/cloudstack-config.nix
@@ -0,0 +1,40 @@
+{ config, 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"]
+    '';
+  };
+}