summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorlewo <lewo@abesis.fr>2017-09-11 18:33:33 +0200
committerJörg Thalheim <Mic92@users.noreply.github.com>2017-09-11 17:33:33 +0100
commit3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1 (patch)
tree44ac587f8cccab1ac3f2d38f34b76bab543c7660 /nixos
parent99b09a200675f83d310f9cccd813c37f5dc997c1 (diff)
downloadnixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.tar
nixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.tar.gz
nixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.tar.bz2
nixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.tar.lz
nixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.tar.xz
nixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.tar.zst
nixpkgs-3a377e26b2ebb2bd2951e47a9013ebc9da6fe2b1.zip
nixos/nova-image: cleanup image builders (#29242)
There are currently two ways to build Openstack image. This just picks
best of both, to keep only one!

- Image is resizable
- Cloudinit is enable
- Password authentication is disable by default
- Use the same layer than other image builders (ec2, gce...)
Diffstat (limited to 'nixos')
-rw-r--r--nixos/maintainers/scripts/openstack/nova-image.nix2
-rw-r--r--nixos/modules/virtualisation/cloud-image.nix44
-rw-r--r--nixos/modules/virtualisation/nova-config.nix9
3 files changed, 9 insertions, 46 deletions
diff --git a/nixos/maintainers/scripts/openstack/nova-image.nix b/nixos/maintainers/scripts/openstack/nova-image.nix
index fa9cfb74bd6..b6f3a5b1520 100644
--- a/nixos/maintainers/scripts/openstack/nova-image.nix
+++ b/nixos/maintainers/scripts/openstack/nova-image.nix
@@ -1,3 +1,5 @@
+# nix-build '<nixpkgs/nixos>' -A config.system.build.novaImage --arg configuration "{ imports = [ ./nixos/maintainers/scripts/openstack/nova-image.nix ]; }"
+
 { config, lib, pkgs, ... }:
 
 with lib;
diff --git a/nixos/modules/virtualisation/cloud-image.nix b/nixos/modules/virtualisation/cloud-image.nix
deleted file mode 100644
index 0f0141abfb1..00000000000
--- a/nixos/modules/virtualisation/cloud-image.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-# Usage:
-# $ NIX_PATH=`pwd`:nixos-config=`pwd`/nixpkgs/nixos/modules/virtualisation/cloud-image.nix nix-build '<nixpkgs/nixos>' -A config.system.build.cloudImage
-
-{ config, lib, pkgs, ... }:
-
-with lib;
-
-{
-  system.build.cloudImage = import ../../lib/make-disk-image.nix {
-    inherit pkgs lib config;
-    partitioned = true;
-    diskSize = 1 * 1024;
-    configFile = pkgs.writeText "configuration.nix"
-      ''
-        { config, lib, pkgs, ... }:
-
-        with lib;
-
-        {
-          imports = [ <nixpkgs/nixos/modules/virtualisation/cloud-image.nix> ];
-        }
-      '';
-  };
-
-  imports = [ ../profiles/qemu-guest.nix ];
-
-  fileSystems."/".device = "/dev/disk/by-label/nixos";
-
-  boot = {
-    kernelParams = [ "console=ttyS0" ];
-    loader.grub.device = "/dev/vda";
-    loader.timeout = 0;
-  };
-
-  networking.hostName = mkDefault "";
-
-  services.openssh = {
-    enable = true;
-    permitRootLogin = "without-password";
-    passwordAuthentication = mkDefault false;
-  };
-
-  services.cloud-init.enable = true;
-}
diff --git a/nixos/modules/virtualisation/nova-config.nix b/nixos/modules/virtualisation/nova-config.nix
index aac11ec8a17..c865cf451e4 100644
--- a/nixos/modules/virtualisation/nova-config.nix
+++ b/nixos/modules/virtualisation/nova-config.nix
@@ -22,8 +22,13 @@ with lib;
     boot.loader.timeout = 0;
 
     # Allow root logins
-    services.openssh.enable = true;
-    services.openssh.permitRootLogin = "prohibit-password";
+    services.openssh = {
+      enable = true;
+      permitRootLogin = "prohibit-password";
+      passwordAuthentication = mkDefault false;
+    };
+
+    services.cloud-init.enable = true;
 
     # Put /tmp and /var on /ephemeral0, which has a lot more space.
     # Unfortunately we can't do this with the `fileSystems' option