From 6440e9bbfd22800cc5f967445fce9cc86e2ca0cd Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 13 Aug 2015 12:17:32 +0200 Subject: [PATCH] nixos/vbox: Move all options to virtualisation.*. Commit 687caeb renamed services.virtualboxHost to programs.virtualbox, but according to the discussion on the commit, it's probably a better to put it into virtualisation.virtualbox instead. The discussion can be found here: https://github.com/NixOS/nixpkgs/commit/687caeb#commitcomment-12664978 Signed-off-by: aszlig --- nixos/doc/manual/release-notes/rl-unstable.xml | 11 +++++++++++ nixos/modules/rename.nix | 11 ++++++++--- .../modules/virtualisation/virtualbox-guest.nix | 17 ++++------------- .../modules/virtualisation/virtualbox-host.nix | 4 ++-- nixos/tests/virtualbox.nix | 6 +++--- 5 files changed, 28 insertions(+), 21 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-unstable.xml b/nixos/doc/manual/release-notes/rl-unstable.xml index db20831ead8e..30da98faa330 100644 --- a/nixos/doc/manual/release-notes/rl-unstable.xml +++ b/nixos/doc/manual/release-notes/rl-unstable.xml @@ -92,6 +92,17 @@ was accordingly renamed to electron + + + The VirtualBox host and guest options have been moved/renamed more + consistently and less confusing to be now found in + virtualisation.virtualbox.host.* instead of + services.virtualboxHost.* and + virtualisation.virtualbox.guest.* instead of + services.virtualboxGuest.*. + + + Haskell packages can no longer be found by name, i.e. the commands diff --git a/nixos/modules/rename.nix b/nixos/modules/rename.nix index 7874c8462ca3..abecc065634a 100644 --- a/nixos/modules/rename.nix +++ b/nixos/modules/rename.nix @@ -109,7 +109,14 @@ in zipModules ([] ++ obsolete [ "services" "xserver" "startOpenSSHAgent" ] [ "programs" "ssh" "startAgent" ] # VirtualBox -++ obsolete [ "services" "virtualbox" "enable" ] [ "services" "virtualboxGuest" "enable" ] +++ obsolete [ "services" "virtualbox" "enable" ] [ "virtualisation" "virtualbox" "guest" "enable" ] +++ obsolete [ "services" "virtualboxGuest" "enable" ] [ "virtualisation" "virtualbox" "guest" "enable" ] +++ obsolete [ "programs" "virtualbox" "enable" ] [ "virtualisation" "virtualbox" "host" "enable" ] +++ obsolete [ "programs" "virtualbox" "addNetworkInterface" ] [ "virtualisation" "virtualbox" "host" "addNetworkInterface" ] +++ obsolete [ "programs" "virtualbox" "enableHardening" ] [ "virtualisation" "virtualbox" "host" "enableHardening" ] +++ obsolete [ "services" "virtualboxHost" "enable" ] [ "virtualisation" "virtualbox" "host" "enable" ] +++ obsolete [ "services" "virtualboxHost" "addNetworkInterface" ] [ "virtualisation" "virtualbox" "host" "addNetworkInterface" ] +++ obsolete [ "services" "virtualboxHost" "enableHardening" ] [ "virtualisation" "virtualbox" "host" "enableHardening" ] # Tarsnap ++ obsolete [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ] @@ -144,8 +151,6 @@ in zipModules ([] # DNSCrypt-proxy ++ obsolete [ "services" "dnscrypt-proxy" "port" ] [ "services" "dnscrypt-proxy" "localPort" ] -++ obsolete [ "services" "virtualboxHost" ] [ "programs" "virtualbox" ] - # Options that are obsolete and have no replacement. ++ obsolete' [ "boot" "loader" "grub" "bootDevice" ] ++ obsolete' [ "boot" "initrd" "luks" "enable" ] diff --git a/nixos/modules/virtualisation/virtualbox-guest.nix b/nixos/modules/virtualisation/virtualbox-guest.nix index 6c4014fc4a1e..642ea3154b1b 100644 --- a/nixos/modules/virtualisation/virtualbox-guest.nix +++ b/nixos/modules/virtualisation/virtualbox-guest.nix @@ -6,7 +6,7 @@ with lib; let - cfg = config.services.virtualboxGuest; + cfg = config.virtualisation.virtualbox.guest; kernel = config.boot.kernelPackages; in @@ -15,20 +15,11 @@ in ###### interface - options = { - - services.virtualboxGuest = { - - enable = mkOption { - default = false; - description = "Whether to enable the VirtualBox service and other guest additions."; - }; - - }; - + options.virtualisation.virtualbox.guest.enable = mkOption { + default = false; + description = "Whether to enable the VirtualBox service and other guest additions."; }; - ###### implementation config = mkIf cfg.enable { diff --git a/nixos/modules/virtualisation/virtualbox-host.nix b/nixos/modules/virtualisation/virtualbox-host.nix index b8b3d62a0319..00486df5c4ba 100644 --- a/nixos/modules/virtualisation/virtualbox-host.nix +++ b/nixos/modules/virtualisation/virtualbox-host.nix @@ -3,7 +3,7 @@ with lib; let - cfg = config.programs.virtualbox; + cfg = config.virtualisation.virtualbox.host; virtualbox = config.boot.kernelPackages.virtualbox.override { inherit (cfg) enableHardening; }; @@ -11,7 +11,7 @@ let in { - options.programs.virtualbox = { + options.virtualisation.virtualbox.host = { enable = mkOption { type = types.bool; default = false; diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix index 4895eb134dc1..83a8b2835dc2 100644 --- a/nixos/tests/virtualbox.nix +++ b/nixos/tests/virtualbox.nix @@ -31,7 +31,7 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let fsType = "vboxsf"; }; - services.virtualboxGuest.enable = true; + virtualisation.virtualbox.guest.enable = true; boot.initrd.kernelModules = [ "af_packet" "vboxsf" @@ -308,9 +308,9 @@ in { vmConfigs = mapAttrsToList mkVMConf vboxVMs; in [ ./common/user-account.nix ./common/x11.nix ] ++ vmConfigs; virtualisation.memorySize = 768; - services.virtualboxHost.enable = true; + virtualisation.virtualbox.host.enable = true; users.extraUsers.alice.extraGroups = let - inherit (config.services.virtualboxHost) enableHardening; + inherit (config.virtualisation.virtualbox.host) enableHardening; in lib.mkIf enableHardening (lib.singleton "vboxusers"); };