mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
nixos/cloudstack-image: initial import
Cloudstack images are simply using cloud-init. They are not headless as a user usually have access to a console. Otherwise, the difference with Openstack are mostly handled by cloud-init. This is still some minor issues. Notably, there is no non-root user. Other cloud images usually come with a user named after the distribution and with sudo. Would it make sense for NixOS? Cloudstack gives the user the ability to change the password. Cloud-init support for this is imperfect and the set-passwords module should be declared as `- [set-passwords, always]` for this to work. I don't know if there is an easy way to "patch" default cloud-init configuration. However, without a non-root user, this is of no use. Similarly, hostname is usually set through cloud-init using `set_hostname` and `update_hostname` modules. While the patch to declare nixos to cloud-init contains some code to set hostname, the previously mentioned modules are not enabled.
This commit is contained in:
parent
31adf33217
commit
15f98b7192
2 changed files with 63 additions and 0 deletions
23
nixos/maintainers/scripts/cloudstack/cloudstack-image.nix
Normal file
23
nixos/maintainers/scripts/cloudstack/cloudstack-image.nix
Normal file
|
@ -0,0 +1,23 @@
|
|||
# nix-build '<nixpkgs/nixos>' -A config.system.build.cloudstackImage --arg configuration "{ imports = [ ./nixos/maintainers/scripts/cloudstack/cloudstack-image.nix ]; }"
|
||||
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports =
|
||||
[ ../../../modules/virtualisation/cloudstack-config.nix ];
|
||||
|
||||
system.build.cloudstackImage = import ../../../lib/make-disk-image.nix {
|
||||
inherit lib config pkgs;
|
||||
diskSize = 8192;
|
||||
format = "qcow2";
|
||||
configFile = pkgs.writeText "configuration.nix"
|
||||
''
|
||||
{
|
||||
imports = [ <nixpkgs/nixos/modules/virtualisation/cloudstack-config.nix> ];
|
||||
}
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue