From 1d2de0e46d0948a2a9b5cbe5cb19e5103c94505c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cyryl=20P=C5=82otnicki?= Date: Sun, 7 Jul 2019 08:56:14 +0100 Subject: [PATCH] refactor virtualbox --- nixos/boxes/foureighty.nix | 8 ++------ nixos/boxes/skinnyv.nix | 7 +------ nixos/virtualbox.nix | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 12 deletions(-) create mode 100644 nixos/virtualbox.nix diff --git a/nixos/boxes/foureighty.nix b/nixos/boxes/foureighty.nix index 44908f90..dd2488a8 100644 --- a/nixos/boxes/foureighty.nix +++ b/nixos/boxes/foureighty.nix @@ -32,6 +32,7 @@ loader.efi.canTouchEfiVariables = true; }; + time.hardwareClockInLocalTime = true; time.timeZone = "Europe/London"; hardware.bumblebee.enable = true; @@ -73,16 +74,11 @@ ]; }; - virtualisation.virtualbox.host = { - enable = true; - enableExtensionPack = true; - enableHardening = false; #needed for 3D acceleration - }; - imports = [ /etc/nixos/hardware-configuration.nix ../boot.nix ../common.nix ../gfx-intel.nix + ../virtualbox.nix ]; } diff --git a/nixos/boxes/skinnyv.nix b/nixos/boxes/skinnyv.nix index a53b3586..16627eb2 100644 --- a/nixos/boxes/skinnyv.nix +++ b/nixos/boxes/skinnyv.nix @@ -20,16 +20,11 @@ }; time.timeZone = "Europe/London"; - virtualisation.virtualbox.host = { - enable = true; - enableExtensionPack = true; - enableHardening = false; #needed for 3D acceleration - }; - imports = [ /etc/nixos/hardware-configuration.nix ../boot.nix ../common.nix ../gfx-intel.nix + ../virtualbox.nix ]; } diff --git a/nixos/virtualbox.nix b/nixos/virtualbox.nix new file mode 100644 index 00000000..e49a918b --- /dev/null +++ b/nixos/virtualbox.nix @@ -0,0 +1,17 @@ +{ config, pkgs, ... }: +let + unstableTarball = fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz; +in +{ + nixpkgs.config = { + packageOverrides = pkgs: { + unstable = import unstableTarball { + config = config.nixpkgs.config; + }; + }; + }; + virtualisation.virtualbox.host = { + enable = true; + enableExtensionPack = true; + }; +}