From e0573105b7e3f03cf29c748970673ef52c7915bd Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 2 Nov 2011 16:10:30 +0000 Subject: [PATCH] * Disable stuff like ALSA and the splash screen in headless setups (like EC2 instances). svn path=/nixos/trunk/; revision=30192 --- modules/profiles/headless.nix | 10 ++++++++++ modules/virtualisation/amazon-image.nix | 5 +---- modules/virtualisation/nova-image.nix | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 modules/profiles/headless.nix diff --git a/modules/profiles/headless.nix b/modules/profiles/headless.nix new file mode 100644 index 00000000000..08519d58e8a --- /dev/null +++ b/modules/profiles/headless.nix @@ -0,0 +1,10 @@ +# Common configuration for headless machines (e.g., Amazon EC2 +# instances). + +{ + sound.enable = false; + boot.vesa = false; + boot.initrd.enableSplashScreen = false; + services.ttyBackgrounds.enable = false; + services.mingetty.ttys = [ ]; +} diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index 66474158c68..9f1d475df2d 100644 --- a/modules/virtualisation/amazon-image.nix +++ b/modules/virtualisation/amazon-image.nix @@ -3,7 +3,7 @@ with pkgs.lib; { - require = [ ./ec2-data.nix ]; + require = [ ../profiles/headless.nix ./ec2-data.nix ]; system.build.amazonImage = pkgs.vmTools.runInLinuxVM ( @@ -104,9 +104,6 @@ with pkgs.lib; mount -t aufs -o dirs=$targetRoot/ephemeral0/nix=rw:$targetRoot/nix=rr none $targetRoot/nix ''; - # There are no virtual consoles. - services.mingetty.ttys = [ ]; - # Allow root logins only using the SSH key that the user specified # at instance creation time. services.openssh.enable = true; diff --git a/modules/virtualisation/nova-image.nix b/modules/virtualisation/nova-image.nix index 1e891c35dc0..87489c39d35 100644 --- a/modules/virtualisation/nova-image.nix +++ b/modules/virtualisation/nova-image.nix @@ -3,7 +3,7 @@ with pkgs.lib; { - require = [ ../profiles/qemu-guest.nix ./ec2-data.nix ]; + require = [ ../profiles/qemu-guest.nix ../profiles/headless.nix ./ec2-data.nix ]; system.build.novaImage = pkgs.vmTools.runInLinuxVM (