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 <aszlig@redmoonstudios.org>
This commit is contained in:
parent
f741d426da
commit
6440e9bbfd
|
@ -92,6 +92,17 @@ was accordingly renamed to <literal>electron</literal>
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
|
<listitem>
|
||||||
|
<para>
|
||||||
|
The VirtualBox host and guest options have been moved/renamed more
|
||||||
|
consistently and less confusing to be now found in
|
||||||
|
<literal>virtualisation.virtualbox.host.*</literal> instead of
|
||||||
|
<literal>services.virtualboxHost.*</literal> and
|
||||||
|
<literal>virtualisation.virtualbox.guest.*</literal> instead of
|
||||||
|
<literal>services.virtualboxGuest.*</literal>.
|
||||||
|
</para>
|
||||||
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>
|
<para>
|
||||||
Haskell packages can no longer be found by name, i.e. the commands
|
Haskell packages can no longer be found by name, i.e. the commands
|
||||||
|
|
|
@ -109,7 +109,14 @@ in zipModules ([]
|
||||||
++ obsolete [ "services" "xserver" "startOpenSSHAgent" ] [ "programs" "ssh" "startAgent" ]
|
++ obsolete [ "services" "xserver" "startOpenSSHAgent" ] [ "programs" "ssh" "startAgent" ]
|
||||||
|
|
||||||
# VirtualBox
|
# 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
|
# Tarsnap
|
||||||
++ obsolete [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ]
|
++ obsolete [ "services" "tarsnap" "config" ] [ "services" "tarsnap" "archives" ]
|
||||||
|
@ -144,8 +151,6 @@ in zipModules ([]
|
||||||
# DNSCrypt-proxy
|
# DNSCrypt-proxy
|
||||||
++ obsolete [ "services" "dnscrypt-proxy" "port" ] [ "services" "dnscrypt-proxy" "localPort" ]
|
++ obsolete [ "services" "dnscrypt-proxy" "port" ] [ "services" "dnscrypt-proxy" "localPort" ]
|
||||||
|
|
||||||
++ obsolete [ "services" "virtualboxHost" ] [ "programs" "virtualbox" ]
|
|
||||||
|
|
||||||
# Options that are obsolete and have no replacement.
|
# Options that are obsolete and have no replacement.
|
||||||
++ obsolete' [ "boot" "loader" "grub" "bootDevice" ]
|
++ obsolete' [ "boot" "loader" "grub" "bootDevice" ]
|
||||||
++ obsolete' [ "boot" "initrd" "luks" "enable" ]
|
++ obsolete' [ "boot" "initrd" "luks" "enable" ]
|
||||||
|
|
|
@ -6,7 +6,7 @@ with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
cfg = config.services.virtualboxGuest;
|
cfg = config.virtualisation.virtualbox.guest;
|
||||||
kernel = config.boot.kernelPackages;
|
kernel = config.boot.kernelPackages;
|
||||||
|
|
||||||
in
|
in
|
||||||
|
@ -15,20 +15,11 @@ in
|
||||||
|
|
||||||
###### interface
|
###### interface
|
||||||
|
|
||||||
options = {
|
options.virtualisation.virtualbox.guest.enable = mkOption {
|
||||||
|
default = false;
|
||||||
services.virtualboxGuest = {
|
description = "Whether to enable the VirtualBox service and other guest additions.";
|
||||||
|
|
||||||
enable = mkOption {
|
|
||||||
default = false;
|
|
||||||
description = "Whether to enable the VirtualBox service and other guest additions.";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
###### implementation
|
###### implementation
|
||||||
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.programs.virtualbox;
|
cfg = config.virtualisation.virtualbox.host;
|
||||||
virtualbox = config.boot.kernelPackages.virtualbox.override {
|
virtualbox = config.boot.kernelPackages.virtualbox.override {
|
||||||
inherit (cfg) enableHardening;
|
inherit (cfg) enableHardening;
|
||||||
};
|
};
|
||||||
|
@ -11,7 +11,7 @@ let
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
options.programs.virtualbox = {
|
options.virtualisation.virtualbox.host = {
|
||||||
enable = mkOption {
|
enable = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = false;
|
default = false;
|
||||||
|
|
|
@ -31,7 +31,7 @@ import ./make-test.nix ({ pkgs, ... }: with pkgs.lib; let
|
||||||
fsType = "vboxsf";
|
fsType = "vboxsf";
|
||||||
};
|
};
|
||||||
|
|
||||||
services.virtualboxGuest.enable = true;
|
virtualisation.virtualbox.guest.enable = true;
|
||||||
|
|
||||||
boot.initrd.kernelModules = [
|
boot.initrd.kernelModules = [
|
||||||
"af_packet" "vboxsf"
|
"af_packet" "vboxsf"
|
||||||
|
@ -308,9 +308,9 @@ in {
|
||||||
vmConfigs = mapAttrsToList mkVMConf vboxVMs;
|
vmConfigs = mapAttrsToList mkVMConf vboxVMs;
|
||||||
in [ ./common/user-account.nix ./common/x11.nix ] ++ vmConfigs;
|
in [ ./common/user-account.nix ./common/x11.nix ] ++ vmConfigs;
|
||||||
virtualisation.memorySize = 768;
|
virtualisation.memorySize = 768;
|
||||||
services.virtualboxHost.enable = true;
|
virtualisation.virtualbox.host.enable = true;
|
||||||
users.extraUsers.alice.extraGroups = let
|
users.extraUsers.alice.extraGroups = let
|
||||||
inherit (config.services.virtualboxHost) enableHardening;
|
inherit (config.virtualisation.virtualbox.host) enableHardening;
|
||||||
in lib.mkIf enableHardening (lib.singleton "vboxusers");
|
in lib.mkIf enableHardening (lib.singleton "vboxusers");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue