forked from mirrors/nixpkgs
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...)
This commit is contained in:
parent
99b09a2006
commit
3a377e26b2
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue